2

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.

Alex
  • 3,301
  • 4
  • 29
  • 43

1 Answers1

2

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()
Alex
  • 3,301
  • 4
  • 29
  • 43