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 # ------------------------------------------------------------------------ */
27 # ==================================
29 # ==================================
31 # This file is dupplicated as BBTKConfigurePackage2.cmake
33 # Only ONE commented out line, in BBTKConfigurePackage2.cmake differs
35 # In case of modification, mind to modify BBTKConfigurePackage2.cmake as well!
40 MESSAGE(STATUS "=======================================")
41 MESSAGE(STATUS "CONFIGURING BBTK PACKAGE ${BBTK_PACKAGE_NAME}")
43 #---------------------------------------------------------------------------
44 SET(${BBTK_PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
45 #---------------------------------------------------------------------------
47 #---------------------------------------------------------------------------
48 IF(NOT BBTK_CORE_PACKAGE)
49 #---------------------------------------------------------------------------
53 MARK_AS_ADVANCED(BBTK_DIR)
54 #-------------------------------------------------------------------------
55 # If not a core package must include necessary cmake scripts
56 INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackagePaths.cmake)
57 INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildAllOption.cmake)
58 # INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
59 INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake)
60 #-------------------------------------------------------------------------
61 # Configure bbtk_config_build.xml.in for bbi to find the bbs
62 INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigureBbtkConfigXmlForBuildTree.cmake)
63 #-------------------------------------------------------------------------
65 # FOR THE MOMENT ONLY ONE BBTK PACKAGE PER PROJECT ALLOWED!!!
67 SET(${BBTK_PACKAGE_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
68 # ${CMAKE_CURRENT_BINARY_DIR})
69 #-------------------------------------------------------------------------
70 #---------------------------------------------------------------------------
71 # CREATES THE bbtkPackage TEXT FILE
73 ${BBTK_CMAKE_DIR}/bbtkPackage.in
74 ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
78 INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
81 #---------------------------------------------------------------------------
82 ELSE(NOT BBTK_CORE_PACKAGE)
83 SET(${BBTK_PACKAGE_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
84 ENDIF(NOT BBTK_CORE_PACKAGE)
85 #---------------------------------------------------------------------------
91 #----------------------------------------------------------------------------
92 # USER DEFINED ADDITIONAL INCLUDE DIRS
93 INCLUDE_DIRECTORIES(${${BBTK_PACKAGE_NAME}_INCLUDE_DIRS})
94 #----------------------------------------------------------------------------
97 #---------------------------------------------------------------------------
98 # Package dependencies
99 SET(${BBTK_PACKAGE_NAME}_DEPS bb${BBTK_PACKAGE_NAME})
100 STRING(REGEX MATCH "${${BBTK_PACKAGE_NAME}_DEPS}"
101 ${BBTK_PACKAGE_NAME}_IN_DEPS
102 "${BBTK_PACKAGES_DEPS}")
103 #---------------------------------------------------------------------------
104 #SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL "bbtk packages dependencies" FORCE)
108 #----------------------------------------------------------------------------
109 # VARS CONFIGURED IN bbPackage.h AND IN doc/bbdoc/header.html.in
110 SET(BBTK_PACKAGE_AUTHOR "${${BBTK_PACKAGE_NAME}_AUTHOR}")
111 SET(BBTK_PACKAGE_DESCRIPTION "${${BBTK_PACKAGE_NAME}_DESCRIPTION}")
112 SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
113 SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
114 SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
115 SET(BBTK_PACKAGE_VERSION
116 "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
117 #----------------------------------------------------------------------------
120 #---------------------------------------------------------------------------
121 # If package deps not in global deps : add them
122 IF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
123 SET(BBTK_PACKAGES_DEPS "${${BBTK_PACKAGE_NAME}_DEPS};${BBTK_PACKAGES_DEPS}"
124 CACHE INTERNAL "bbtk packages dependencies" FORCE)
125 # MESSAGE(STATUS "Packages=${BBTK_PACKAGES_DEPS}")
126 ENDIF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
127 #---------------------------------------------------------------------------
129 #---------------------------------------------------------------------------
130 # Package dependencies
131 IF(${BBTK_PACKAGE_NAME}_USE_VTK)
132 SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
133 SET(${BBTK_PACKAGE_NAME}_LIBS
134 ${${BBTK_PACKAGE_NAME}_LIBS}
137 ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
139 IF(${BBTK_PACKAGE_NAME}_USE_ITK)
140 SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE)
141 SET(${BBTK_PACKAGE_NAME}_LIBS
142 ${${BBTK_PACKAGE_NAME}_LIBS}
146 #Need to add additional gdcm libraries provided by system
149 SET(${BBTK_PACKAGE_NAME}_LIBS
150 ${${BBTK_PACKAGE_NAME}_LIBS}
151 vtkgdcm gdcmIOD gdcmMSFF gdcmexpat gdcmCommon gdcmMEXD gdcmDSED gdcmDICT
152 gdcmjpeg8 gdcmjpeg12 gdcmjpeg16 socketxx gdcmopenjpeg gdcmcharls
156 ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
158 IF(${BBTK_PACKAGE_NAME}_USE_QT)
159 SET(USE_QT4 ON CACHE BOOL "Use QT" FORCE)
160 SET(${BBTK_PACKAGE_NAME}_LIBS
161 ${${BBTK_PACKAGE_NAME}_LIBS}
164 ENDIF(${BBTK_PACKAGE_NAME}_USE_QT)
168 IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
169 SET(USE_GDCM ON CACHE BOOL "Use GDCM" )
170 SET(USE_GDCM2 OFF CACHE BOOL "Use GDCM2" )
171 SET(USE_GDCM_VTK ON CACHE BOOL "Use GDCM_VTK" FORCE)
172 SET(${BBTK_PACKAGE_NAME}_LIBS
173 ${${BBTK_PACKAGE_NAME}_LIBS}
179 message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
182 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM)
186 IF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
187 SET(USE_GDCM2 ON CACHE BOOL "Use GDCM2" FORCE)
188 SET(USE_GDCM2_VTK ON CACHE BOOL "Use GDCM2_VTK" FORCE)
189 #For some reasons GDCM_LIBRARY is not defined for gdcm2 in windows
191 SET(${BBTK_PACKAGE_NAME}_LIBS
192 ${${BBTK_PACKAGE_NAME}_LIBS}
193 vtkgdcm gdcmIOD gdcmMSFF gdcmexpat gdcmCommon gdcmMEXD gdcmDSED gdcmDICT
194 gdcmjpeg8 gdcmjpeg12 gdcmjpeg16 socketxx gdcmopenjpeg gdcmcharls
197 SET(${BBTK_PACKAGE_NAME}_LIBS
198 ${${BBTK_PACKAGE_NAME}_LIBS}
205 message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
208 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
212 IF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
213 SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE)
214 SET(${BBTK_PACKAGE_NAME}_LIBS
215 ${${BBTK_PACKAGE_NAME}_LIBS}
218 ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
220 IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
221 IF(BBTK_CORE_PACKAGE)
222 SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
223 MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}")
224 # bbtk already links against wx ...
226 SET(${BBTK_PACKAGE_NAME}_LIBS
227 ${${BBTK_PACKAGE_NAME}_LIBS}
228 ${WXWIDGETS_LIBRARIES}
231 ELSE(BBTK_CORE_PACKAGE)
232 # If linking against a non-wx bbtk : problem
233 IF(NOT BBTK_BUILT_WITH_WX)
234 MESSAGE(FATAL_ERROR "The bbtk package ${BBTK_PACKAGE_NAME} needs wxWidgets however the bbtk library which was found on your system was not compiled with wxWidgets : recompile it and rebuild the package.")
235 ELSE(NOT BBTK_BUILT_WITH_WX)
236 SET(USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
237 # bbtk already links against wx ...
239 SET(${BBTK_PACKAGE_NAME}_LIBS
240 ${${BBTK_PACKAGE_NAME}_LIBS}
241 ${WXWIDGETS_LIBRARIES}
244 ENDIF(NOT BBTK_BUILT_WITH_WX)
245 ENDIF(BBTK_CORE_PACKAGE)
246 ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
249 #---------------------------------------------------------------------------
252 MESSAGE(STATUS "=======================================")
253 MESSAGE(STATUS "${BBTK_PACKAGE_NAME} link libraries:")
254 MESSAGE(STATUS "${${BBTK_PACKAGE_NAME}_LIBS}")
255 MESSAGE(STATUS "=======================================")
258 #---------------------------------------------------------------------------
259 # Recurse into ADD_SUBDIRECTORY
260 ADD_SUBDIRECTORY(src)
261 ADD_SUBDIRECTORY(doc)
262 ADD_SUBDIRECTORY(bbs)
263 ADD_SUBDIRECTORY(data)
264 #---------------------------------------------------------------------------
266 MESSAGE(STATUS "=======================================")
269 #-----------------------------------------------------------------------------
271 #-----------------------------------------------------------------------------