Reputation: 403
In CMakeLists.txt I write:
INCLUDE(CheckLibraryExists)
check_library_exists("libcurl" "" "" HAVE_CURL)
HAVE_CURL is always false, even if libcurl installed, and this function not causes fatal errors.
Upvotes: 2
Views: 1050
Reputation: 171167
To check why a a try-compile fails, you can run CMake with the --debug-trycompile
option, which will leave behind the buildsystem for the last try_compile
command (these are used internally by all the Check...
modules).
I didn't run the check, but I looked at the code of CheckLibraryExists
, and it is apparently mandatory to specify a function to look for in that library (the second argument to check_library_exists
).
Upvotes: 2