mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 11:10:06 -05:00
df3e246bc1
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
7 lines
270 B
CMake
7 lines
270 B
CMake
find_package(foo REQUIRED CONFIG NO_DEFAULT_PATH)
|
|
get_property(SPDX_LICENSE TARGET foo PROPERTY SPDX_LICENSE)
|
|
if(NOT SPDX_LICENSE STREQUAL "BSD-3-Clause")
|
|
message(FATAL_ERROR
|
|
"Expected SPDX_LICENSE property to be 'BSD-3-Clause' but got '${SPDX_LICENSE}'")
|
|
endif()
|