]> Creatis software - FrontAlgorithms.git/blob - CMakeLists.txt
Now ported to macosx and easier to configure on win32... hopefully
[FrontAlgorithms.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2
3 ## ============
4 ## = Policies =
5 ## ============
6
7 SET(
8   policies
9   CMP0020
10   CMP0042
11   )
12 FOREACH(policy ${policies})
13   IF(POLICY ${policy})
14     CMAKE_POLICY(SET ${policy} NEW)
15   ENDIF(POLICY ${policy})
16 ENDFOREACH(policy)
17
18 ## ================
19 ## = Project name =
20 ## ================
21
22 PROJECT(FrontAlgorithms)
23 SET(FrontAlgorithms_MAJOR_VERSION   "0")
24 SET(FrontAlgorithms_MINOR_VERSION   "0")
25 SET(FrontAlgorithms_RELEASE_VERSION "1")
26 SET(FrontAlgorithms_VERSION "${FrontAlgorithms_MAJOR_VERSION}.${FrontAlgorithms_MINOR_VERSION}.${FrontAlgorithms_RELEASE_VERSION}")
27
28 ## ===========
29 ## = Options =
30 ## ===========
31
32 OPTION(BUILD_EXAMPLES "Build examples" OFF)
33 OPTION(BUILD_SHARED_LIBS "Build shared libs" OFF)
34
35 IF(BUILD_SHARED_LIBS)
36   SET(LIB_TYPE SHARED)
37 ELSE(BUILD_SHARED_LIBS)
38   SET(LIB_TYPE STATIC)
39 ENDIF(BUILD_SHARED_LIBS)
40
41 ## ============
42 ## = Packages =
43 ## ============
44
45 # Prepare header to build shared libs (windows)
46 INCLUDE(GenerateExportHeader)
47
48 # Find ITK and VTK
49 FIND_PACKAGE(ITK REQUIRED)
50 FIND_PACKAGE(VTK REQUIRED)
51
52 INCLUDE(${ITK_USE_FILE})
53 INCLUDE(${VTK_USE_FILE})
54
55 # Do not use itk-vtk glue --> problems ahead!!!
56 IF(ITKVtkGlue_LOADED)
57   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.")
58 ENDIF(ITKVtkGlue_LOADED)
59
60 OPTION(USE_cpPlugins "Build cpPlugins based stuff" OFF)
61 IF(USE_cpPlugins)
62   FIND_PACKAGE(cpPlugins REQUIRED)
63 ENDIF(USE_cpPlugins)
64
65 ## ================================================
66 ## = Do not allow to build inside the source tree =
67 ## ================================================
68
69 IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
70   MESSAGE(FATAL_ERROR "Building in the source tree is not allowed")
71 ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
72
73 ## =====================================
74 ## = Where to put executables and libs =
75 ## =====================================
76
77 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
78 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
79 MARK_AS_ADVANCED(
80   CMAKE_BACKWARDS_COMPATIBILITY
81   EXECUTABLE_OUTPUT_PATH
82   LIBRARY_OUTPUT_PATH
83   )
84
85 ## ==============================
86 ## = Subdirs containing headers =
87 ## ==============================
88
89 INCLUDE_DIRECTORIES(
90   ${PROJECT_SOURCE_DIR}/lib
91   ${PROJECT_BINARY_DIR}/lib
92   )
93
94 ## ===========================
95 ## = Subdirs containing code =
96 ## ===========================
97
98 SUBDIRS(
99   cmake
100   lib
101   appli
102   )
103
104 ## eof - $RCSfile$