summaryrefslogtreecommitdiff
path: root/Tests/SimpleInstallS2
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-03-27 20:59:44 -0500
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-03-27 20:59:44 -0500
commitdb68c543ff7ee0a59ec5fa463f59255193a9a479 (patch)
treee7311dabbedcdb504bf38a9b7fdb3a0ed8791ddc /Tests/SimpleInstallS2
parent451522381d510c02185ac8bfb75c3aa93b863fb4 (diff)
downloadcmake-db68c543ff7ee0a59ec5fa463f59255193a9a479.tar.gz
ENH: Add pre and post install script support
Diffstat (limited to 'Tests/SimpleInstallS2')
-rw-r--r--Tests/SimpleInstallS2/CMakeLists.txt4
-rw-r--r--Tests/SimpleInstallS2/PostInstall.cmake6
-rw-r--r--Tests/SimpleInstallS2/PreInstall.cmake2
3 files changed, 12 insertions, 0 deletions
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index ed46a0f645..46689df8e4 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -64,6 +64,10 @@ ELSE(STAGE2)
INSTALL_TARGETS(/bin SimpleInstall)
INSTALL_TARGETS(/lib test1 test2 test3)
INSTALL_TARGETS(/include lib1.h lib2.h lib3.h)
+ SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
+ ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
+ SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
+ ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
ENDIF(STAGE2)
ADD_CUSTOM_COMMAND(
diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake
new file mode 100644
index 0000000000..52ea140a51
--- /dev/null
+++ b/Tests/SimpleInstallS2/PostInstall.cmake
@@ -0,0 +1,6 @@
+MESSAGE("In post install")
+IF(PRE_INSTALL_DID_RUN)
+ MESSAGE("Pre and post install work fine")
+ELSE(PRE_INSTALL_DID_RUN)
+ MESSAGE(FATAL_ERROR "Pre install did not run before post install")
+ENDIF(PRE_INSTALL_DID_RUN)
diff --git a/Tests/SimpleInstallS2/PreInstall.cmake b/Tests/SimpleInstallS2/PreInstall.cmake
new file mode 100644
index 0000000000..2ea2f77168
--- /dev/null
+++ b/Tests/SimpleInstallS2/PreInstall.cmake
@@ -0,0 +1,2 @@
+MESSAGE("This is in pre install")
+SET(PRE_INSTALL_DID_RUN 1)