Reputation: 3381
I'm using find_package
to find the dependencies that I need for my project, as follows:
find_package(CURL REQUIRED)
if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES})
endif()
But, I would like to know how I can give the option for the user set manually in the cmake-gui when find_package
fails.
Upvotes: 2
Views: 405
Reputation: 3381
I solved the problem by putting CONFIG
after the REQUIRED
.
find_package(CURL REQUIRED CONFIG)
if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES})
endif()
Upvotes: 2