summaryrefslogtreecommitdiff
path: root/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CustomCommand/GeneratedHeader/CMakeLists.txt')
-rw-r--r--Tests/CustomCommand/GeneratedHeader/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
new file mode 100644
index 0000000..2d47d87
--- /dev/null
+++ b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Simulate in-source build include-file behavior for out-of-source
+# builds.
+SET(CMAKE_INCLUDE_CURRENT_DIR 1)
+
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h
+ COMMAND
+ ${CMAKE_COMMAND} ARGS -E
+ copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/generated.h
+)
+
+ADD_LIBRARY(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h)
+