summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorPetr Kmoch <petr.kmoch@gmail.com>2013-03-28 14:10:13 (GMT)
committerBrad King <brad.king@kitware.com>2013-04-12 15:35:36 (GMT)
commitac9a5f4d943685f0b49b1a9d03f4e23238df0867 (patch)
tree7027ff81ffd0e05a7c8c119499dbfc70417ad103 /Tests/CMakeLists.txt
parenta6c0299c407bc4482140637c0460f71238b4f9d0 (diff)
downloadCMake-ac9a5f4d943685f0b49b1a9d03f4e23238df0867.zip
CMake-ac9a5f4d943685f0b49b1a9d03f4e23238df0867.tar.gz
CMake-ac9a5f4d943685f0b49b1a9d03f4e23238df0867.tar.bz2
ctest_build: Pass projectDir to GenerateBuildCommand
This allows the ctest_build command's TARGET option to name a target in a subdirectory and still build properly with msbuild. Add test case covering use of ctest_build() with such a TARGET.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 4eb2f90..ad81fd6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1660,6 +1660,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake"
# )
+ # A test for ctest_build() with targets in subdirectories
+ if(CMAKE_TEST_GENERATOR_TOOLSET)
+ set(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION "-T;${CMAKE_TEST_GENERATOR_TOOLSET};")
+ else()
+ set(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION)
+ endif()
+ configure_file("${CMake_SOURCE_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake" @ONLY)
+ unset(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION)
+ add_test(CTest.BuildCommand.ProjectInSubdir
+ ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake"
+ -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM})
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/Nested")
+
set(CTEST_TEST_UPDATE 1)
if(CTEST_TEST_UPDATE)
# Test CTest Update with Subversion