]> Creatis software - crea.git/blob - CMakeLists.txt
2593cf6faca20010081d9865f083c8677a21ce64
[crea.git] / CMakeLists.txt
1 # ---------------------------------
2 #
3 # Unless you are an experimented cmake user,
4 # have a look at :
5 # http://www.creatis.insa-lyon.fr/site/fr/CreatoosGettingStarted-v2.0.X
6 # before starting
7 # ---------------------------------
8
9 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
10 PROJECT(crea)
11
12 INCLUDE(Version.cmake)
13
14 SET(CREA_LIBRARY_PROPERTIES ${CREA_LIBRARY_PROPERTIES}
15   VERSION "${crea_MAJOR_VERSION}.${crea_MINOR_VERSION}.${crea_BUILD_VERSION}"
16   SOVERSION "${crea_MAJOR_VERSION}.${crea_MINOR_VERSION}.${crea_BUILD_VERSION}"
17 )
18
19 SET(CREA_VERBOSE_CMAKE TRUE)
20 SET(CREA_CMAKE_REL_PATH cmake)
21 SET(CREA_CMAKE_DIR ${PROJECT_SOURCE_DIR}/${CREA_CMAKE_REL_PATH})
22 INCLUDE(${CREA_CMAKE_DIR}/CREACMakeSettings.cmake NO_POLICY_SCOPE)
23 INCLUDE(${CREA_CMAKE_DIR}/CREAMacros.cmake)
24
25
26 CREA_PREVENT_IN_SOURCE_BUILD()
27 SET(USE_BOOST ON)
28
29 OPTION(CREA_BUILD_VTK "Build crea with vtk ?" OFF)
30 IF(CREA_BUILD_VTK)
31   SET(USE_VTK ON)
32   SET(CREA_BUILT_WITH_VTK ON)
33 ENDIF(CREA_BUILD_VTK)
34
35 OPTION(CREA_BUILD_WX "Build crea with wxWidgets ?" OFF)
36 IF(CREA_BUILD_WX)
37   SET(USE_WXWIDGETS ON)
38   SET(CREA_BUILT_WITH_WX ON)
39 ENDIF(CREA_BUILD_WX)
40
41 # JPR 4 mars 2011
42 set (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Module)
43
44
45 CREA_FIND_AND_USE_LIBRARIES()
46 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
47 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
48 SET(CREA_LIB_PATH ${CMAKE_CREA_LIB_PATH} )
49
50 MARK_AS_ADVANCED(
51   CMAKE_BACKWARDS_COMPATIBILITY
52   EXECUTABLE_OUTPUT_PATH
53   LIBRARY_OUTPUT_PATH
54   )
55   
56 SET (BOOST_FILESYSTEM_VERSION 2)
57
58 #-----------------------------------------------------------------------------
59 # messages compilation options
60
61 OPTION ( CREA_COMPILE_DEBUG_MESSAGES   "Compile CREA debug messages ?"   USE_DEBUG_LIB)
62 OPTION ( CREA_COMPILE_ERROR_MESSAGES   "Compile CREA error messages ?"   ON)
63 OPTION ( CREA_COMPILE_MESSAGES         "Compile CREA messages ?"         ON)
64 OPTION ( CREA_COMPILE_WARNING_MESSAGES "Compile CREA warning messages ?" ON)
65 #-----------------------------------------------------------------------------
66
67 INCLUDE(${CREA_CMAKE_DIR}/CREAResolveOptions.cmake)
68
69 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
70 INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/src)
71
72 #JCP UBUNTU
73 INCLUDE_DIRECTORIES(/usr/lib/x86_64-linux-gnu/glib-2.0/include/)
74 #JCP UBUNTU
75
76 ADD_SUBDIRECTORY(cmake)
77 ADD_SUBDIRECTORY(src)
78 ADD_SUBDIRECTORY(appli)
79 ADD_SUBDIRECTORY(lib)
80 #-----------------------------------------------------------------------------
81 OPTION( BUILD_SAMPLES "Build samples ?" OFF)
82 IF(BUILD_SAMPLES)
83   ADD_SUBDIRECTORY(samples)
84 ENDIF(BUILD_SAMPLES)
85 #-----------------------------------------------------------------------------
86
87 ADD_SUBDIRECTORY(install)
88