Commit ec59dd1e authored by Ben Boeckel's avatar Ben Boeckel

Testing/Install: cleanup and include in the new build

parent fa302709
# Test "make install"
if("x${CMAKE_INSTALL_PREFIX}" MATCHES "^x${VTK_BINARY_DIR}/InstallTest$")
add_test(NAME Install
COMMAND ${CMAKE_COMMAND} -DCONFIGURATION=$<CONFIGURATION>
-DVTK_BINARY_DIR=${VTK_BINARY_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/InstallTest.cmake
)
endif()
if (CMAKE_INSTALL_PREFIX STREQUAL "${VTK_BINARY_DIR}/InstallTest")
add_test(
NAME Install
COMMAND "${CMAKE_COMMAND}"
-DCONFIGURATION=$<CONFIGURATION>
"-DVTK_BINARY_DIR=${VTK_BINARY_DIR}"
-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")
endif()
if(NOT DEFINED CONFIGURATION)
endif ()
if (NOT DEFINED CONFIGURATION)
message(FATAL_ERROR "Invoke with -DCONFIGURATION=<config>")
endif()
endif ()
message(STATUS "Removing InstallTest directory...")
file(REMOVE_RECURSE "${VTK_BINARY_DIR}/InstallTest")
message(STATUS "Building 'install' target...")
execute_process(
COMMAND ${CMAKE_COMMAND} --build "${VTK_BINARY_DIR}"
COMMAND "${CMAKE_COMMAND}"
--build "${VTK_BINARY_DIR}"
--target install
--config "${CONFIGURATION}"
RESULT_VARIABLE failed
)
if(failed)
RESULT_VARIABLE failed)
if (failed)
message(FATAL_ERROR "Installation failed: ${failed}")
else()
file(WRITE "${VTK_BINARY_DIR}/InstallTest/InstallSucceeded.txt" "# Installation succeeded!\n")
endif()
else ()
file(WRITE "${VTK_BINARY_DIR}/InstallTest/InstallSucceeded.txt"
"# 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