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.
This commit is contained in:
Petr Kmoch
2013-03-28 10:10:13 -04:00
committed by Brad King
parent a6c0299c40
commit ac9a5f4d94
3 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 2.8.10)
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/VSProjectInSubdir")
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestBuildCommandProjectInSubdir/Nested")
set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
set(CTEST_PROJECT_NAME "VSProjectInSubdir")
set(CTEST_BUILD_CONFIGURATION "@CTestTest_CONFIG@")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
ctest_start(Experimental)
ctest_configure(OPTIONS "@CMAKE_TEST_GENERATOR_TOOLSET_SELECTION@-DCMAKE_MAKE_PROGRAM:FILEPATH=@CMAKE_TEST_MAKEPROGRAM@")
ctest_build(TARGET test)