Medical Imaging Interaction Toolkit  2016.11.0
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  message(WARNING "Unknown build configuration \"${MITK_BUILD_CONFIGURATION}\", falling back to \"Custom\" configuration.")
10  return()
11  endif()
12 
13  message(STATUS "------- Using build configuration \"${MITK_BUILD_CONFIGURATION}\" -------")
14  include(${_build_config_file})
15 
16  if(MITK_CONFIG_PACKAGES)
17  foreach(_package ${MITK_CONFIG_PACKAGES})
18  if(DEFINED MITK_USE_${_package})
19  if(NOT MITK_USE_${_package})
20  message("> Enabling package ${_package} as requested by the build configuration")
21  get_property(_is_cache CACHE MITK_USE_${_package} PROPERTY VALUE)
22  if(DEFINED _is_cache)
23  set(MITK_USE_${_package} ON CACHE BOOL "Use ${_package} in MITK" FORCE)
24  else()
25  set(MITK_USE_${_package} ON)
26  endif()
27  endif()
28  else()
29  message(SEND_ERROR "Unknown package name \"${_package}\" in build configuration \"${MITK_BUILD_CONFIGURATION}\"")
30  endif()
31  endforeach()
32  endif()
33 
34  if(NOT MITK_USE_SUPERBUILD AND MITK_CONFIG_PLUGINS AND MITK_USE_BLUEBERRY)
35  foreach(_plugin ${MITK_CONFIG_PLUGINS})
36  if(DEFINED MITK_BUILD_${_plugin} AND NOT MITK_BUILD_${_plugin})
37  message("> Enabling plug-in ${_plugin} as requested by the build configuration")
38  endif()
39  set(MITK_BUILD_${_plugin} ON CACHE BOOL "Build the ${_plugin} Plugin." FORCE)
40  endforeach()
41  endif()
42 
43 endfunction()
mitkFunctionEnableBuildConfiguration()