Simplify CTest.cmake module with ELSEIF

We use ELSEIF to simplify the cascading IF blocks for detecting version
control tools.
This commit is contained in:
Brad King 2010-02-10 10:43:23 -05:00
parent b0c6ca6cc0
commit ff101a565e
1 changed files with 17 additions and 29 deletions

View File

@ -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.")