Files
CMake/Tests/RunCMake/ExportImport/SpdxLicenseProperty-export.cmake
T
Daniel Tierney df3e246bc1 export: Import/export target property for license
Add import/export support and documentation for the SPDX_LICENSE
target property. A target's license can be specified by setting
this property to an SPDX license expression. CMake and CPS-format
export files generated with `export()` or `install()` will
retain the license information. CMake also imports the license
property for imported targets.

Closes: #26706
2025-05-13 17:01:20 -04:00

7 lines
253 B
CMake

add_library(foo INTERFACE)
set_property(TARGET foo PROPERTY SPDX_LICENSE "BSD-3-Clause")
install(TARGETS foo EXPORT foo)
install(EXPORT foo DESTINATION lib/cmake/foo)
install(FILES foo-config.cmake.in RENAME foo-config.cmake DESTINATION lib/cmake/foo)