Tests: Teach SimpleInstall to use "cmake --build"
Switch from "ctest --build-and-test" to "cmake --build" to drive the install and package targets in the SimpleInstall test.
This commit is contained in:
parent
f2b1d653cf
commit
c85672634c
|
@ -308,7 +308,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CONFIGURATION_TYPES)
|
if(CMAKE_CONFIGURATION_TYPES)
|
||||||
set(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
|
set(SI_CONFIG --config $<CONFIGURATION>)
|
||||||
else()
|
else()
|
||||||
set(SI_CONFIG)
|
set(SI_CONFIG)
|
||||||
endif()
|
endif()
|
||||||
|
@ -367,7 +367,9 @@ set(CMAKE_INSTALL_DEBUG_LIBRARIES 1)
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
if(CTEST_TEST_CPACK)
|
if(CTEST_TEST_CPACK)
|
||||||
set(PACKAGE_TARGET --build-target package)
|
set(package_command COMMAND
|
||||||
|
${CMAKE_COMMAND} --build . --target package ${SI_CONFIG}
|
||||||
|
)
|
||||||
|
|
||||||
# Avoid settings that require the .zip file command line tools...
|
# Avoid settings that require the .zip file command line tools...
|
||||||
# (just build an NSIS installer without component support)
|
# (just build an NSIS installer without component support)
|
||||||
|
@ -375,24 +377,19 @@ if(CTEST_TEST_CPACK)
|
||||||
set(CPACK_BINARY_ZIP OFF)
|
set(CPACK_BINARY_ZIP OFF)
|
||||||
set(CPACK_MONOLITHIC_INSTALL ON)
|
set(CPACK_MONOLITHIC_INSTALL ON)
|
||||||
else()
|
else()
|
||||||
set(PACKAGE_TARGET)
|
set(package_command)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
||||||
|
set(install_command COMMAND
|
||||||
|
${CMAKE_COMMAND} --build . --target install ${SI_CONFIG}
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${install_target}
|
TARGET ${install_target}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_CTEST_COMMAND}
|
${install_command}
|
||||||
ARGS ${SI_CONFIG}
|
${package_command}
|
||||||
--build-and-test
|
|
||||||
${CMAKE_SOURCE_DIR}
|
|
||||||
${CMAKE_BINARY_DIR}
|
|
||||||
--build-generator ${CMAKE_GENERATOR}
|
|
||||||
--build-project ${PROJECT_NAME}
|
|
||||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
|
||||||
--build-noclean
|
|
||||||
--build-target install
|
|
||||||
${PACKAGE_TARGET}
|
|
||||||
COMMENT "Install Project"
|
COMMENT "Install Project"
|
||||||
)
|
)
|
||||||
|
|
|
@ -308,7 +308,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CONFIGURATION_TYPES)
|
if(CMAKE_CONFIGURATION_TYPES)
|
||||||
set(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
|
set(SI_CONFIG --config $<CONFIGURATION>)
|
||||||
else()
|
else()
|
||||||
set(SI_CONFIG)
|
set(SI_CONFIG)
|
||||||
endif()
|
endif()
|
||||||
|
@ -367,7 +367,9 @@ set(CMAKE_INSTALL_DEBUG_LIBRARIES 1)
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
if(CTEST_TEST_CPACK)
|
if(CTEST_TEST_CPACK)
|
||||||
set(PACKAGE_TARGET --build-target package)
|
set(package_command COMMAND
|
||||||
|
${CMAKE_COMMAND} --build . --target package ${SI_CONFIG}
|
||||||
|
)
|
||||||
|
|
||||||
# Avoid settings that require the .zip file command line tools...
|
# Avoid settings that require the .zip file command line tools...
|
||||||
# (just build an NSIS installer without component support)
|
# (just build an NSIS installer without component support)
|
||||||
|
@ -375,24 +377,19 @@ if(CTEST_TEST_CPACK)
|
||||||
set(CPACK_BINARY_ZIP OFF)
|
set(CPACK_BINARY_ZIP OFF)
|
||||||
set(CPACK_MONOLITHIC_INSTALL ON)
|
set(CPACK_MONOLITHIC_INSTALL ON)
|
||||||
else()
|
else()
|
||||||
set(PACKAGE_TARGET)
|
set(package_command)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
||||||
|
set(install_command COMMAND
|
||||||
|
${CMAKE_COMMAND} --build . --target install ${SI_CONFIG}
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${install_target}
|
TARGET ${install_target}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_CTEST_COMMAND}
|
${install_command}
|
||||||
ARGS ${SI_CONFIG}
|
${package_command}
|
||||||
--build-and-test
|
|
||||||
${CMAKE_SOURCE_DIR}
|
|
||||||
${CMAKE_BINARY_DIR}
|
|
||||||
--build-generator ${CMAKE_GENERATOR}
|
|
||||||
--build-project ${PROJECT_NAME}
|
|
||||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
|
||||||
--build-noclean
|
|
||||||
--build-target install
|
|
||||||
${PACKAGE_TARGET}
|
|
||||||
COMMENT "Install Project"
|
COMMENT "Install Project"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue