diff options
author | Brad King <brad.king@kitware.com> | 2006-04-12 22:04:50 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-04-12 22:04:50 -0400 |
commit | d4c5fe840beb029cb60572cabd643feb4e239830 (patch) | |
tree | 3bc37efec89d6bf17f6c5cd1efef91d236744031 /Tests | |
parent | 58641b2ceb5d3401e1cb0e4bb897a9fe2329e525 (diff) | |
download | cmake-d4c5fe840beb029cb60572cabd643feb4e239830.tar.gz |
ENH: Added INSTALL(CODE) mode to allow inline specification of install script code. This reduces the need for configuring an install script that needs some variable settings because the install code can set thing up first.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/SimpleInstall/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/SimpleInstall/InstallScript1.cmake | 3 | ||||
-rw-r--r-- | Tests/SimpleInstall/InstallScript2.cmake | 5 | ||||
-rw-r--r-- | Tests/SimpleInstallS2/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/SimpleInstallS2/InstallScript1.cmake | 3 | ||||
-rw-r--r-- | Tests/SimpleInstallS2/InstallScript2.cmake | 5 |
6 files changed, 18 insertions, 0 deletions
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index 0ba9fe4f61..ac8f12e321 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -122,6 +122,7 @@ ELSE(STAGE2) # Test user-specified install scripts. INSTALL( SCRIPT InstallScript1.cmake + CODE "SET(INSTALL_CODE_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake ) SET_DIRECTORY_PROPERTIES(PROPERTIES diff --git a/Tests/SimpleInstall/InstallScript1.cmake b/Tests/SimpleInstall/InstallScript1.cmake index 7ce8551bd8..27b7725f8c 100644 --- a/Tests/SimpleInstall/InstallScript1.cmake +++ b/Tests/SimpleInstall/InstallScript1.cmake @@ -1,2 +1,5 @@ MESSAGE("This is install script 1.") SET(INSTALL_SCRIPT_1_DID_RUN 1) +IF(INSTALL_CODE_DID_RUN) + MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.") +ENDIF(INSTALL_CODE_DID_RUN) diff --git a/Tests/SimpleInstall/InstallScript2.cmake b/Tests/SimpleInstall/InstallScript2.cmake index acc4f73320..927cae8b61 100644 --- a/Tests/SimpleInstall/InstallScript2.cmake +++ b/Tests/SimpleInstall/InstallScript2.cmake @@ -4,6 +4,11 @@ IF(INSTALL_SCRIPT_1_DID_RUN) ELSE(INSTALL_SCRIPT_1_DID_RUN) MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.") ENDIF(INSTALL_SCRIPT_1_DID_RUN) +IF(INSTALL_CODE_DID_RUN) + MESSAGE("Install code ordering works.") +ELSE(INSTALL_CODE_DID_RUN) + MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.") +ENDIF(INSTALL_CODE_DID_RUN) FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index 0ba9fe4f61..ac8f12e321 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -122,6 +122,7 @@ ELSE(STAGE2) # Test user-specified install scripts. INSTALL( SCRIPT InstallScript1.cmake + CODE "SET(INSTALL_CODE_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake ) SET_DIRECTORY_PROPERTIES(PROPERTIES diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake index 7ce8551bd8..27b7725f8c 100644 --- a/Tests/SimpleInstallS2/InstallScript1.cmake +++ b/Tests/SimpleInstallS2/InstallScript1.cmake @@ -1,2 +1,5 @@ MESSAGE("This is install script 1.") SET(INSTALL_SCRIPT_1_DID_RUN 1) +IF(INSTALL_CODE_DID_RUN) + MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.") +ENDIF(INSTALL_CODE_DID_RUN) diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake index acc4f73320..927cae8b61 100644 --- a/Tests/SimpleInstallS2/InstallScript2.cmake +++ b/Tests/SimpleInstallS2/InstallScript2.cmake @@ -4,6 +4,11 @@ IF(INSTALL_SCRIPT_1_DID_RUN) ELSE(INSTALL_SCRIPT_1_DID_RUN) MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.") ENDIF(INSTALL_SCRIPT_1_DID_RUN) +IF(INSTALL_CODE_DID_RUN) + MESSAGE("Install code ordering works.") +ELSE(INSTALL_CODE_DID_RUN) + MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.") +ENDIF(INSTALL_CODE_DID_RUN) FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) |