diff options
Diffstat (limited to 'Tests/RunCMake/File_Generate/OutputNameMatchesOtherSources.cmake')
-rw-r--r-- | Tests/RunCMake/File_Generate/OutputNameMatchesOtherSources.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesOtherSources.cmake b/Tests/RunCMake/File_Generate/OutputNameMatchesOtherSources.cmake new file mode 100644 index 0000000..ce601da --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutputNameMatchesOtherSources.cmake @@ -0,0 +1,14 @@ + +enable_language(CXX) + +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<BOOL:$<TARGET_PROPERTY:foo,SOURCES>>somefile.cpp" + CONTENT "static const char content[] = \"$<TARGET_PROPERTY:foo,SOURCES>\";\n" +) + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated.cpp" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.cpp" "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(foo empty.cpp "${CMAKE_CURRENT_BINARY_DIR}/generated.cpp") + +add_executable(bar "${CMAKE_CURRENT_BINARY_DIR}/1somefile.cpp") |