mirror of
https://github.com/boostorg/cmake.git
synced 2026-01-19 04:02:15 +00:00
Avoid installing libraries multiple times or issueing wrong message
Some libraries call `boost_install` themselves which adds `INSTALL_INTERFACE` to their `INTERFACE_INCLUDE_DIRETORIES` property. That then makes the install check in `__boost_auto_install` fail and print a message that the library won't be installed while it will be. Use a label to detect targets for which `boost_install` was already called and skip the logic in `__boost_auto_install` for those.
This commit is contained in:
@@ -320,6 +320,10 @@ function(boost_install_target)
|
||||
|
||||
install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake)
|
||||
|
||||
get_target_property(labels ${LIB} LABELS)
|
||||
list(APPEND labels boost_install_specified)
|
||||
set_target_properties(${LIB} PROPERTIES LABELS "${labels}")
|
||||
|
||||
set(CONFIG_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/tmpinst/${LIB}-config.cmake")
|
||||
set(CONFIG_FILE_CONTENTS "# Generated by BoostInstall.cmake for ${LIB}-${__VERSION}\n\n")
|
||||
|
||||
|
||||
@@ -182,6 +182,11 @@ function(__boost_auto_install __boost_lib)
|
||||
|
||||
if(TARGET "Boost::${__boost_lib_target}" AND TARGET "boost_${__boost_lib_target}")
|
||||
|
||||
get_target_property(labels "boost_${__boost_lib_target}" LABELS)
|
||||
if("boost_install_specified" IN_LIST labels)
|
||||
return() # Ignore libraries for which boost_install was already called
|
||||
endif()
|
||||
|
||||
get_target_property(__boost_lib_incdir "boost_${__boost_lib_target}" INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
set(incdir "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/${__boost_lib}/include")
|
||||
|
||||
Reference in New Issue
Block a user