diff options
Diffstat (limited to 'Tests/RunCMake/File_Generate')
-rw-r--r-- | Tests/RunCMake/File_Generate/GenerateSource.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/File_Generate/GenerateSource/CMakeLists.txt | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/GenerateSource.cmake b/Tests/RunCMake/File_Generate/GenerateSource.cmake index 147a7f6..d5504e3 100644 --- a/Tests/RunCMake/File_Generate/GenerateSource.cmake +++ b/Tests/RunCMake/File_Generate/GenerateSource.cmake @@ -10,3 +10,6 @@ file(GENERATE ) add_executable(mn "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") + +add_subdirectory(GenerateSource) +target_link_libraries(mn PRIVATE ObjLib) diff --git a/Tests/RunCMake/File_Generate/GenerateSource/CMakeLists.txt b/Tests/RunCMake/File_Generate/GenerateSource/CMakeLists.txt new file mode 100644 index 0000000..bca8922 --- /dev/null +++ b/Tests/RunCMake/File_Generate/GenerateSource/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(ObjLib OBJECT) + +target_sources(ObjLib PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/ObjLib.cpp") + +# Ensure re-generation +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/ObjLib.cpp") + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ObjLib.cpp" CONTENT "") |