Commit ff101a56 authored by Brad King's avatar Brad King
Browse files

Simplify CTest.cmake module with ELSEIF

We use ELSEIF to simplify the cascading IF blocks for detecting version
control tools.
parent b0c6ca6c
......@@ -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.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment