From f2b1d653cf4124e32c324f54848d55f52ca8370d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 14 Nov 2013 14:16:06 -0500 Subject: [PATCH] Tests: Launch CMake.Install test through 'cmake --build' Use "cmake --build" to drive the "install" target from the CMake build tree itself. This avoids using the heavier "ctest --build-and-test" just to run the native build tool to drive installation. --- Tests/CMakeInstall.cmake | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake index 5f814d91b..fda8c54b3 100644 --- a/Tests/CMakeInstall.cmake +++ b/Tests/CMakeInstall.cmake @@ -17,29 +17,15 @@ if(CMake_TEST_INSTALL) if(CMAKE_CONFIGURATION_TYPES) # There are multiple configurations. Make sure the tested # configuration is the one that is installed. - set(CMake_TEST_INSTALL_CONFIG -C "\${CTEST_CONFIGURATION_TYPE}") + set(CMake_TEST_INSTALL_CONFIG --config $) else() set(CMake_TEST_INSTALL_CONFIG) endif() - # The CTest of the CMake used to build this CMake. - if(CMAKE_CTEST_COMMAND) - set(CMake_TEST_INSTALL_CTest ${CMAKE_CTEST_COMMAND}) - else() - set(CMake_TEST_INSTALL_CTest ${CMake_BIN_DIR}/ctest) - endif() - # Add a test to install CMake through the build system install target. - add_test(CMake.Install - ${CMake_TEST_INSTALL_CTest} - ${CMake_TEST_INSTALL_CONFIG} - --build-and-test ${CMake_SOURCE_DIR} ${CMake_BINARY_DIR} - --build-generator ${CMAKE_GENERATOR} # Not CMAKE_TEST_GENERATOR - --build-project CMake - --build-makeprogram ${CMAKE_MAKE_PROGRAM} # Not CMAKE_TEST_MAKEPROGRAM - --build-nocmake - --build-noclean - --build-target install) + add_test(NAME CMake.Install + COMMAND cmake --build . --target install ${CMake_TEST_INSTALL_CONFIG} + ) # Avoid running this test simultaneously with other tests: set_tests_properties(CMake.Install PROPERTIES RUN_SERIAL ON)