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 #==================================
44 SET(PROJECT_MAJOR_VERSION 1)
45 SET(PROJECT_MINOR_VERSION 0)
46 SET(PROJECT_BUILD_VERSION 0)
47 SET(CREA_VERBOSE_CMAKE TRUE)
50 set (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Module)
52 #==================================
53 # Find crea (mandatory, to use macros)
54 FIND_PACKAGE(crea REQUIRED)
56 INCLUDE(${crea_USE_FILE})
58 #==================================
60 #==================================
61 # Do not allow to build inside the source tree
62 CREA_PREVENT_IN_SOURCE_BUILD()
63 #==================================
66 # For boost 1.46 troubles... // JPR.
67 add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
74 OPTION(USE_WXWIDGETS "Use WxWidgets GUI" ON)
75 OPTION(USE_QT4 "USE QT4GUI" OFF)
76 OPTION(USE_XERCES "USE Xerces if you want to use an beta version of outputModel" OFF)
77 OPTION(USE_INSTALL_APP "install only useful applications" ON)
81 MESSAGE(ERROR "CANNOT USE QT WXWIDGETS IN SAME TIME")
87 MESSAGE("So ... ${QT_DIR}")
88 INCLUDE_DIRECTORIES(${QT_DIR}/../include)
89 LINK_DIRECTORIES(${QT_DIR}/../lib)
93 # ----------------- manual setting GDCM/GDCM2 JPR
95 OPTION(USE_GDCM "Use gdcm 1.3" ON)
96 OPTION(USE_GDCM2 "Use gdcm 2.0.14 at least" OFF)
98 MESSAGE(STATUS "GDCM LIB ....= ${GDCM_LIBRARIES}")
100 OPTION(USE_GDCM_ANOM "use gdcm2 anonymizer tool" OFF)
101 #TO DO TEST IF GDCM_USE_SYSTEM_OPENSSL is valid
103 OPTION(USE_ITK "use ITK" ON)
104 CREA_FIND_AND_USE_LIBRARIES()
106 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
107 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
109 CMAKE_BACKWARDS_COMPATIBILITY
110 EXECUTABLE_OUTPUT_PATH
115 IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 4)
116 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/win32)
117 LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/win32)
119 IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 8)
120 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/win64)
121 LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/win64)
125 SET(LIBNAME creaImageIO)
127 ${PROJECT_BINARY_DIR}
128 ${PROJECT_SOURCE_DIR}/src
130 ADD_SUBDIRECTORY(src)
133 OPTION(BUILD_CREA_BRUKER "Build creaIRM with creaBruker?" ON)
135 IF (BUILD_CREA_BRUKER)
136 FIND_PACKAGE(creaBruker REQUIRED)
137 IF (creaBruker_FOUND)
138 INCLUDE(${creaBruker_USE_FILE})
139 CREA_DEFINE(BUILD_BRUKER)
140 ENDIF(creaBruker_FOUND)
141 ENDIF (BUILD_CREA_BRUKER)
144 # To Use PACS connection library
145 OPTION(BUILD_CREA_PACS "Build creaImageIO with PACS connection library ?" OFF)
147 CREA_DEFINE(BUILD_PACS)
148 ENDIF(BUILD_CREA_PACS)
150 #==================================
153 ADD_SUBDIRECTORY(appli)
154 ADD_SUBDIRECTORY(bbtk)
156 #EED 31/05/2011 not compiling
157 #ADD_SUBDIRECTORY(tests)
159 IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 4)
160 ADD_SUBDIRECTORY(win32)
162 IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 8)
163 ADD_SUBDIRECTORY(win64)
166 ADD_SUBDIRECTORY(install)
167 #==================================
170 #EED 31/05/2011 not compiling