Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PcapPlusPlus Configuration Error in CMake with vcpkg #1356

Closed
kezniklm opened this issue Apr 10, 2024 · 8 comments
Closed

PcapPlusPlus Configuration Error in CMake with vcpkg #1356

kezniklm opened this issue Apr 10, 2024 · 8 comments
Labels
build any build issue Windows

Comments

@kezniklm
Copy link

kezniklm commented Apr 10, 2024

I've encountered a configuration error related to PcapPlusPlus when building my project using vcpkg to manage dependencies. The error specifically mentions a problem with PcapPlusPlusConfig.cmake, indicating that a file or directory referenced by the variable PcapPlusPlus_INCLUDE_DIR does not exist. This issue has emerged recently, as CI builds were proceeding without problems two days ago.

Steps to Reproduce

  1. Set up vcpkg and integrate it with any project.
  2. Install PcapPlusPlus along with other dependencies using vcpkg install.
  3. Run CMake to configure the project, pointing it to use the vcpkg toolchain file.

The following error occurs during the CMake configuration phase:
CMake Error at build/vcpkg_installed/x64-linux/share/pcapplusplus/PcapPlusPlusConfig.cmake:18 (message):
File or directory /include/pcapplusplus referenced by variable
PcapPlusPlus_INCLUDE_DIR does not exist !
Call Stack (most recent call first):
build/vcpkg_installed/x64-linux/share/pcapplusplus/PcapPlusPlusConfig.cmake:38 (set_and_check)
/home/user/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
CMakeLists.txt:13 (find_package)

After commenting out the set_and_check(PcapPlusPlus_INCLUDE_DIR ${PACKAGE_PREFIX_DIR}/include/pcapplusplus) in PcapPlusPlusConfig.cmake it works, but It is impractical to comment it out every build.

@tigercosmos tigercosmos added Windows build any build issue labels Apr 10, 2024
@egecetin
Copy link
Collaborator

Looks like MacOS CI workflows also has the same problem

https://github.com/seladb/PcapPlusPlus/actions/runs/8687358735/job/23820713337?pr=1360

@egecetin
Copy link
Collaborator

@kezniklm What is your CMake version in your system?

Might be related with this. Looks like runners updated recently and they bumped the CMake version to 3.29.1 actions/runner-images#9652

@kezniklm
Copy link
Author

kezniklm commented Apr 15, 2024

@kezniklm What is your CMake version in your system?

Might be related with this. Looks like runners updated recently and they bumped the CMake version to 3.29.1 actions/runner-images#9652

@egecetin
I have: cmake version 3.29.2

@egecetin
Copy link
Collaborator

@clementperon Do you have any idea about this? Probably a bug introduced with CMake 3.29.1.

@clementperon
Copy link
Collaborator

Hi,

From linux Ubuntu 22.04, cmake version 3.29.2.

I can build the PcapPlusPlus example without any issue.

$> git clone vcpkg
$> ./vcpkg/vcpkg install pcapplusplus
$> cmake -B test -S . "-DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake"
$> cmake --build test

Could you give the output of the PcapPlusPLusConfig.cmake ?

I will check the CI

@kezniklm
Copy link
Author

The output should be in the issue definition. After compiling locally on 3.29.2 it eventually started to work, while in CI, where the cmake is 3.29.1 error persists.

@clementperon
Copy link
Collaborator

clementperon commented Apr 15, 2024

microsoft/vcpkg#37968
It's a CMake regression:
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9390

@kezniklm
Copy link
Author

Updating CMake in CI to 3.29.2 fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build any build issue Windows
Projects
None yet
Development

No branches or pull requests

4 participants