diff options
Diffstat (limited to 'Tests/SimpleInstallS2/CMakeLists.txt')
-rw-r--r-- | Tests/SimpleInstallS2/CMakeLists.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index 4df7f77..f543d43 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -80,6 +80,22 @@ IF(STAGE2) MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!") ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + # Check for failure of directory installation. + IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + MESSAGE(FATAL_ERROR "Directory installation did not install TSD.h") + ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + EXECUTE_PROCESS( + COMMAND "${CMAKE_INSTALL_PREFIX}/MyTest/share/sample_script" + RESULT_VARIABLE SAMPLE_SCRIPT_RESULT + OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT + ) + IF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + MESSAGE(FATAL_ERROR "Sample script failed: [${SAMPLE_SCRIPT_RESULT}]") + ENDIF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + IF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + MESSAGE(FATAL_ERROR "Bad sample script output: [${SAMPLE_SCRIPT_OUTPUT}]") + ENDIF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + # Make sure the test executable can run from the install tree. SET_TARGET_PROPERTIES(SimpleInstallS2 PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) @@ -138,6 +154,13 @@ ELSE(STAGE2) DESTINATION MyTest/include/Debug ) + # Test directory installation. + INSTALL( + DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share + PATTERN "CVS" EXCLUDE + PATTERN "scripts/*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + ) + # Test user-specified install scripts. INSTALL( SCRIPT InstallScript1.cmake |