summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-02-10 15:43:23 (GMT)
committerBrad King <brad.king@kitware.com>2010-02-10 15:43:23 (GMT)
commitff101a565ec3d353970ca9c02ef2c1b2a8dd77af (patch)
tree65075a9cdf4ab908381c5cf108420a3ee4cace70 /Modules
parentb0c6ca6cc0a0d6eb72727f8177091fa3f0032469 (diff)
downloadCMake-ff101a565ec3d353970ca9c02ef2c1b2a8dd77af.zip
CMake-ff101a565ec3d353970ca9c02ef2c1b2a8dd77af.tar.gz
CMake-ff101a565ec3d353970ca9c02ef2c1b2a8dd77af.tar.bz2
Simplify CTest.cmake module with ELSEIF
We use ELSEIF to simplify the cascading IF blocks for detecting version control tools.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CTest.cmake46
1 files changed, 17 insertions, 29 deletions
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 28835ce..66c64fb 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -130,19 +130,13 @@ IF(BUILD_TESTING)
IF(NOT UPDATE_TYPE)
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
SET(UPDATE_TYPE cvs)
- ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
- IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
- SET(UPDATE_TYPE svn)
- ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
- IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
- SET(UPDATE_TYPE bzr)
- ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
- IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
- SET(UPDATE_TYPE hg)
- ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
- ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
- ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
- ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
+ ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
+ SET(UPDATE_TYPE svn)
+ ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
+ SET(UPDATE_TYPE bzr)
+ ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
+ SET(UPDATE_TYPE hg)
+ ENDIF()
ENDIF(NOT UPDATE_TYPE)
IF(NOT UPDATE_TYPE)
@@ -156,22 +150,16 @@ IF(BUILD_TESTING)
IF("${_update_type}" STREQUAL "cvs")
SET(UPDATE_COMMAND "${CVSCOMMAND}")
SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
- ELSE("${_update_type}" STREQUAL "cvs")
- IF("${_update_type}" STREQUAL "svn")
- SET(UPDATE_COMMAND "${SVNCOMMAND}")
- SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
- ELSE("${_update_type}" STREQUAL "svn")
- IF("${_update_type}" STREQUAL "bzr")
- SET(UPDATE_COMMAND "${BZRCOMMAND}")
- SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
- ELSE("${_update_type}" STREQUAL "bzr")
- IF("${_update_type}" STREQUAL "hg")
- SET(UPDATE_COMMAND "${HGCOMMAND}")
- SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
- ENDIF("${_update_type}" STREQUAL "hg")
- ENDIF("${_update_type}" STREQUAL "bzr")
- ENDIF("${_update_type}" STREQUAL "svn")
- ENDIF("${_update_type}" STREQUAL "cvs")
+ ELSEIF("${_update_type}" STREQUAL "svn")
+ SET(UPDATE_COMMAND "${SVNCOMMAND}")
+ SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
+ ELSEIF("${_update_type}" STREQUAL "bzr")
+ SET(UPDATE_COMMAND "${BZRCOMMAND}")
+ SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
+ ELSEIF("${_update_type}" STREQUAL "hg")
+ SET(UPDATE_COMMAND "${HGCOMMAND}")
+ SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
+ ENDIF()
SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
"Maximum time allowed before CTest will kill the test.")