Commit ec59dd1e authored by Ben Boeckel's avatar Ben Boeckel

Testing/Install: cleanup and include in the new build

parent fa302709
# Test "make install" # Test "make install"
if("x${CMAKE_INSTALL_PREFIX}" MATCHES "^x${VTK_BINARY_DIR}/InstallTest$") if (CMAKE_INSTALL_PREFIX STREQUAL "${VTK_BINARY_DIR}/InstallTest")
add_test(NAME Install add_test(
COMMAND ${CMAKE_COMMAND} -DCONFIGURATION=$<CONFIGURATION> NAME Install
-DVTK_BINARY_DIR=${VTK_BINARY_DIR} COMMAND "${CMAKE_COMMAND}"
-P ${CMAKE_CURRENT_SOURCE_DIR}/InstallTest.cmake -DCONFIGURATION=$<CONFIGURATION>
) "-DVTK_BINARY_DIR=${VTK_BINARY_DIR}"
endif() -P "${CMAKE_CURRENT_SOURCE_DIR}/InstallTest.cmake")
endif ()
if(NOT DEFINED VTK_BINARY_DIR) if (NOT DEFINED VTK_BINARY_DIR)
message(FATAL_ERROR "Invoke with -DVTK_BINARY_DIR=/path/to/VTK/build") message(FATAL_ERROR "Invoke with -DVTK_BINARY_DIR=/path/to/VTK/build")
endif() endif ()
if(NOT DEFINED CONFIGURATION) if (NOT DEFINED CONFIGURATION)
message(FATAL_ERROR "Invoke with -DCONFIGURATION=<config>") message(FATAL_ERROR "Invoke with -DCONFIGURATION=<config>")
endif() endif ()
message(STATUS "Removing InstallTest directory...") message(STATUS "Removing InstallTest directory...")
file(REMOVE_RECURSE "${VTK_BINARY_DIR}/InstallTest") file(REMOVE_RECURSE "${VTK_BINARY_DIR}/InstallTest")
message(STATUS "Building 'install' target...") message(STATUS "Building 'install' target...")
execute_process( execute_process(
COMMAND ${CMAKE_COMMAND} --build "${VTK_BINARY_DIR}" COMMAND "${CMAKE_COMMAND}"
--target install --build "${VTK_BINARY_DIR}"
--config "${CONFIGURATION}" --target install
RESULT_VARIABLE failed --config "${CONFIGURATION}"
) RESULT_VARIABLE failed)
if(failed)
if (failed)
message(FATAL_ERROR "Installation failed: ${failed}") message(FATAL_ERROR "Installation failed: ${failed}")
else() else ()
file(WRITE "${VTK_BINARY_DIR}/InstallTest/InstallSucceeded.txt" "# Installation succeeded!\n") file(WRITE "${VTK_BINARY_DIR}/InstallTest/InstallSucceeded.txt"
endif() "# Installation succeeded!\n")
endif ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment