2
0
mirror of https://github.com/boostorg/cmake.git synced 2026-01-19 04:02:15 +00:00

Merge pull request #58 from Neumann-A/optional-deps

Add optional deps into generated config
This commit is contained in:
Peter Dimov
2024-04-24 13:23:54 +03:00
committed by GitHub

View File

@@ -334,6 +334,12 @@ function(boost_install_target)
string(APPEND CONFIG_FILE_CONTENTS " find_dependency(boost_${CMAKE_MATCH_1} ${__VERSION} EXACT)\n")
string(APPEND CONFIG_FILE_CONTENTS "endif()\n")
elseif(dep MATCHES "^\\$<TARGET_NAME_IF_EXISTS:Boost::(.*)>$")
string(APPEND CONFIG_FILE_CONTENTS "if(NOT boost_${CMAKE_MATCH_1}_FOUND)\n")
string(APPEND CONFIG_FILE_CONTENTS " find_package(boost_${CMAKE_MATCH_1} ${__VERSION} EXACT QUIET)\n")
string(APPEND CONFIG_FILE_CONTENTS "endif()\n")
elseif(dep STREQUAL "Threads::Threads")
string(APPEND CONFIG_FILE_CONTENTS "set(THREADS_PREFER_PTHREAD_FLAG ON)\n")