summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_compile/RerunCMake.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-23 14:45:00 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-27 16:18:36 (GMT)
commitdaf95a38277f4c732987933a63143dde77dd0a10 (patch)
treeb7d2dae418d094044f18c26c7623eb4b62c8f92c /Tests/RunCMake/try_compile/RerunCMake.cmake
parentbf05938b8f186c397c918c1cf8bd9ce853c86123 (diff)
downloadCMake-daf95a38277f4c732987933a63143dde77dd0a10.zip
CMake-daf95a38277f4c732987933a63143dde77dd0a10.tar.gz
CMake-daf95a38277f4c732987933a63143dde77dd0a10.tar.bz2
try_compile: Test that CMake re-runs on input change
With the Makefile and Ninja generators we expect that touching the input source file for a try_compile will cause CMake to re-run on the next build. Extend the RunCMake.try_compile test with a case covering this. Also check that CMake does not re-run if nothing has changed.
Diffstat (limited to 'Tests/RunCMake/try_compile/RerunCMake.cmake')
-rw-r--r--Tests/RunCMake/try_compile/RerunCMake.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/RerunCMake.cmake b/Tests/RunCMake/try_compile/RerunCMake.cmake
new file mode 100644
index 0000000..5a9f1d4
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake.cmake
@@ -0,0 +1,7 @@
+message("Running CMake on RerunCMake") # write to stderr if cmake reruns
+enable_language(C)
+try_compile(res
+ "${CMAKE_CURRENT_BINARY_DIR}"
+ SOURCES "${CMAKE_CURRENT_BINARY_DIR}/TryCompileInput.c"
+ )
+message("${res}")