1include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake) 2 3 4# The sources of custom0 will not be modified by set_property! 5add_custom_target(custom0) 6target_sources(custom0 PRIVATE 7 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt" 8) 9# The sources of custom[1-6] will (tried to) be modified by set_property! 10add_custom_target(custom1) 11target_sources(custom1 PRIVATE 12 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt" 13) 14add_custom_target(custom2) 15target_sources(custom2 PRIVATE 16 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt" 17) 18add_custom_target(custom3) 19target_sources(custom3 PRIVATE 20 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt" 21) 22add_custom_target(custom4) 23target_sources(custom4 PRIVATE 24 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt" 25) 26add_custom_target(custom5) 27target_sources(custom5 PRIVATE 28 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt" 29) 30add_custom_target(custom6) 31target_sources(custom6 PRIVATE 32 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt" 33) 34 35 36add_custom_command( 37 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt" 38 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in" 39 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt" 40) 41add_custom_command( 42 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt" 43 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in" 44 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt" 45) 46add_custom_command( 47 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt" 48 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in" 49 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt" 50) 51add_custom_command( 52 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt" 53 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in" 54 "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt" 55) 56 57add_subdirectory(subdir-Common-Test10) 58 59get_and_print_GENERATED_property("Generated_source0.txt") 60get_and_print_GENERATED_property("Generated_source1.txt") 61get_and_print_GENERATED_property("Generated_source2.txt") 62get_and_print_GENERATED_property("Generated_source3.txt") 63get_and_print_GENERATED_property("Generated_source4.txt") 64get_and_print_GENERATED_property("Generated_source5.txt") 65get_and_print_GENERATED_property("Generated_source6.txt") 66