summaryrefslogtreecommitdiffstats
path: root/Tests/BuildDepends/Project
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2013-07-23 18:53:00 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-26 14:12:03 (GMT)
commit9275554496b32662d840cbe1e0b9c2a460835ac6 (patch)
tree8a22f9f1e1da7927a3399d898ca70ba5cd51a345 /Tests/BuildDepends/Project
parent6fa9d0ab4047c904a321772fe2184118b58d1a4f (diff)
downloadCMake-9275554496b32662d840cbe1e0b9c2a460835ac6.zip
CMake-9275554496b32662d840cbe1e0b9c2a460835ac6.tar.gz
CMake-9275554496b32662d840cbe1e0b9c2a460835ac6.tar.bz2
Ninja: Update BuildDepends test to verify cmcldeps depfiles.
Diffstat (limited to 'Tests/BuildDepends/Project')
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt16
-rw-r--r--Tests/BuildDepends/Project/ninjadep.cpp6
2 files changed, 22 insertions, 0 deletions
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index f8a3d15..b4c6a07 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -123,3 +123,19 @@ add_custom_target(link_depends_no_shared_check ALL
-P ${CMAKE_CURRENT_SOURCE_DIR}/link_depends_no_shared_check.cmake
)
add_dependencies(link_depends_no_shared_check link_depends_no_shared_exe)
+
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dir/header.h
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dir/header.txt
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/dir/header.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/dir/header.h
+ )
+
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dir/header.h
+ PROPERTIES GENERATED 1)
+
+add_custom_target(header_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dir/header.h)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+add_executable(ninjadep ninjadep.cpp)
+add_dependencies(ninjadep header_tgt)
diff --git a/Tests/BuildDepends/Project/ninjadep.cpp b/Tests/BuildDepends/Project/ninjadep.cpp
new file mode 100644
index 0000000..8d61336
--- /dev/null
+++ b/Tests/BuildDepends/Project/ninjadep.cpp
@@ -0,0 +1,6 @@
+#include <stdio.h>
+#include "dir/header.h"
+
+int main() {
+ printf("HEADER_STRING: %s\n", HEADER_STRING);
+}