project(target_prop) add_executable(target_prop_executable ../compiletest.cpp) set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_FUN) if (NOT NO_SPACES_IN_DEFINE_VALUES) set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun" CMAKE_IS=Fun) else() set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun) endif() set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_FUN CMAKE_IS_="Fun") set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS TEST_GENERATOR_EXPRESSIONS "$<1:CMAKE_IS_DECLARATIVE>" "$<0:GE_NOT_DEFINED>" "$<1:ARGUMENT;LIST>" PREFIX_$ LETTER_LIST1=\"$\" LETTER_LIST2=\"$\" LETTER_LIST3=\"$\" LETTER_LIST4=\"$\" LETTER_LIST5=\"$\" "$<$:LINK_CXX_DEFINE>" "$<$:LINK_C_DEFINE>" "LINK_LANGUAGE_IS_$" ) set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS BUILD_IS_DEBUG=$ BUILD_IS_NOT_DEBUG=$> ) add_executable(target_prop_c_executable ../compiletest.c) set_property(TARGET target_prop_c_executable APPEND PROPERTY COMPILE_DEFINITIONS "$<$:LINK_CXX_DEFINE>" "$<$:LINK_C_DEFINE>" "LINK_LANGUAGE_IS_$" ) # Resulting link language will be CXX add_executable(target_prop_mixed_executable ../compiletest_mixed_c.c ../compiletest_mixed_cxx.cpp) set_property(TARGET target_prop_mixed_executable APPEND PROPERTY COMPILE_DEFINITIONS "$<$:LINK_CXX_DEFINE>" "$<$:LINK_C_DEFINE>" "LINK_LANGUAGE_IS_$" )