summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FileAPIExternalSource
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2018-11-09 18:54:41 (GMT)
committerBrad King <brad.king@kitware.com>2018-12-12 14:45:49 (GMT)
commitea0a0601682af00706cf57f6d3e27d4f0895ecbb (patch)
tree539ef9baee753df0254f5c207dcc3d0dc56af949 /Tests/RunCMake/FileAPIExternalSource
parent3e922ceb5e8cc4c4d72ddcbd8b485803c49d84f1 (diff)
downloadCMake-ea0a0601682af00706cf57f6d3e27d4f0895ecbb.zip
CMake-ea0a0601682af00706cf57f6d3e27d4f0895ecbb.tar.gz
CMake-ea0a0601682af00706cf57f6d3e27d4f0895ecbb.tar.bz2
fileapi: Add test for codemodel v2
Diffstat (limited to 'Tests/RunCMake/FileAPIExternalSource')
-rw-r--r--Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt12
-rw-r--r--Tests/RunCMake/FileAPIExternalSource/empty.c0
2 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
new file mode 100644
index 0000000..f5670a7
--- /dev/null
+++ b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
@@ -0,0 +1,12 @@
+project(External)
+enable_language(CXX)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" "")
+add_executable(generated_exe empty.c)
+target_sources(generated_exe PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx")
+source_group("Generated Source Files" FILES "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" PROPERTY GENERATED ON)
+set_property(SOURCE empty.c PROPERTY COMPILE_DEFINITIONS EMPTY_C=1 SRC_DUMMY)
+set_property(SOURCE empty.c PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")
+target_include_directories(generated_exe SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
+target_compile_definitions(generated_exe PRIVATE GENERATED_EXE=1 -DTGT_DUMMY)
diff --git a/Tests/RunCMake/FileAPIExternalSource/empty.c b/Tests/RunCMake/FileAPIExternalSource/empty.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/FileAPIExternalSource/empty.c