CMake/Tests/RunCMake/export/DependOnDifferentSetExport.cmake
Matthew Woehlke 26691689a3 export: Allow compatible build-tree exports
Modify how cmExportBuildFileGenerator::FindExportInfo collects target
export information to properly record the export sets which export a
target. (The old behavior treated every invocation as a separate set,
which is reasonable for export(TARGETS) but does not allow referencing a
target exported multiple times via export(EXPORT). This reflects recent
changes to allow this for installed exports.)
2025-02-24 14:54:50 -05:00

8 lines
405 B
CMake

add_library(doubleexported INTERFACE)
install(TARGETS doubleexported EXPORT exportset)
export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake")
export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake")
add_library(exported INTERFACE)
target_link_libraries(exported INTERFACE doubleexported)
export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")