mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03:00
CMake's properties will never begin with an underscore or a lowercase letter, so allow them to be set by projects.
17 lines
667 B
CMake
17 lines
667 B
CMake
|
|
add_library(iface INTERFACE)
|
|
|
|
set_property(TARGET iface PROPERTY OUTPUT_NAME output)
|
|
set_property(TARGET iface APPEND PROPERTY OUTPUT_NAME append)
|
|
get_target_property(outname iface OUTPUT_NAME)
|
|
|
|
# Properties starting with `_` are allowed.
|
|
set_property(TARGET iface PROPERTY "_custom_property" output)
|
|
set_property(TARGET iface APPEND PROPERTY "_custom_property" append)
|
|
get_target_property(outname iface "_custom_property")
|
|
|
|
# Properties starting with a lowercase letter are allowed.
|
|
set_property(TARGET iface PROPERTY "custom_property" output)
|
|
set_property(TARGET iface APPEND PROPERTY "custom_property" append)
|
|
get_target_property(outname iface "custom_property")
|