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