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
86 ${BBTK_CMAKE_DIR}/PlugPackage.bat.in
87 ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat
90 INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage DESTINATION "." )
91 INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat DESTINATION "." )
93 #---------------------------------------------------------------------------
94 ELSE(NOT BBTK_CORE_PACKAGE)
95 SET(${BBTK_PACKAGE_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
96 ENDIF(NOT BBTK_CORE_PACKAGE)
97 #---------------------------------------------------------------------------
103 #----------------------------------------------------------------------------
104 # USER DEFINED ADDITIONAL INCLUDE DIRS
105 INCLUDE_DIRECTORIES(${${BBTK_PACKAGE_NAME}_INCLUDE_DIRS})
106 #----------------------------------------------------------------------------
109 #---------------------------------------------------------------------------
110 # Package dependencies
111 SET(${BBTK_PACKAGE_NAME}_DEPS bb${BBTK_PACKAGE_NAME})
112 STRING(REGEX MATCH "${${BBTK_PACKAGE_NAME}_DEPS}"
113 ${BBTK_PACKAGE_NAME}_IN_DEPS
114 "${BBTK_PACKAGES_DEPS}")
115 #---------------------------------------------------------------------------
116 #SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL "bbtk packages dependencies" FORCE)
120 #----------------------------------------------------------------------------
121 # VARS CONFIGURED IN bbPackage.h AND IN doc/bbdoc/header.html.in
122 SET(BBTK_PACKAGE_AUTHOR "${${BBTK_PACKAGE_NAME}_AUTHOR}")
123 SET(BBTK_PACKAGE_DESCRIPTION "${${BBTK_PACKAGE_NAME}_DESCRIPTION}")
124 SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
125 SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
126 SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
127 SET(BBTK_PACKAGE_VERSION
128 "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
129 #----------------------------------------------------------------------------
132 #---------------------------------------------------------------------------
133 # If package deps not in global deps : add them
134 IF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
135 SET(BBTK_PACKAGES_DEPS "${${BBTK_PACKAGE_NAME}_DEPS};${BBTK_PACKAGES_DEPS}"
136 CACHE INTERNAL "bbtk packages dependencies" FORCE)
137 # MESSAGE(STATUS "Packages=${BBTK_PACKAGES_DEPS}")
138 ENDIF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
139 #---------------------------------------------------------------------------
141 #---------------------------------------------------------------------------
142 # Package dependencies
143 IF(${BBTK_PACKAGE_NAME}_USE_VTK)
144 SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
145 SET(${BBTK_PACKAGE_NAME}_LIBS
146 ${${BBTK_PACKAGE_NAME}_LIBS}
149 ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
151 IF(${BBTK_PACKAGE_NAME}_USE_ITK)
152 SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE)
153 SET(${BBTK_PACKAGE_NAME}_LIBS
154 ${${BBTK_PACKAGE_NAME}_LIBS}
157 ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
159 IF(${BBTK_PACKAGE_NAME}_USE_QT)
160 SET(USE_QT4 ON CACHE BOOL "Use QT" FORCE)
161 SET(${BBTK_PACKAGE_NAME}_LIBS
162 ${${BBTK_PACKAGE_NAME}_LIBS}
165 ENDIF(${BBTK_PACKAGE_NAME}_USE_QT)
169 IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
170 SET(USE_GDCM ON CACHE BOOL "Use GDCM" )
171 SET(USE_GDCM2 OFF CACHE BOOL "Use GDCM2" )
172 SET(USE_GDCM_VTK ON CACHE BOOL "Use GDCM_VTK" FORCE)
173 SET(${BBTK_PACKAGE_NAME}_LIBS
174 ${${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 SET(${BBTK_PACKAGE_NAME}_LIBS
190 ${${BBTK_PACKAGE_NAME}_LIBS}
195 message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
198 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
202 IF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
203 SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE)
204 SET(${BBTK_PACKAGE_NAME}_LIBS
205 ${${BBTK_PACKAGE_NAME}_LIBS}
208 ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
210 IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
211 IF(BBTK_CORE_PACKAGE)
212 SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
213 MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}")
214 # bbtk already links against wx ...
216 SET(${BBTK_PACKAGE_NAME}_LIBS
217 ${${BBTK_PACKAGE_NAME}_LIBS}
218 ${WXWIDGETS_LIBRARIES}
221 ELSE(BBTK_CORE_PACKAGE)
222 # If linking against a non-wx bbtk : problem
223 IF(NOT BBTK_BUILT_WITH_WX)
224 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.")
225 ELSE(NOT BBTK_BUILT_WITH_WX)
226 SET(USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
227 # bbtk already links against wx ...
229 SET(${BBTK_PACKAGE_NAME}_LIBS
230 ${${BBTK_PACKAGE_NAME}_LIBS}
231 ${WXWIDGETS_LIBRARIES}
234 ENDIF(NOT BBTK_BUILT_WITH_WX)
235 ENDIF(BBTK_CORE_PACKAGE)
236 ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
239 #---------------------------------------------------------------------------
242 MESSAGE(STATUS "=======================================")
243 MESSAGE(STATUS "${BBTK_PACKAGE_NAME} link libraries:")
244 MESSAGE(STATUS "${${BBTK_PACKAGE_NAME}_LIBS}")
245 MESSAGE(STATUS "=======================================")
248 #---------------------------------------------------------------------------
249 # Recurse into ADD_SUBDIRECTORY
250 ADD_SUBDIRECTORY(src)
251 ADD_SUBDIRECTORY(doc)
252 ADD_SUBDIRECTORY(bbs)
253 ADD_SUBDIRECTORY(data)
254 #---------------------------------------------------------------------------
256 MESSAGE(STATUS "=======================================")
259 #-----------------------------------------------------------------------------
261 #-----------------------------------------------------------------------------