summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/File_Generate/GenerateSource.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/File_Generate/GenerateSource.cmake')
-rw-r--r--Tests/RunCMake/File_Generate/GenerateSource.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/GenerateSource.cmake b/Tests/RunCMake/File_Generate/GenerateSource.cmake
new file mode 100644
index 0000000..147a7f6
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/GenerateSource.cmake
@@ -0,0 +1,12 @@
+
+enable_language(CXX)
+
+# Ensure re-generation
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ CONTENT "int main() { return 0; }\n"
+)
+
+add_executable(mn "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")