]> Creatis software - crea.git/blob - CMakeLists.txt
Feature #1763
[crea.git] / CMakeLists.txt
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 #
7 #  This software is governed by the CeCILL-B license under French law and 
8 #  abiding by the rules of distribution of free software. You can  use, 
9 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 #  license as circulated by CEA, CNRS and INRIA at the following URL 
11 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 #  or in the file LICENSE.txt.
13 #
14 #  As a counterpart to the access to the source code and  rights to copy,
15 #  modify and redistribute granted by the license, users are provided only
16 #  with a limited warranty  and the software's author,  the holder of the
17 #  economic rights,  and the successive licensors  have only  limited
18 #  liability. 
19 #
20 #  The fact that you are presently reading this means that you have had
21 #  knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------ */                                                                         
23
24
25 # ---------------------------------
26 #
27 # Unless you are an experimented cmake user,
28 # have a look at :
29 # http://www.creatis.insa-lyon.fr/site/fr/CreatoosGettingStarted-v2.0.X
30 # before starting
31 # ---------------------------------
32
33 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
34 PROJECT(crea)
35
36 INCLUDE(Version.cmake)
37
38 SET(CREA_LIBRARY_PROPERTIES ${CREA_LIBRARY_PROPERTIES}
39   VERSION "${crea_MAJOR_VERSION}.${crea_MINOR_VERSION}.${crea_BUILD_VERSION}"
40   SOVERSION "${crea_MAJOR_VERSION}.${crea_MINOR_VERSION}.${crea_BUILD_VERSION}"
41 )
42
43 SET(CREA_VERBOSE_CMAKE TRUE)
44 SET(CREA_CMAKE_REL_PATH cmake)
45 SET(CREA_CMAKE_DIR ${PROJECT_SOURCE_DIR}/${CREA_CMAKE_REL_PATH})
46 INCLUDE(${CREA_CMAKE_DIR}/CREACMakeSettings.cmake NO_POLICY_SCOPE)
47 INCLUDE(${CREA_CMAKE_DIR}/CREAMacros.cmake)
48
49
50 CREA_PREVENT_IN_SOURCE_BUILD()
51 SET(USE_BOOST ON)
52
53 OPTION(CREA_BUILD_VTK "Build crea with vtk ?" OFF)
54 IF(CREA_BUILD_VTK)
55   SET(USE_VTK ON)
56   SET(CREA_BUILT_WITH_VTK ON)
57 ENDIF(CREA_BUILD_VTK)
58
59 OPTION(CREA_BUILD_WX "Build crea with wxWidgets ?" OFF)
60 IF(CREA_BUILD_WX)
61   SET(USE_WXWIDGETS ON)
62   SET(CREA_BUILT_WITH_WX ON)
63 ENDIF(CREA_BUILD_WX)
64
65 # JPR 4 mars 2011
66 set (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Module)
67
68
69 CREA_FIND_AND_USE_LIBRARIES()
70 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
71 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
72 SET(CREA_LIB_PATH ${CMAKE_CREA_LIB_PATH} )
73
74 MARK_AS_ADVANCED(
75   CMAKE_BACKWARDS_COMPATIBILITY
76   EXECUTABLE_OUTPUT_PATH
77   LIBRARY_OUTPUT_PATH
78   )
79   
80 SET (BOOST_FILESYSTEM_VERSION 2)
81
82 #-----------------------------------------------------------------------------
83 # messages compilation options
84
85 OPTION ( CREA_COMPILE_DEBUG_MESSAGES   "Compile CREA debug messages ?"   USE_DEBUG_LIB)
86 OPTION ( CREA_COMPILE_ERROR_MESSAGES   "Compile CREA error messages ?"   ON)
87 OPTION ( CREA_COMPILE_MESSAGES         "Compile CREA messages ?"         ON)
88 OPTION ( CREA_COMPILE_WARNING_MESSAGES "Compile CREA warning messages ?" ON)
89 #-----------------------------------------------------------------------------
90
91 INCLUDE(${CREA_CMAKE_DIR}/CREAResolveOptions.cmake)
92
93 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
94 INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/src)
95
96 #JCP UBUNTU
97 INCLUDE_DIRECTORIES(/usr/lib/x86_64-linux-gnu/glib-2.0/include/)
98 #JCP UBUNTU
99
100 ADD_SUBDIRECTORY(cmake)
101 ADD_SUBDIRECTORY(src)
102 ADD_SUBDIRECTORY(appli)
103 ADD_SUBDIRECTORY(lib)
104 #-----------------------------------------------------------------------------
105 OPTION( BUILD_SAMPLES "Build samples ?" OFF)
106 IF(BUILD_SAMPLES)
107   ADD_SUBDIRECTORY(samples)
108 ENDIF(BUILD_SAMPLES)
109 #-----------------------------------------------------------------------------
110
111 ADD_SUBDIRECTORY(install)
112