summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeInstall.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-14 19:16:06 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-18 13:26:22 (GMT)
commitf2b1d653cf4124e32c324f54848d55f52ca8370d (patch)
tree63581c0ee553ff5d141c4a62f916437623886c63 /Tests/CMakeInstall.cmake
parent8ee6b4763034439ce5aada285de5fa584144c6c6 (diff)
downloadCMake-f2b1d653cf4124e32c324f54848d55f52ca8370d.zip
CMake-f2b1d653cf4124e32c324f54848d55f52ca8370d.tar.gz
CMake-f2b1d653cf4124e32c324f54848d55f52ca8370d.tar.bz2
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.
Diffstat (limited to 'Tests/CMakeInstall.cmake')
-rw-r--r--Tests/CMakeInstall.cmake22
1 files changed, 4 insertions, 18 deletions
diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake
index 5f814d9..fda8c54 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 $<CONFIGURATION>)
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)