#
FIND_PROGRAM(HOSTNAME_COMMAND NAMES hostname)
-EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname)
-SET(CTEST_SITE "${_hostname}")
+IF(NOT "${HOSTNAME_COMMAND}" MATCHES "-NOTFOUND")
+ EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname)
+ SET(CTEST_SITE "${_hostname}")
+ELSE()
+ # Well, no hostname available. What about:
+ SET(CTEST_SITE "BobMorane")
+ENDIF()
MESSAGE("-- CTEST_SITE: ${CTEST_SITE}")
ENDIF()
#
-# Append subversion branch to CTEST_BUILD_NAME:
+# Query subversion information:
#
+
+# First try native subversion:
FIND_PACKAGE(Subversion QUIET)
-EXECUTE_PROCESS(
- COMMAND ${Subversion_SVN_EXECUTABLE} info ${CTEST_SOURCE_DIRECTORY}
- OUTPUT_QUIET ERROR_QUIET
- RESULT_VARIABLE _result
- )
+SET(_result 1)
+IF(SUBVERSION_FOUND)
+ EXECUTE_PROCESS(
+ COMMAND ${Subversion_SVN_EXECUTABLE} info ${CTEST_SOURCE_DIRECTORY}
+ OUTPUT_QUIET ERROR_QUIET
+ RESULT_VARIABLE _result
+ )
+ENDIF()
+
IF(${_result} EQUAL 0)
Subversion_WC_INFO(${CTEST_SOURCE_DIRECTORY} _svn)
+
+ELSE()
+
+ # Umm, no valid subversion info was found, try again with git-svn:
+ FIND_PACKAGE(Git QUIET)
+ IF(GIT_FOUND)
+ EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} svn info
+ WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY}
+ OUTPUT_VARIABLE _svn_WC_INFO
+ RESULT_VARIABLE _result
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ IF(${_result} EQUAL 0)
+ STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
+ "\\2" _svn_WC_URL "${_svn_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+ "\\2" _svn_WC_ROOT "${_svn_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
+ "\\2" _svn_WC_REVISION "${_svn_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
+ "\\2" _svn_WC_LAST_CHANGED_DATE "${_svn_WC_INFO}")
+ ELSE()
+ SET(_svn_WC_INFO)
+ ENDIF()
+ ENDIF()
+ENDIF()
+
+# If we have a valid (git) svn info use it:
+IF(${_result} EQUAL 0)
+
STRING(REGEX REPLACE "^${_svn_WC_ROOT}/" "" _branch ${_svn_WC_URL})
STRING(REGEX REPLACE "^branches/" "" _branch ${_branch})
STRING(REGEX REPLACE "/deal.II$" "" _branch ${_branch})
- SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_branch}")
-ENDIF()
-#
-# Append config file name to CTEST_BUILD_NAME:
-#
-
-IF(NOT "${CONFIG_FILE}" STREQUAL "")
- GET_FILENAME_COMPONENT(_conf ${CONFIG_FILE} NAME_WE)
- STRING(REGEX REPLACE "#.*$" "" _conf ${_conf})
- SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_conf}")
+ SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_branch}")
ENDIF()
-MESSAGE("-- CTEST_BUILD_NAME: ${CTEST_BUILD_NAME}")
-
#
# We require valid svn information for build tests:
#
TRACK was set to \"Build Tests\" which requires the source directory to be
under Subversion version control.
"
- )
+ )
ENDIF()
#
)
ENDIF()
+#
+# Append config file name to CTEST_BUILD_NAME:
+#
+
+IF(NOT "${CONFIG_FILE}" STREQUAL "")
+ GET_FILENAME_COMPONENT(_conf ${CONFIG_FILE} NAME_WE)
+ STRING(REGEX REPLACE "#.*$" "" _conf ${_conf})
+ SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_conf}")
+ENDIF()
+
+MESSAGE("-- CTEST_BUILD_NAME: ${CTEST_BUILD_NAME}")
+
#
# Declare files that should be submitted as notes:
#
#
# Setup coverage:
#
+
IF(COVERAGE)
IF(NOT TRACK MATCHES "Experimental")
MESSAGE(FATAL_ERROR "
ENDIF()
FIND_PROGRAM(GCOV_COMMAND NAMES gcov)
-
IF(GCOV_COMMAND MATCHES "-NOTFOUND")
MESSAGE(FATAL_ERROR "
Coverage enabled but could not find the gcov executable. Please install