summaryrefslogtreecommitdiff
path: root/Tests/SimpleInstallS2
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-21 16:55:03 -0400
committerBrad King <brad.king@kitware.com>2006-08-21 16:55:03 -0400
commitbed79f6c6b47b2c0661da67799ec37fce8905c54 (patch)
treebdf2a3211652d8587c710d14dbb0f323fb40e617 /Tests/SimpleInstallS2
parentf1ea7e88dc8322d4344e6b7acde6bf7bcffd7806 (diff)
downloadcmake-bed79f6c6b47b2c0661da67799ec37fce8905c54.tar.gz
ENH: Implemented INSTALL(DIRECTORY) command and added a test. Re-organized cmFileCommand's implementation of FILE(INSTALL) a bit to help out. This addresses bug#1694 and partially addresses bug#2691.
Diffstat (limited to 'Tests/SimpleInstallS2')
-rw-r--r--Tests/SimpleInstallS2/CMakeLists.txt23
-rw-r--r--Tests/SimpleInstallS2/scripts/.gitattributes1
-rwxr-xr-xTests/SimpleInstallS2/scripts/sample_script2
-rwxr-xr-xTests/SimpleInstallS2/scripts/sample_script.bat1
4 files changed, 27 insertions, 0 deletions
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index 4df7f77cdd..f543d43a01 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
diff --git a/Tests/SimpleInstallS2/scripts/.gitattributes b/Tests/SimpleInstallS2/scripts/.gitattributes
new file mode 100644
index 0000000000..5e3db2fb3a
--- /dev/null
+++ b/Tests/SimpleInstallS2/scripts/.gitattributes
@@ -0,0 +1 @@
+sample_script crlf=input
diff --git a/Tests/SimpleInstallS2/scripts/sample_script b/Tests/SimpleInstallS2/scripts/sample_script
new file mode 100755
index 0000000000..81f9f53153
--- /dev/null
+++ b/Tests/SimpleInstallS2/scripts/sample_script
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo "Sample Script Output"
diff --git a/Tests/SimpleInstallS2/scripts/sample_script.bat b/Tests/SimpleInstallS2/scripts/sample_script.bat
new file mode 100755
index 0000000000..64a77b5b0f
--- /dev/null
+++ b/Tests/SimpleInstallS2/scripts/sample_script.bat
@@ -0,0 +1 @@
+@echo Sample Script Output