diff options
Diffstat (limited to 'Tests/RunCMake/GenEx-COMPILE_LANGUAGE/TARGET_PROPERTY.cmake')
-rw-r--r-- | Tests/RunCMake/GenEx-COMPILE_LANGUAGE/TARGET_PROPERTY.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/TARGET_PROPERTY.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/TARGET_PROPERTY.cmake new file mode 100644 index 0000000..293ddda --- /dev/null +++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/TARGET_PROPERTY.cmake @@ -0,0 +1,17 @@ +enable_language(C) + +add_library (lib SHARED empty.c) +set_target_properties(lib PROPERTIES + INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:C>:/usr/include>" + COMPILE_DEFINITIONS "$<$<COMPILE_LANGUAGE:C>:DEF>" + COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:C>:-O>") + +add_custom_target(drive + COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES> + $<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS> + $<TARGET_PROPERTY:lib,COMPILE_OPTIONS>) + +add_custom_command(TARGET drive PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES> + $<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS> + $<TARGET_PROPERTY:lib,COMPILE_OPTIONS>) |