mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 22:30:13 -06:00
Include the name of the `EXPORT` in the filename when generating export information for C++ modules. This allows the same directory to be used for multiple sets of C++ module-using targets. For `export(TARGETS)` uses, generate a name based on the hash of the concatenation of the target names involved with the `export()` call. Fixes: #25609
22 lines
577 B
CMake
22 lines
577 B
CMake
enable_language(CXX)
|
|
set(CMAKE_CXX_SCANDEP_SOURCE "")
|
|
|
|
add_library(export-modules)
|
|
target_sources(export-modules
|
|
PUBLIC
|
|
FILE_SET fs TYPE CXX_MODULES FILES
|
|
sources/module.cxx)
|
|
target_compile_features(export-modules
|
|
PRIVATE
|
|
cxx_std_20)
|
|
set_property(TARGET export-modules
|
|
PROPERTY EXPORT_NAME export-name)
|
|
|
|
install(TARGETS export-modules
|
|
EXPORT exp
|
|
FILE_SET fs DESTINATION "include/cxx/export-modules")
|
|
|
|
export(TARGETS export-modules
|
|
FILE "${CMAKE_BINARY_DIR}/lib/cmake/export-modules/export-modules-targets.cmake"
|
|
CXX_MODULES_DIRECTORY "cxx-modules")
|