From 5eb4372001b63c7fba90c939d73b0ffdaf427a48 Mon Sep 17 00:00:00 2001 From: Zach Mullen Date: Wed, 28 Oct 2009 14:11:19 -0400 Subject: Changed RunScript test to be in-source build safe --- Tests/CMakeLists.txt | 4 ++-- Tests/CTestTestRunScript/hello.cmake.in | 6 ++++++ Tests/CTestTestRunScript/test.cmake.in | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 Tests/CTestTestRunScript/hello.cmake.in create mode 100644 Tests/CTestTestRunScript/test.cmake.in diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c9a6372..aad4ca5 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1218,11 +1218,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel PASS_REGULAR_EXPRESSION "\\*\\*\\*Timeout") CONFIGURE_FILE( - "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake" + "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" @ONLY ESCAPE_QUOTES) CONFIGURE_FILE( - "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/hello.cmake" + "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/hello.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/hello.cmake" @ONLY ESCAPE_QUOTES) #ADD_TEST(CTestTestRunScript ${CMAKE_CTEST_COMMAND} diff --git a/Tests/CTestTestRunScript/hello.cmake.in b/Tests/CTestTestRunScript/hello.cmake.in new file mode 100644 index 0000000..e2c652c --- /dev/null +++ b/Tests/CTestTestRunScript/hello.cmake.in @@ -0,0 +1,6 @@ +GET_FILENAME_COMPONENT(CTEST_COMMAND "${CMAKE_COMMAND}" PATH) +SET(CTEST_COMMAND "${CTEST_COMMAND}/ctest") +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestRunScript") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestRunScript") + +message("hello world") diff --git a/Tests/CTestTestRunScript/test.cmake.in b/Tests/CTestTestRunScript/test.cmake.in new file mode 100644 index 0000000..4afcdd9 --- /dev/null +++ b/Tests/CTestTestRunScript/test.cmake.in @@ -0,0 +1,7 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +GET_FILENAME_COMPONENT(CTEST_COMMAND "${CMAKE_COMMAND}" PATH) +SET(CTEST_COMMAND "${CTEST_COMMAND}/ctest") +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestRunScript") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestRunScript") + +CTEST_RUN_SCRIPT("${CTEST_BINARY_DIRECTORY}/hello.cmake") -- cgit v0.12