1 # This file is intended to be included at the end of a custom MITKDashboardScript.TEMPLATE.cmake file
3 list(APPEND CTEST_NOTES_FILES
"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
6 # Automatically determined properties
8 set(MY_OPERATING_SYSTEM )
11 # Download a utility script
12 if(IS_PHABRICATOR_URL)
13 set(url
"https://phabricator.mitk.org/source/mitk/browse/${GIT_BRANCH}/CMake/mitkDetectOS.sh?view=raw")
17 set(dest "${CTEST_SCRIPT_DIRECTORY}/mitkDetectOS.sh
")
18 downloadFile("${url}
" "${dest}
")
19 execute_process(COMMAND sh "${dest}
"
20 RESULT_VARIABLE _result OUTPUT_VARIABLE _out
21 OUTPUT_STRIP_TRAILING_WHITESPACE)
24 set(MY_OPERATING_SYSTEM "${_out}
")
28 if(NOT MY_OPERATING_SYSTEM)
29 set(MY_OPERATING_SYSTEM "${CMAKE_HOST_SYSTEM}
") # Windows 7, Linux-2.6.32, Darwin...
34 if(NOT DEFINED MITK_USE_Qt5)
39 if(NOT QT_QMAKE_EXECUTABLE)
40 find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake-qt5
41 HINTS ${QT_BINARY_DIR})
44 execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} --version
45 OUTPUT_VARIABLE MY_QT_VERSION
46 RESULT_VARIABLE qmake_error)
48 message(FATAL_ERROR "Error when executing ${QT_QMAKE_EXECUTABLE} --version\n${qmake_error}
")
51 string(REGEX REPLACE ".*Qt version ([0-9.]+) .*
" "\\1
" MY_QT_VERSION ${MY_QT_VERSION})
55 # Project specific properties
57 if(NOT CTEST_BUILD_NAME)
59 set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM} ${MY_COMPILER} Qt${MY_QT_VERSION} ${CTEST_BUILD_CONFIGURATION}
")
61 set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM} ${MY_COMPILER} ${CTEST_BUILD_CONFIGURATION}
")
63 set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}${CTEST_BUILD_NAME_SUFFIX}
")
65 set(PROJECT_BUILD_DIR "MITK-build
")
67 set(CTEST_PATH "$ENV{PATH}
")
69 if("${CTEST_CMAKE_GENERATOR}
" MATCHES ".*Win64
")
70 set(CMAKE_LIBRARY_ARCHITECTURE x64)
72 set(CMAKE_LIBRARY_ARCHITECTURE x86)
74 string(SUBSTRING "${MY_COMPILER}
" 2 2 vc_version)
76 set(OPENCV_BIN_DIR "${CTEST_BINARY_DIRECTORY}/ep/${CMAKE_LIBRARY_ARCHITECTURE}/vc${vc_version}/bin
")
78 set(SOFA_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/ep/src/SOFA-build/bin/${CTEST_BUILD_CONFIGURATION}
")
79 set(BLUEBERRY_RUNTIME_DIR "${CTEST_BINARY_DIRECTORY}/MITK-build/bin/plugins/${CTEST_BUILD_CONFIGURATION}
")
81 set(PYTHON_BINARY_DIRS "${CTEST_BINARY_DIRECTORY}/ep/src/CTK-build/CMakeExternals/Install/bin
")
82 list(APPEND PYTHON_BINARY_DIRS "${CTEST_BINARY_DIRECTORY}/ep/lib/python2.7/bin
")
84 set(CTEST_PATH "${CTEST_PATH};${CTEST_BINARY_DIRECTORY}/ep/bin;${QT_BINARY_DIR};${SOFA_BINARY_DIR};${BLUEBERRY_RUNTIME_DIR};${OPENCV_BIN_DIR};${PYTHON_BINARY_DIRS}
")
86 set(ENV{PATH} "${CTEST_PATH}
")
88 # If the dashscript doesn't define a GIT_REPOSITORY variable, let's define it here.
89 if(NOT DEFINED GIT_REPOSITORY OR GIT_REPOSITORY STREQUAL "")
90 set(GIT_REPOSITORY "https:
96 message(
"Site name: ${CTEST_SITE}")
97 message("Build name: ${CTEST_BUILD_NAME}
")
98 message("Script Mode: ${SCRIPT_MODE}
")
99 message("Coverage: ${WITH_COVERAGE}, MemCheck: ${WITH_MEMCHECK}
")
102 # Set initial cache options
104 if(CTEST_CMAKE_GENERATOR MATCHES ".*Makefiles.*
")
105 set(CTEST_USE_LAUNCHERS 1)
107 set(CTEST_USE_LAUNCHERS 0)
109 set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} ${CTEST_USE_LAUNCHERS})
111 # Remove this if block after all dartclients work
112 if(DEFINED ADDITIONNAL_CMAKECACHE_OPTION)
113 message(WARNING "Rename ADDITIONNAL to ADDITIONAL
in your dartlclient script: ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}
")
114 set(ADDITIONAL_CMAKECACHE_OPTION ${ADDITIONNAL_CMAKECACHE_OPTION})
117 if(NOT DEFINED MITK_BUILD_CONFIGURATION)
118 set(MITK_BUILD_CONFIGURATION "All
")
121 if(NOT DEFINED MITK_VTK_DEBUG_LEAKS)
122 set(MITK_VTK_DEBUG_LEAKS 1)
125 set(INITIAL_CMAKECACHE_OPTIONS "
126 SUPERBUILD_EXCLUDE_MITKBUILD_TARGET:BOOL=TRUE
127 MITK_BUILD_CONFIGURATION:STRING=${MITK_BUILD_CONFIGURATION}
128 MITK_VTK_DEBUG_LEAKS:BOOL=${MITK_VTK_DEBUG_LEAKS}
129 ${ADDITIONAL_CMAKECACHE_OPTION}
133 set(INITIAL_CMAKECACHE_OPTIONS "${INITIAL_CMAKECACHE_OPTIONS}
134 QT_QMAKE_EXECUTABLE:
FILEPATH=${QT_QMAKE_EXECUTABLE}
")
137 # Write a cache file for populating the MITK initial cache (not the superbuild cache).
138 # This can be used to provide variables which are not passed through the
139 # superbuild process to the MITK configure step)
140 if(MITK_INITIAL_CACHE)
141 set(mitk_cache_file "${CTEST_SCRIPT_DIRECTORY}/mitk_initial_cache.txt
")
142 file(WRITE "${mitk_cache_file}
" "${MITK_INITIAL_CACHE}
")
143 set(INITIAL_CMAKECACHE_OPTIONS "${INITIAL_CMAKECACHE_OPTIONS}
144 MITK_INITIAL_CACHE_FILE:INTERNAL=${mitk_cache_file}
150 # Download and include dashboard driver script
152 if(IS_PHABRICATOR_URL)
155 set(url
"https://raw.githubusercontent.com/MITK/MITK/master/CMake/MITKDashboardDriverScript.cmake")
157 set(dest ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}.driver)
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
const std::string FILEPATH