summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-27 13:00:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-04-27 13:00:15 (GMT)
commitf38147aebc19cdca17df101a9ca6a10337508485 (patch)
treeb10ce1abc2aed76a08ba262c0f3b917ccbdd6cea /Tests
parent7c31ac668986ca4753f091258321e7928b3e904a (diff)
parent434f5cef657a001bcfbaa5e8b5c4fba80215efb5 (diff)
downloadCMake-f38147aebc19cdca17df101a9ca6a10337508485.zip
CMake-f38147aebc19cdca17df101a9ca6a10337508485.tar.gz
CMake-f38147aebc19cdca17df101a9ca6a10337508485.tar.bz2
Merge topic 'test-makefile-custom-target-includes'
434f5cef Tests: Add case for IMPLICIT_DEPENDS in custom target 6d1be6e3 Tests: Split RunCMake.BuildDepends make-only condition Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !766
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake13
-rw-r--r--Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx6
-rw-r--r--Tests/RunCMake/BuildDepends/MakeCustomIncludes.step1.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/MakeCustomIncludes.step2.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake8
5 files changed, 30 insertions, 3 deletions
diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake
new file mode 100644
index 0000000..0f92e0e
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake
@@ -0,0 +1,13 @@
+add_custom_command(
+ OUTPUT output.cxx
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx output.cxx
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx
+ IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx)
+add_custom_target(generate ALL DEPENDS output.cxx)
+set_property(TARGET generate PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
+
+file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+set(check_pairs
+ \"${CMAKE_CURRENT_BINARY_DIR}/output.cxx|${CMAKE_CURRENT_BINARY_DIR}/MakeCustomIncludes.h\"
+ )
+")
diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx
new file mode 100644
index 0000000..9a0edef
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx
@@ -0,0 +1,6 @@
+#include "MakeCustomIncludes.h"
+
+int main()
+{
+ return MakeCustomIncludes();
+}
diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step1.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step1.cmake
new file mode 100644
index 0000000..6bb01a6
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step1.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/MakeCustomIncludes.h" [[
+inline int MakeCustomIncludes() { return 1; }
+]])
diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step2.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step2.cmake
new file mode 100644
index 0000000..6b3151d
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.step2.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/MakeCustomIncludes.h" [[
+inline int MakeCustomIncludes() { return 2; }
+]])
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 67a6101..9941c70 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -43,9 +43,11 @@ endif()
run_BuildDepends(Custom-Symbolic-and-Byproduct)
run_BuildDepends(Custom-Always)
-if(RunCMake_GENERATOR MATCHES "Make" AND
- NOT "${RunCMake_BINARY_DIR}" STREQUAL "${RunCMake_SOURCE_DIR}")
- run_BuildDepends(MakeInProjectOnly)
+if(RunCMake_GENERATOR MATCHES "Make")
+ run_BuildDepends(MakeCustomIncludes)
+ if(NOT "${RunCMake_BINARY_DIR}" STREQUAL "${RunCMake_SOURCE_DIR}")
+ run_BuildDepends(MakeInProjectOnly)
+ endif()
endif()
function(run_ReGeneration)