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 a copy of BBTKConfigurePackage.cmake
33 # Only ONE commented out line differs
35 # In case of modification, mind to modify BBTKConfigurePackage.cmake as well!
39 MESSAGE(STATUS "=======================================")
40 MESSAGE(STATUS "CONFIGURING BBTK PACKAGE ${BBTK_PACKAGE_NAME}")
42 #---------------------------------------------------------------------------
43 SET(${BBTK_PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
44 #---------------------------------------------------------------------------
46 #---------------------------------------------------------------------------
47 IF(NOT BBTK_CORE_PACKAGE)
48 #---------------------------------------------------------------------------
52 MARK_AS_ADVANCED(BBTK_DIR)
53 #-------------------------------------------------------------------------
54 # If not a core package must include necessary cmake scripts
55 INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackagePaths.cmake)
56 INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildAllOption.cmake)
57 # INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
59 # ==================================
61 # ==================================
63 # Hereafter is commented out line :
65 #INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake) # JPR
67 #-------------------------------------------------------------------------
68 # Configure bbtk_config_build.xml.in for bbi to find the bbs
69 INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigureBbtkConfigXmlForBuildTree.cmake)
70 #-------------------------------------------------------------------------
72 # FOR THE MOMENT ONLY ONE BBTK PACKAGE PER PROJECT ALLOWED!!!
74 SET(${BBTK_PACKAGE_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
75 # ${CMAKE_CURRENT_BINARY_DIR})
76 #-------------------------------------------------------------------------
77 #---------------------------------------------------------------------------
78 # CREATES THE bbtkPackage TEXT FILE
80 ${BBTK_CMAKE_DIR}/bbtkPackage.in
81 ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
85 INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
88 #---------------------------------------------------------------------------
89 ELSE(NOT BBTK_CORE_PACKAGE)
90 SET(${BBTK_PACKAGE_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
91 ENDIF(NOT BBTK_CORE_PACKAGE)
92 #---------------------------------------------------------------------------
98 #----------------------------------------------------------------------------
99 # USER DEFINED ADDITIONAL INCLUDE DIRS
100 INCLUDE_DIRECTORIES(${${BBTK_PACKAGE_NAME}_INCLUDE_DIRS})
101 #----------------------------------------------------------------------------
104 #---------------------------------------------------------------------------
105 # Package dependencies
106 SET(${BBTK_PACKAGE_NAME}_DEPS bb${BBTK_PACKAGE_NAME})
107 STRING(REGEX MATCH "${${BBTK_PACKAGE_NAME}_DEPS}"
108 ${BBTK_PACKAGE_NAME}_IN_DEPS
109 "${BBTK_PACKAGES_DEPS}")
110 #---------------------------------------------------------------------------
111 #SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL "bbtk packages dependencies" FORCE)
115 #----------------------------------------------------------------------------
116 # VARS CONFIGURED IN bbPackage.h AND IN doc/bbdoc/header.html.in
117 SET(BBTK_PACKAGE_AUTHOR "${${BBTK_PACKAGE_NAME}_AUTHOR}")
118 SET(BBTK_PACKAGE_DESCRIPTION "${${BBTK_PACKAGE_NAME}_DESCRIPTION}")
119 SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
120 SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
121 SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
122 SET(BBTK_PACKAGE_VERSION
123 "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
124 #----------------------------------------------------------------------------
127 #---------------------------------------------------------------------------
128 # If package deps not in global deps : add them
129 IF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
130 SET(BBTK_PACKAGES_DEPS "${${BBTK_PACKAGE_NAME}_DEPS};${BBTK_PACKAGES_DEPS}"
131 CACHE INTERNAL "bbtk packages dependencies" FORCE)
132 # MESSAGE(STATUS "Packages=${BBTK_PACKAGES_DEPS}")
133 ENDIF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
134 #---------------------------------------------------------------------------
136 #---------------------------------------------------------------------------
137 # Package dependencies
138 IF(${BBTK_PACKAGE_NAME}_USE_VTK)
139 SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
140 SET(${BBTK_PACKAGE_NAME}_LIBS
141 ${${BBTK_PACKAGE_NAME}_LIBS}
144 ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
146 IF(${BBTK_PACKAGE_NAME}_USE_ITK)
147 SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE)
148 SET(${BBTK_PACKAGE_NAME}_LIBS
149 ${${BBTK_PACKAGE_NAME}_LIBS}
152 ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
154 IF(${BBTK_PACKAGE_NAME}_USE_QT)
155 SET(USE_QT4 ON CACHE BOOL "Use QT" FORCE)
156 SET(${BBTK_PACKAGE_NAME}_LIBS
157 ${${BBTK_PACKAGE_NAME}_LIBS}
160 ENDIF(${BBTK_PACKAGE_NAME}_USE_QT)
164 IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
165 SET(USE_GDCM ON CACHE BOOL "Use GDCM" )
166 SET(USE_GDCM2 OFF CACHE BOOL "Use GDCM2" )
167 SET(USE_GDCM_VTK ON CACHE BOOL "Use GDCM_VTK" FORCE)
168 SET(${BBTK_PACKAGE_NAME}_LIBS
169 ${${BBTK_PACKAGE_NAME}_LIBS}
174 message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
177 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM)
181 IF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
182 SET(USE_GDCM2 ON CACHE BOOL "Use GDCM2" FORCE)
183 SET(USE_GDCM2_VTK ON CACHE BOOL "Use GDCM2_VTK" FORCE)
184 SET(${BBTK_PACKAGE_NAME}_LIBS
185 ${${BBTK_PACKAGE_NAME}_LIBS}
190 message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
193 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
197 IF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
198 SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE)
199 SET(${BBTK_PACKAGE_NAME}_LIBS
200 ${${BBTK_PACKAGE_NAME}_LIBS}
203 ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
205 IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
206 IF(BBTK_CORE_PACKAGE)
207 SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
208 MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}")
209 # bbtk already links against wx ...
211 SET(${BBTK_PACKAGE_NAME}_LIBS
212 ${${BBTK_PACKAGE_NAME}_LIBS}
213 ${WXWIDGETS_LIBRARIES}
216 ELSE(BBTK_CORE_PACKAGE)
217 # If linking against a non-wx bbtk : problem
218 IF(NOT BBTK_BUILT_WITH_WX)
219 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.")
220 ELSE(NOT BBTK_BUILT_WITH_WX)
221 SET(USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
222 # bbtk already links against wx ...
224 SET(${BBTK_PACKAGE_NAME}_LIBS
225 ${${BBTK_PACKAGE_NAME}_LIBS}
226 ${WXWIDGETS_LIBRARIES}
229 ENDIF(NOT BBTK_BUILT_WITH_WX)
230 ENDIF(BBTK_CORE_PACKAGE)
231 ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
234 #---------------------------------------------------------------------------
237 MESSAGE(STATUS "=======================================")
238 MESSAGE(STATUS "${BBTK_PACKAGE_NAME} link libraries:")
239 MESSAGE(STATUS "${${BBTK_PACKAGE_NAME}_LIBS}")
240 MESSAGE(STATUS "=======================================")
243 #---------------------------------------------------------------------------
244 # Recurse into ADD_SUBDIRECTORY
245 ADD_SUBDIRECTORY(src)
246 ADD_SUBDIRECTORY(doc)
247 ADD_SUBDIRECTORY(bbs)
248 ADD_SUBDIRECTORY(data)
249 #---------------------------------------------------------------------------
251 MESSAGE(STATUS "=======================================")
254 #-----------------------------------------------------------------------------
256 #-----------------------------------------------------------------------------