Medical Imaging Interaction Toolkit  2018.4.99-67d34b5d
Medical Imaging Interaction Toolkit
MITKDashboardSetup.cmake
Go to the documentation of this file.
1 # This file is intended to be included at the end of a custom MITKDashboardScript.TEMPLATE.cmake file
2 
3 list(APPEND CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
4 
5 #
6 # Automatically determined properties
7 #
8 set(MY_OPERATING_SYSTEM )
9 
10 if(UNIX)
11  set(url "https://raw.githubusercontent.com/MITK/MITK/${GIT_BRANCH}/CMake/mitkDetectOS.sh")
12  set(dest "${CTEST_SCRIPT_DIRECTORY}/mitkDetectOS.sh")
13  downloadFile("${url}" "${dest}")
14  execute_process(COMMAND sh "${dest}"
15  RESULT_VARIABLE _result OUTPUT_VARIABLE _out
16  OUTPUT_STRIP_TRAILING_WHITESPACE)
17 
18  if(NOT _result)
19  set(MY_OPERATING_SYSTEM "${_out}")
20  endif()
21 endif()
22 
23 if(NOT MY_OPERATING_SYSTEM)
24  set(MY_OPERATING_SYSTEM "${CMAKE_HOST_SYSTEM}") # Windows 7, Linux-2.6.32, Darwin...
25 endif()
26 
27 site_name(CTEST_SITE)
28 
29 if(NOT DEFINED MITK_USE_Qt5)
30  set(MITK_USE_Qt5 1)
31 endif()
32 
33 #
34 # Project specific properties
35 #
36 if(NOT CTEST_BUILD_NAME)
37  if(MITK_USE_Qt5)
38  set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM} ${MY_COMPILER} ${CTEST_BUILD_CONFIGURATION}")
39  else()
40  set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM} ${MY_COMPILER} ${CTEST_BUILD_CONFIGURATION}")
41  endif()
42  set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}${CTEST_BUILD_NAME_SUFFIX}")
43 endif()
44 set(PROJECT_BUILD_DIR "MITK-build")
45 
46 set(CTEST_PATH "$ENV{PATH}")
47 if(WIN32)
48  if("${CTEST_CMAKE_GENERATOR_PLATFORM}" STREQUAL "x64")
49  set(CMAKE_LIBRARY_ARCHITECTURE x64)
50  else()
51  set(CMAKE_LIBRARY_ARCHITECTURE x86)
52  endif()
53  string(SUBSTRING "${MY_COMPILER}" 2 2 vc_version)
54 
55  set(OPENCV_BIN_DIR "${CTEST_BINARY_DIRECTORY}/ep/${CMAKE_LIBRARY_ARCHITECTURE}/vc${vc_version}/bin")
56 
57  set(BLUEBERRY_RUNTIME_DIR "${CTEST_BINARY_DIRECTORY}/MITK-build/bin/plugins/${CTEST_BUILD_CONFIGURATION}")
58 
59  set(PYTHON_BINARY_DIRS "${CTEST_BINARY_DIRECTORY}/ep/src/CTK-build/CMakeExternals/Install/bin")
60  get_filename_component(_python_dir "${Python3_EXECUTABLE}" DIRECTORY)
61  list(APPEND PYTHON_BINARY_DIRS "${_python_dir}")
62 
63  set(CTEST_PATH "${CTEST_PATH};${CTEST_BINARY_DIRECTORY}/ep/bin;${BLUEBERRY_RUNTIME_DIR};${OPENCV_BIN_DIR};${PYTHON_BINARY_DIRS}")
64 endif()
65 set(ENV{PATH} "${CTEST_PATH}")
66 
67 # If the dashscript doesn't define a GIT_REPOSITORY variable, let's define it here.
68 if(NOT DEFINED GIT_REPOSITORY OR GIT_REPOSITORY STREQUAL "")
69  set(GIT_REPOSITORY "https://phabricator.mitk.org/source/mitk.git")
70 endif()
71 
72 #
73 # Display build info
74 #
75 message("Site name: ${CTEST_SITE}")
76 message("Build name: ${CTEST_BUILD_NAME}")
77 message("Script Mode: ${SCRIPT_MODE}")
78 message("Coverage: ${WITH_COVERAGE}, MemCheck: ${WITH_MEMCHECK}")
79 
80 #
81 # Set initial cache options
82 #
83 if(CTEST_CMAKE_GENERATOR MATCHES ".*Makefiles.*")
84  set(CTEST_USE_LAUNCHERS 1)
85 else()
86  set(CTEST_USE_LAUNCHERS 0)
87 endif()
88 set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} ${CTEST_USE_LAUNCHERS})
89 
90 if(NOT DEFINED MITK_BUILD_CONFIGURATION)
91  set(MITK_BUILD_CONFIGURATION "All")
92 endif()
93 
94 if(NOT DEFINED MITK_VTK_DEBUG_LEAKS)
95  set(MITK_VTK_DEBUG_LEAKS 1)
96 endif()
97 
98 set(INITIAL_CMAKECACHE_OPTIONS "
99 SUPERBUILD_EXCLUDE_MITKBUILD_TARGET:BOOL=TRUE
100 MITK_BUILD_CONFIGURATION:STRING=${MITK_BUILD_CONFIGURATION}
101 MITK_VTK_DEBUG_LEAKS:BOOL=${MITK_VTK_DEBUG_LEAKS}
102 ${ADDITIONAL_CMAKECACHE_OPTION}
103 ")
104 
105 # Write a cache file for populating the MITK initial cache (not the superbuild cache).
106 # This can be used to provide variables which are not passed through the
107 # superbuild process to the MITK configure step)
108 if(MITK_INITIAL_CACHE)
109  set(mitk_cache_file "${CTEST_SCRIPT_DIRECTORY}/mitk_initial_cache.txt")
110  file(WRITE "${mitk_cache_file}" "${MITK_INITIAL_CACHE}")
111  set(INITIAL_CMAKECACHE_OPTIONS "${INITIAL_CMAKECACHE_OPTIONS}
112 MITK_INITIAL_CACHE_FILE:INTERNAL=${mitk_cache_file}
113 ")
114 endif()
115 
116 if(MITK_EXTENSIONS)
117  set(MITK_EXTENSION_DIRS "")
118  foreach(extension ${MITK_EXTENSIONS})
119  if(extension MATCHES "[^|]+\\|[^|]+\\|(.+)")
120  if(MITK_EXTENSION_DIRS)
121  set(MITK_EXTENSION_DIRS "${MITK_EXTENSION_DIRS};")
122  endif()
123  set(MITK_EXTENSION_DIRS "${MITK_EXTENSION_DIRS}${CTEST_DASHBOARD_ROOT}/${CMAKE_MATCH_1}")
124  endif()
125  endforeach()
126 endif()
127 
128 #
129 # Download and include dashboard driver script
130 #
131 set(url "https://raw.githubusercontent.com/MITK/MITK/${GIT_BRANCH}/CMake/MITKDashboardDriverScript.cmake")
132 set(dest ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}.driver)
133 downloadFile("${url}" "${dest}")
134 include(${dest})
#define MITK_EXTENSION_DIRS
Definition: mitkConfig.h:10
downloadFile(url, dest)