Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkFunctionEnableBuildConfiguration.cmake
Go to the documentation of this file.
2 
3  if(MITK_BUILD_CONFIGURATION STREQUAL "Custom")
4  return()
5  endif()
6 
7  set(_build_config_file "${MITK_CMAKE_DIR}/BuildConfigurations/${MITK_BUILD_CONFIGURATION}.cmake")
8  if(NOT EXISTS ${_build_config_file})
9  set(_found_ext_build_config_file FALSE)
10  foreach(MITK_EXTENSION_DIR ${MITK_EXTENSION_DIRS})
11  set(_build_config_file "${MITK_EXTENSION_DIR}/CMake/BuildConfigurations/${MITK_BUILD_CONFIGURATION}.cmake")
12  if(EXISTS ${_build_config_file})
13  set(_found_ext_build_config_file TRUE)
14  break()
15  endif()
16  endforeach()
17  if(NOT _found_ext_build_config_file)
18  message(WARNING "Unknown build configuration \"${MITK_BUILD_CONFIGURATION}\", falling back to \"Custom\" configuration.")
19  return()
20  endif()
21  endif()
22 
23  message(STATUS "------- Using build configuration \"${MITK_BUILD_CONFIGURATION}\" -------")
24  include(${_build_config_file})
25 
26  if(MITK_CONFIG_PACKAGES)
27  foreach(_package ${MITK_CONFIG_PACKAGES})
28  if(DEFINED MITK_USE_${_package})
29  if(NOT MITK_USE_${_package})
30  message("> Enabling package ${_package} as requested by the build configuration")
31  get_property(_is_cache CACHE MITK_USE_${_package} PROPERTY VALUE)
32  if(DEFINED _is_cache)
33  set(MITK_USE_${_package} ON CACHE BOOL "Use ${_package} in MITK" FORCE)
34  else()
35  set(MITK_USE_${_package} ON)
36  endif()
37  endif()
38  else()
39  message(SEND_ERROR "Unknown package name \"${_package}\" in build configuration \"${MITK_BUILD_CONFIGURATION}\"")
40  endif()
41  endforeach()
42  endif()
43 
44  if(NOT MITK_USE_SUPERBUILD AND MITK_CONFIG_PLUGINS AND MITK_USE_BLUEBERRY)
45  foreach(_plugin ${MITK_CONFIG_PLUGINS})
46  if(DEFINED MITK_BUILD_${_plugin} AND NOT MITK_BUILD_${_plugin})
47  message("> Enabling plug-in ${_plugin} as requested by the build configuration")
48  endif()
49  set(MITK_BUILD_${_plugin} ON CACHE BOOL "Build the ${_plugin} Plugin." FORCE)
50  endforeach()
51  endif()
52 
53 endfunction()
mitkFunctionEnableBuildConfiguration()