summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/RunCMake.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-06 21:53:52 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-06 21:58:35 (GMT)
commitc869984ea013f99c3104abaf17d553b08c4b17c2 (patch)
treee8fa541a6f888b432fbc1212bc9b05b183c583ee /Tests/RunCMake/RunCMake.cmake
parent5376151aa1d724b6d7ddef8d2e521d97cbfa74ae (diff)
downloadCMake-c869984ea013f99c3104abaf17d553b08c4b17c2.zip
CMake-c869984ea013f99c3104abaf17d553b08c4b17c2.tar.gz
CMake-c869984ea013f99c3104abaf17d553b08c4b17c2.tar.bz2
RunCMake: Allow specifying the source dir and file to test.
This will allow decoupling the name of the test from the name and location of the source file under test, which means one source file can be used for multiple tests. Rename the PARENT_SCOPE test in RunCMake.set to not use a keyword of the if() command as a file name. As the filename is now used with an if condition, this causes a conflict.
Diffstat (limited to 'Tests/RunCMake/RunCMake.cmake')
-rw-r--r--Tests/RunCMake/RunCMake.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index ed3afc5..4ed2f43 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -25,7 +25,9 @@ function(run_cmake test)
unset(expect_std${o})
endif()
endforeach()
- set(RunCMake_TEST_SOURCE_DIR "${top_src}")
+ if (NOT RunCMake_TEST_SOURCE_DIR)
+ set(RunCMake_TEST_SOURCE_DIR "${top_src}")
+ endif()
if(NOT RunCMake_TEST_BINARY_DIR)
set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build")
endif()
@@ -36,6 +38,9 @@ function(run_cmake test)
if(NOT DEFINED RunCMake_TEST_OPTIONS)
set(RunCMake_TEST_OPTIONS "")
endif()
+ if (NOT RunCMake_TEST_FILE)
+ set(RunCMake_TEST_FILE "${test}")
+ endif()
if(APPLE)
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW)
endif()
@@ -52,7 +57,7 @@ function(run_cmake test)
COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}"
-G "${RunCMake_GENERATOR}"
-T "${RunCMake_GENERATOR_TOOLSET}"
- -DRunCMake_TEST=${test}
+ -DRunCMake_TEST=${RunCMake_TEST_FILE}
--no-warn-unused-cli
${RunCMake_TEST_OPTIONS}
WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"