Brad King b9856862fe Tests: Cover set_property for buildsystem target properties
Extend the RunCMake.set_property test with cases covering buildsystem
target properties:

* COMPILE_DEFINITIONS
* COMPILE_FEATURES
* COMPILE_OPTIONS
* INCLUDE_DIRECTORIES
* LINK_LIBRARIES
* SOURCES

Also test a non-buildsystem property to document the current difference
in behavior.  Refactor the existing LINK_LIBRARIES case to the same
more-extensive test as the rest.  Use the output generated by CMake 3.3
as the expected output for each test case.
2015-09-03 06:52:36 -04:00

15 lines
712 B
CMake

macro(test_target_property PROP)
add_custom_target(CustomTarget)
set_property(TARGET CustomTarget PROPERTY ${PROP} x)
set_property(TARGET CustomTarget PROPERTY ${PROP})
set_property(TARGET CustomTarget APPEND PROPERTY ${PROP})
set_property(TARGET CustomTarget PROPERTY ${PROP} a)
set_property(TARGET CustomTarget APPEND PROPERTY ${PROP} "")
set_property(TARGET CustomTarget APPEND PROPERTY ${PROP} b c)
set_property(TARGET CustomTarget APPEND PROPERTY ${PROP})
set_property(TARGET CustomTarget APPEND PROPERTY ${PROP} "d;;e")
get_property(val TARGET CustomTarget PROPERTY ${PROP})
message(STATUS "Target ${PROP} is '${val}'")
set_property(TARGET CustomTarget PROPERTY ${PROP})
endmacro()