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

Could not find a package configuration file provided by "cppnetlib" (requested version 0.13.0) with any of the following names #895

Open
Mactarvish opened this issue May 25, 2021 · 1 comment

Comments

@Mactarvish
Copy link

Mactarvish commented May 25, 2021

I have compiled and installed cppnetlib on my Ubuntu following https://cpp-netlib.org/0.13.0/getting_started.html and everything is OK. But when I tried to use it in my project by :
set ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ~/cpp-netlib-build ) find_package ( cppnetlib 0.13.0 REQUIRED ) include_directories ( ${CPPNETLIB_INCLUDE_DIRS} ) target_link_libraries ( MyApplication ${CPPNETLIB_LIBRARIES} )

I got the error:
`
CMake Error at CMakeLists.txt:9 (find_package):
By not providing "Findcppnetlib.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"cppnetlib", but CMake did not find one.

Could not find a package configuration file provided by "cppnetlib"
(requested version 0.13.0) with any of the following names:

cppnetlibConfig.cmake
cppnetlib-config.cmake

Add the installation prefix of "cppnetlib" to CMAKE_PREFIX_PATH or set
"cppnetlib_DIR" to a directory containing one of the above files. If
"cppnetlib" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!
See also "/home/paas_requester/download_image_testbed/build/CMakeFiles/CMakeOutput.log".
Makefile:176: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
`

And I've checked that there's actually no config.cmake under cpp-netlib-build.

@deanberris
Copy link
Member

What happens when you remove the CMAKE_PREFIX_PATH setting? Typically, the installation process will place the cppnetlibConfig.cmake file in the global CMake registry, unless you install it in a specific installation prefix.

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

No branches or pull requests

2 participants