1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
13 FOREACH(policy ${policies})
15 CMAKE_POLICY(SET ${policy} NEW)
16 ENDIF(POLICY ${policy})
29 OPTION(BUILD_EXAMPLES "Build demos" OFF)
30 OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
31 OPTION(BUILD_FINAL_APPLICATION "Build final application" ON)
34 SET(cpm_LIBRARY_TYPE SHARED)
35 ELSE(BUILD_SHARED_LIBS)
36 SET(cpm_LIBRARY_TYPE STATIC)
37 ENDIF(BUILD_SHARED_LIBS)
43 # Prepare header to build shared libs (windows)
44 INCLUDE(GenerateExportHeader)
47 FIND_PACKAGE(ITK REQUIRED)
48 FIND_PACKAGE(VTK REQUIRED)
50 INCLUDE(${ITK_USE_FILE})
51 INCLUDE(${VTK_USE_FILE})
53 # Do not use itk-vtk glue --> problems ahead!!!
55 MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.")
56 ENDIF(ITKVtkGlue_LOADED)
59 IF(BUILD_FINAL_APPLICATION)
60 FIND_PACKAGE(Qt4 REQUIRED)
61 INCLUDE(${QT_USE_FILE})
63 ## Check for required vtk-qt4 modules
69 FOREACH(vtk_module ${vtk_required_modules})
70 IF(NOT ${vtk_module}_LOADED)
73 "${vtk_module} module is required but not available."
76 ENDIF(NOT ${vtk_module}_LOADED)
77 ENDFOREACH(vtk_module)
79 ENDIF(BUILD_FINAL_APPLICATION)
81 OPTION(USE_cpPlugins "Build cpPlugins based stuff" OFF)
83 FIND_PACKAGE(cpPlugins REQUIRED)
86 OPTION(USE_FrontAlgorithms "Build FrontAlgorithms based stuff" OFF)
87 IF(USE_FrontAlgorithms)
88 FIND_PACKAGE(FrontAlgorithms REQUIRED)
89 ENDIF(USE_FrontAlgorithms)
91 ## ================================================
92 ## = Do not allow to build inside the source tree =
93 ## ================================================
95 IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
96 MESSAGE(FATAL_ERROR "Building in the source tree is not allowed")
97 ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
99 ## =====================================
100 ## = Where to put executables and libs =
101 ## =====================================
103 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
104 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
106 CMAKE_BACKWARDS_COMPATIBILITY
107 EXECUTABLE_OUTPUT_PATH
111 ## ==============================
112 ## = Subdirs containing headers =
113 ## ==============================
116 ${PROJECT_SOURCE_DIR}/lib
117 ${PROJECT_SOURCE_DIR}/lib/third_party
118 ${PROJECT_BINARY_DIR}/lib
121 ## ===========================
122 ## = Subdirs containing code =
123 ## ===========================