diff options
Diffstat (limited to 'Tests/SimpleInstall')
-rw-r--r-- | Tests/SimpleInstall/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/SimpleInstall/PostInstall.cmake | 6 | ||||
-rw-r--r-- | Tests/SimpleInstall/PreInstall.cmake | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index ed46a0f..46689df 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/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/SimpleInstall/PostInstall.cmake b/Tests/SimpleInstall/PostInstall.cmake new file mode 100644 index 0000000..52ea140 --- /dev/null +++ b/Tests/SimpleInstall/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/SimpleInstall/PreInstall.cmake b/Tests/SimpleInstall/PreInstall.cmake new file mode 100644 index 0000000..2ea2f77 --- /dev/null +++ b/Tests/SimpleInstall/PreInstall.cmake @@ -0,0 +1,2 @@ +MESSAGE("This is in pre install") +SET(PRE_INSTALL_DID_RUN 1) |