diff --git a/include/BoostInstall.cmake b/include/BoostInstall.cmake index 1127c6f..bdeb7d7 100644 --- a/include/BoostInstall.cmake +++ b/include/BoostInstall.cmake @@ -320,6 +320,8 @@ function(boost_install_target) install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake) + set_target_properties(${LIB} PROPERTIES _boost_is_installed ON) + 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") diff --git a/include/BoostRoot.cmake b/include/BoostRoot.cmake index bd7f8be..ad37410 100644 --- a/include/BoostRoot.cmake +++ b/include/BoostRoot.cmake @@ -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(is_installed "boost_${__boost_lib_target}" _boost_is_installed) + if(is_installed) + 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")