Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion include/BoostInstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,41 @@ function(boost_install_target)
string(APPEND CONFIG_INSTALL_DIR "-static")
endif()

if(NOT CMAKE_VERSION VERSION_LESS 3.28)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest VERSION_GREATER_EQUAL rather than inverted logic.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

get_target_property(INTERFACE_CXX_MODULE_SETS ${LIB} INTERFACE_CXX_MODULE_SETS)
if(INTERFACE_CXX_MODULE_SETS)
boost_message(DEBUG "boost_install_target: '${__TARGET}' has INTERFACE_CXX_MODULE_SETS=${INTERFACE_CXX_MODULE_SETS}")
set(__INSTALL_CXX_MODULES FILE_SET ${INTERFACE_CXX_MODULE_SETS} DESTINATION ${CONFIG_INSTALL_DIR})
endif()
endif()

if(NOT CMAKE_VERSION VERSION_LESS 3.23)
get_target_property(INTERFACE_HEADER_SETS ${LIB} INTERFACE_HEADER_SETS)
if(INTERFACE_HEADER_SETS)
boost_message(DEBUG "boost_install_target: '${__TARGET}' has INTERFACE_HEADER_SETS=${INTERFACE_HEADER_SETS}")
set(__INSTALL_HEADER_SETS FILE_SET ${INTERFACE_HEADER_SETS})
endif()
endif()

install(TARGETS ${LIB} EXPORT ${LIB}-targets
# explicit destination specification required for 3.13, 3.14 no longer needs it
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PRIVATE_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
# explicit needed if used starting with cmake v3.28
# XXX FILE_SET CXX_MODULES DESTINATION ${CONFIG_INSTALL_DIR}
${__INSTALL_CXX_MODULES}
# Any module files from C++ modules from PUBLIC sources in a file set of type CXX_MODULES will be installed to the given DESTINATION.
# FIXME: why does this silently not work here? CK
# XXX CXX_MODULES_BMI DESTINATION ${CONFIG_INSTALL_DIR}/bmi-${CMAKE_CXX_COMPILER_ID}_$<CONFIG>
# explicit needed if used starting with cmake v3.23
# XXX FILE_SET HEADERS
${__INSTALL_HEADER_SETS}
)

# TODO(CK): what is this for?
export(TARGETS ${LIB} NAMESPACE Boost:: FILE export/${LIB}-targets.cmake)

if(MSVC)
Expand All @@ -362,7 +388,9 @@ function(boost_install_target)
__boost_install_update_sources(${LIB} ${__EXTRA_DIRECTORY} ${__EXTRA_INSTALL_DIRECTORY})
endif()

install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake)
install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake
# XXX CXX_MODULES_DIRECTORY .
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got plans for this? Leave it out?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found a better solution

)

set_target_properties(${LIB} PROPERTIES _boost_is_installed ON)

Expand Down