Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我find_package用来查找我的项目所需的依赖项,如下所示:
find_package
find_package(CURL REQUIRED) if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES}) endif()
但是,我想知道当find_package失败时如何在 cmake-gui 中为用户手动设置选项。
我通过CONFIG在REQUIRED.
CONFIG
REQUIRED
find_package(CURL REQUIRED CONFIG) if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES}) endif()