summaryrefslogtreecommitdiff
path: root/Tests/SimpleInstallS2
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/SimpleInstallS2')
-rw-r--r--Tests/SimpleInstallS2/CMakeLists.txt78
-rw-r--r--Tests/SimpleInstallS2/InstallScript1.cmake2
-rw-r--r--Tests/SimpleInstallS2/InstallScript2.cmake8
-rw-r--r--Tests/SimpleInstallS2/InstallScript3.cmake6
-rw-r--r--Tests/SimpleInstallS2/InstallScript4.cmake12
-rw-r--r--Tests/SimpleInstallS2/PackageScript.cmake2
-rw-r--r--Tests/SimpleInstallS2/PostInstall.cmake4
7 files changed, 56 insertions, 56 deletions
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index f05587eb21..479d6ec367 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -40,13 +40,13 @@ if(STAGE2)
include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL)
if(CMAKE_INSTALL_SCRIPT_DID_RUN)
message(STATUS "Stage 1 did run install script 2.")
- else(CMAKE_INSTALL_SCRIPT_DID_RUN)
+ else()
message(SEND_ERROR "Stage 1 did not run install script 2.")
- endif(CMAKE_INSTALL_SCRIPT_DID_RUN)
+ endif()
if(CYGWIN OR MINGW)
set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin")
- endif(CYGWIN OR MINGW)
+ endif()
message("Search for library in: ${LIBPATHS}")
set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
@@ -77,44 +77,44 @@ if(STAGE2)
if("${TEST1_LIBRARY}" MATCHES "static")
message(STATUS "test1 correctly found in lib/static")
- else("${TEST1_LIBRARY}" MATCHES "static")
+ else()
message(SEND_ERROR "test1 not found in lib/static!")
- endif("${TEST1_LIBRARY}" MATCHES "static")
+ endif()
# Check for failure of configuration-specific installation.
if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
message(FATAL_ERROR "Debug-configuration file installed for Release!")
- endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
+ endif()
if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
message(FATAL_ERROR "Release-configuration file installed for Debug!")
- endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
+ endif()
# 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")
+ endif()
if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
message(FATAL_ERROR "Directory installation installed CVS directory.")
- endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+ endif()
if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
message(FATAL_ERROR "Directory installation installed CVS directory.")
- endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+ endif()
if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
message(FATAL_ERROR "Directory installation installed CMakeLists.txt.")
- endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
+ endif()
if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
message(FATAL_ERROR "Directory installation did not install alternate TSD.h")
- endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
+ endif()
if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
message(FATAL_ERROR "Directory installation installed alternate TSD.cxx")
- endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
+ endif()
# Check that scripts properly installed.
if(WIN32 AND NOT CYGWIN)
set(BAT .bat)
- else(WIN32 AND NOT CYGWIN)
+ else()
set(BAT)
- endif(WIN32 AND NOT CYGWIN)
+ endif()
foreach(loc share share/old1 share/old2 share/old3 share/alt)
set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}")
execute_process(
@@ -125,21 +125,21 @@ if(STAGE2)
if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
message(FATAL_ERROR
"Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]")
- endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
+ endif()
if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
message(FATAL_ERROR
"Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]")
- endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
- endforeach(loc)
+ endif()
+ endforeach()
# Check for failure of empty directory installation.
if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
message(FATAL_ERROR "Empty directory installation did not install.")
- endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
+ endif()
file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*")
if(EMPTY_FILES)
message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].")
- endif(EMPTY_FILES)
+ endif()
# Make sure the test executable can run from the install tree.
set_target_properties(SimpleInstExeS2 PROPERTIES
@@ -153,9 +153,9 @@ if(STAGE2)
get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED)
if(NOT simpleInstallImported)
message(FATAL_ERROR "Target S1_SimpleInstall could not be imported")
- endif(NOT simpleInstallImported)
+ endif()
-else(STAGE2)
+else()
# Wipe out the install directory to do a fresh test.
file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest)
@@ -177,7 +177,7 @@ else(STAGE2)
# Disable VERSION test until it is implemented in the Xcode generator.
if(NOT XCODE)
set_target_properties(SimpleInstall PROPERTIES VERSION 1.2)
- endif(NOT XCODE)
+ endif()
# Make sure the test executable can run from the install tree.
set_target_properties(SimpleInstall PROPERTIES
@@ -190,7 +190,7 @@ else(STAGE2)
if(CMAKE_GENERATOR MATCHES "Makefiles")
add_subdirectory(TestSubDir)
add_dependencies(SimpleInstall TSD)
- endif(CMAKE_GENERATOR MATCHES "Makefiles")
+ endif()
add_dependencies(SimpleInstall test3)
add_dependencies(test2 test3)
@@ -305,13 +305,13 @@ else(STAGE2)
${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3
INSTALL_NAME_DIR @executable_path/../lib)
-endif(STAGE2)
+endif()
if(CMAKE_CONFIGURATION_TYPES)
set(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
-else(CMAKE_CONFIGURATION_TYPES)
+else()
set(SI_CONFIG)
-endif(CMAKE_CONFIGURATION_TYPES)
+endif()
# Dummy test of CPack
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack")
@@ -325,8 +325,8 @@ if(WIN32 AND NOT UNIX)
)
if(NOT NSIS_MAKENSIS)
set(CPACK_GENERATOR TGZ)
- endif(NOT NSIS_MAKENSIS)
-endif(WIN32 AND NOT UNIX)
+ endif()
+endif()
if(UNIX AND NOT APPLE)
set(CPACK_GENERATOR "TGZ;STGZ;TZ")
# find_program(found_compress
@@ -335,31 +335,31 @@ if(UNIX AND NOT APPLE)
# find_program(file_command NAMES file)
# if(NOT file_command)
# set(file_command file)
- # endif(NOT file_command)
+ # endif()
# execute_process(COMMAND ${file_command} ${found_compress}
# OUTPUT_VARIABLE output)
# set(SKIP_TZ FALSE)
# if("${output}" MATCHES "script")
# set(SKIP_TZ TRUE)
- # endif("${output}" MATCHES "script")
+ # endif()
# if("${output}" MATCHES "dummy.sh")
# set(SKIP_TZ TRUE)
- # endif("${output}" MATCHES "dummy.sh")
+ # endif()
# if(NOT SKIP_TZ)
# message("compress found and it was not a script")
# message("output from file command: [${output}]")
# set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
- # else(NOT SKIP_TZ)
+ # else()
# message("compress found, but it was a script so dont use it")
# message("output from file command: [${output}]")
- # endif(NOT SKIP_TZ)
- # endif(found_compress)
+ # endif()
+ # endif()
find_program(found_bz2
NAMES bzip2)
if(found_bz2)
set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2")
- endif(found_bz2)
-endif(UNIX AND NOT APPLE)
+ endif()
+endif()
set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install")
set(CMAKE_INSTALL_MFC_LIBRARIES 1)
@@ -374,9 +374,9 @@ if(CTEST_TEST_CPACK)
#
set(CPACK_BINARY_ZIP OFF)
set(CPACK_MONOLITHIC_INSTALL ON)
-else(CTEST_TEST_CPACK)
+else()
set(PACKAGE_TARGET)
-endif(CTEST_TEST_CPACK)
+endif()
include(CPack)
diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake
index 85465bfed5..ef9da5761c 100644
--- a/Tests/SimpleInstallS2/InstallScript1.cmake
+++ b/Tests/SimpleInstallS2/InstallScript1.cmake
@@ -2,4 +2,4 @@ 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)
+endif()
diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake
index a675df7ea7..c1d20a3a67 100644
--- a/Tests/SimpleInstallS2/InstallScript2.cmake
+++ b/Tests/SimpleInstallS2/InstallScript2.cmake
@@ -1,14 +1,14 @@
message("This is install script 2.")
if(INSTALL_SCRIPT_1_DID_RUN)
message("Install script ordering works.")
-else(INSTALL_SCRIPT_1_DID_RUN)
+else()
message(FATAL_ERROR "Install script 1 did not run before install script 2.")
-endif(INSTALL_SCRIPT_1_DID_RUN)
+endif()
if(INSTALL_CODE_DID_RUN)
message("Install code ordering works.")
-else(INSTALL_CODE_DID_RUN)
+else()
message(FATAL_ERROR "Install script 2 did not run after install code.")
-endif(INSTALL_CODE_DID_RUN)
+endif()
file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake"
"set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n"
)
diff --git a/Tests/SimpleInstallS2/InstallScript3.cmake b/Tests/SimpleInstallS2/InstallScript3.cmake
index a955be146f..64851564d0 100644
--- a/Tests/SimpleInstallS2/InstallScript3.cmake
+++ b/Tests/SimpleInstallS2/InstallScript3.cmake
@@ -2,11 +2,11 @@ message("This is install script 3.")
set(INSTALL_SCRIPT_3_DID_RUN 1)
if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
message(FATAL_ERROR "Install script 3 did not run before install code with component.")
-endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+endif()
if(CMAKE_INSTALL_COMPONENT)
if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.")
-endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-endif(CMAKE_INSTALL_COMPONENT)
+endif()
+endif()
diff --git a/Tests/SimpleInstallS2/InstallScript4.cmake b/Tests/SimpleInstallS2/InstallScript4.cmake
index 0bbd9d2c8c..34d0a73bb8 100644
--- a/Tests/SimpleInstallS2/InstallScript4.cmake
+++ b/Tests/SimpleInstallS2/InstallScript4.cmake
@@ -1,21 +1,21 @@
message("This is install script 4.")
if(INSTALL_SCRIPT_3_DID_RUN)
message("Install script ordering works.")
-else(INSTALL_SCRIPT_3_DID_RUN)
+else()
message(FATAL_ERROR "Install script 3 did not run before install script 4.")
-endif(INSTALL_SCRIPT_3_DID_RUN)
+endif()
if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
message("Install code ordering works.")
-else(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+else()
message(FATAL_ERROR "Install script 4 did not run after install with component code.")
-endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+endif()
if(CMAKE_INSTALL_COMPONENT)
if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.")
-endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-endif(CMAKE_INSTALL_COMPONENT)
+endif()
+endif()
file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake"
"set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n"
diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake
index be07f89cc8..53b790932b 100644
--- a/Tests/SimpleInstallS2/PackageScript.cmake
+++ b/Tests/SimpleInstallS2/PackageScript.cmake
@@ -6,5 +6,5 @@ get_cmake_property(res VARIABLES)
foreach(var ${res})
file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
"${var} \"${${var}}\"\n")
-endforeach(var ${res})
+endforeach()
diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake
index 222cc5ae91..d616221ef3 100644
--- a/Tests/SimpleInstallS2/PostInstall.cmake
+++ b/Tests/SimpleInstallS2/PostInstall.cmake
@@ -1,6 +1,6 @@
message("In post install")
if(PRE_INSTALL_DID_RUN)
message("Pre and post install work fine")
-else(PRE_INSTALL_DID_RUN)
+else()
message(FATAL_ERROR "Pre install did not run before post install")
-endif(PRE_INSTALL_DID_RUN)
+endif()