1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------
28 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
30 #MARK_AS_ADVANCED( FORCE CMAKE_BACKWARDS_COMPATIBILITY )
31 # for CMake 2.6 corrected behaviour (see "cmake --help-policy CMP0003")
32 IF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
33 CMAKE_POLICY(SET CMP0003 NEW)
34 CMAKE_POLICY(SET CMP0005 NEW)
35 CMAKE_POLICY(SET CMP0011 NEW)
36 ENDIF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
38 ###################################
40 ###################################
42 #-----------------------------------------------------------------------------
43 # Configure Dart testing support. This should be done before any
44 # MESSAGE(FATAL_ERROR ...) commands are invoked.
50 SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
51 MARK_AS_ADVANCED(BUILDNAME)
53 #-----------------------------------------------------------------------------
55 #==================================
57 SET(PROJECT_MAJOR_VERSION 1)
58 SET(PROJECT_MINOR_VERSION 0)
59 SET(PROJECT_BUILD_VERSION 0)
60 SET(CREA_VERBOSE_CMAKE TRUE)
63 set (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Module)
65 #==================================
66 # Find crea (mandatory, to use macros)
67 FIND_PACKAGE(crea REQUIRED)
69 INCLUDE(${crea_USE_FILE})
71 #==================================
73 #==================================
74 # Do not allow to build inside the source tree
75 CREA_PREVENT_IN_SOURCE_BUILD()
76 #==================================
79 # For boost 1.46 troubles... // JPR.
80 add_definitions(-DBOOST_FILESYSTEM_VERSION=3)
87 OPTION(USE_WXWIDGETS "Use WxWidgets GUI" ON)
88 OPTION(USE_QT4 "USE QT4GUI" OFF)
89 OPTION(USE_XERCES "USE Xerces if you want to use an beta version of outputModel" OFF)
90 OPTION(USE_INSTALL_APP "install only useful applications" ON)
94 MESSAGE(ERROR "CANNOT USE QT WXWIDGETS IN SAME TIME")
100 MESSAGE("So ... ${QT_DIR}")
101 INCLUDE_DIRECTORIES(${QT_DIR}/../include)
102 LINK_DIRECTORIES(${QT_DIR}/../lib)
106 # ----------------- manual setting GDCM/GDCM2 JPR
108 OPTION(USE_GDCM "Use gdcm 1.3" ON)
109 OPTION(USE_GDCM2 "Use gdcm 2.0.14 at least" OFF)
111 MESSAGE(STATUS "GDCM LIB ....= ${GDCM_LIBRARIES}")
113 OPTION(USE_GDCM_ANOM "use gdcm2 anonymizer tool" OFF)
114 #TO DO TEST IF GDCM_USE_SYSTEM_OPENSSL is valid
116 OPTION(USE_ITK "use ITK" ON)
117 CREA_FIND_AND_USE_LIBRARIES()
119 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
120 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
122 CMAKE_BACKWARDS_COMPATIBILITY
123 EXECUTABLE_OUTPUT_PATH
129 ##EED IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 4)
130 ##EED INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/win32)
131 ##EED LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/win32)
133 ##EED IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 8)
134 ##EED INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/win64)
135 ##EED LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/win64)
140 ##EED mechanisme FIND_PACKAGE(SQLite) missing ...
142 set (SQLITE_DIR $ENV{SQLITE_DIR})
143 IF(DEFINED SQLITE_DIR)
144 INCLUDE_DIRECTORIES(${SQLITE_DIR}/include)
145 LINK_DIRECTORIES(${SQLITE_DIR}/lib)
147 MESSAGE(FATAL_ERROR "System variable SQLITE_DIR not defined.")
152 SET(LIBNAME creaImageIO)
154 ${PROJECT_BINARY_DIR}
155 ${PROJECT_SOURCE_DIR}/src
157 ADD_SUBDIRECTORY(src)
160 OPTION(BUILD_CREA_BRUKER "Build creaIRM with creaBruker?" ON)
162 IF (BUILD_CREA_BRUKER)
163 FIND_PACKAGE(creaBruker REQUIRED)
164 IF (creaBruker_FOUND)
165 INCLUDE(${creaBruker_USE_FILE})
166 CREA_DEFINE(BUILD_BRUKER)
167 ENDIF(creaBruker_FOUND)
168 ENDIF (BUILD_CREA_BRUKER)
171 # To Use PACS connection library
172 OPTION(BUILD_CREA_PACS "Build creaImageIO with PACS connection library ?" OFF)
174 CREA_DEFINE(BUILD_PACS)
175 ENDIF(BUILD_CREA_PACS)
177 #==================================
180 ADD_SUBDIRECTORY(appli)
181 ADD_SUBDIRECTORY(bbtk)
182 ADD_SUBDIRECTORY(lib)
183 ADD_SUBDIRECTORY(bbtk_Transform3Ddicom_PKG)
185 #EED 31/05/2011 not compiling
186 #ADD_SUBDIRECTORY(tests)
189 ##EED IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 4)
190 ##EED ADD_SUBDIRECTORY(win32)
192 ##EED IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 8)
193 ##EED ADD_SUBDIRECTORY(win64)
196 ADD_SUBDIRECTORY(install)
197 #==================================
200 #EED 31/05/2011 not compiling