1 # ==================================
3 # ==================================
5 # This file is a copy of BBTKConfigurePackage.cmake
7 # Only ONE commented out line differs
9 # In case of modification, mind to modify BBTKConfigurePackage.cmake as well!
13 MESSAGE(STATUS "=======================================")
14 MESSAGE(STATUS "CONFIGURING BBTK PACKAGE ${BBTK_PACKAGE_NAME}")
16 #---------------------------------------------------------------------------
17 SET(${BBTK_PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
18 #---------------------------------------------------------------------------
20 #---------------------------------------------------------------------------
21 IF(NOT BBTK_CORE_PACKAGE)
22 #---------------------------------------------------------------------------
26 MARK_AS_ADVANCED(BBTK_DIR)
27 #-------------------------------------------------------------------------
28 # If not a core package must include necessary cmake scripts
29 INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackagePaths.cmake)
30 INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildAllOption.cmake)
31 # INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
33 # ==================================
35 # ==================================
37 # Hereafter is commented out line :
39 #INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake) # JPR
41 #-------------------------------------------------------------------------
42 # Configure bbtk_config_build.xml.in for bbi to find the bbs
43 INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigureBbtkConfigXmlForBuildTree.cmake)
44 #-------------------------------------------------------------------------
46 # FOR THE MOMENT ONLY ONE BBTK PACKAGE PER PROJECT ALLOWED!!!
48 SET(${BBTK_PACKAGE_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
49 # ${CMAKE_CURRENT_BINARY_DIR})
50 #-------------------------------------------------------------------------
51 #---------------------------------------------------------------------------
52 # CREATES THE bbtkPackage TEXT FILE
54 ${BBTK_CMAKE_DIR}/bbtkPackage.in
55 ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
59 INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
62 #---------------------------------------------------------------------------
63 ELSE(NOT BBTK_CORE_PACKAGE)
64 SET(${BBTK_PACKAGE_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR})
65 ENDIF(NOT BBTK_CORE_PACKAGE)
66 #---------------------------------------------------------------------------
72 #----------------------------------------------------------------------------
73 # USER DEFINED ADDITIONAL INCLUDE DIRS
74 INCLUDE_DIRECTORIES(${${BBTK_PACKAGE_NAME}_INCLUDE_DIRS})
75 #----------------------------------------------------------------------------
78 #---------------------------------------------------------------------------
79 # Package dependencies
80 SET(${BBTK_PACKAGE_NAME}_DEPS bb${BBTK_PACKAGE_NAME})
81 STRING(REGEX MATCH "${${BBTK_PACKAGE_NAME}_DEPS}"
82 ${BBTK_PACKAGE_NAME}_IN_DEPS
83 "${BBTK_PACKAGES_DEPS}")
84 #---------------------------------------------------------------------------
85 #SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL "bbtk packages dependencies" FORCE)
89 #----------------------------------------------------------------------------
90 # VARS CONFIGURED IN bbPackage.h AND IN doc/bbdoc/header.html.in
91 SET(BBTK_PACKAGE_AUTHOR "${${BBTK_PACKAGE_NAME}_AUTHOR}")
92 SET(BBTK_PACKAGE_DESCRIPTION "${${BBTK_PACKAGE_NAME}_DESCRIPTION}")
93 SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
94 SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
95 SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
96 SET(BBTK_PACKAGE_VERSION
97 "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
98 #----------------------------------------------------------------------------
101 #---------------------------------------------------------------------------
102 # If package deps not in global deps : add them
103 IF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
104 SET(BBTK_PACKAGES_DEPS "${${BBTK_PACKAGE_NAME}_DEPS};${BBTK_PACKAGES_DEPS}"
105 CACHE INTERNAL "bbtk packages dependencies" FORCE)
106 # MESSAGE(STATUS "Packages=${BBTK_PACKAGES_DEPS}")
107 ENDIF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
108 #---------------------------------------------------------------------------
110 #---------------------------------------------------------------------------
111 # Package dependencies
112 IF(${BBTK_PACKAGE_NAME}_USE_VTK)
113 SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
114 SET(${BBTK_PACKAGE_NAME}_LIBS
115 ${${BBTK_PACKAGE_NAME}_LIBS}
118 ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
120 IF(${BBTK_PACKAGE_NAME}_USE_ITK)
121 SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE)
122 SET(${BBTK_PACKAGE_NAME}_LIBS
123 ${${BBTK_PACKAGE_NAME}_LIBS}
126 ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
128 IF(${BBTK_PACKAGE_NAME}_USE_QT)
129 SET(USE_QT4 ON CACHE BOOL "Use QT" FORCE)
130 SET(${BBTK_PACKAGE_NAME}_LIBS
131 ${${BBTK_PACKAGE_NAME}_LIBS}
134 ENDIF(${BBTK_PACKAGE_NAME}_USE_QT)
138 IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
139 SET(USE_GDCM ON CACHE BOOL "Use GDCM" )
140 SET(USE_GDCM2 OFF CACHE BOOL "Use GDCM2" )
141 SET(USE_GDCM_VTK ON CACHE BOOL "Use GDCM_VTK" FORCE)
142 SET(${BBTK_PACKAGE_NAME}_LIBS
143 ${${BBTK_PACKAGE_NAME}_LIBS}
148 message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
151 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM)
155 IF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
156 SET(USE_GDCM2 ON CACHE BOOL "Use GDCM2" FORCE)
157 SET(USE_GDCM2_VTK ON CACHE BOOL "Use GDCM2_VTK" FORCE)
158 SET(${BBTK_PACKAGE_NAME}_LIBS
159 ${${BBTK_PACKAGE_NAME}_LIBS}
164 message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
167 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
171 IF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
172 SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE)
173 SET(${BBTK_PACKAGE_NAME}_LIBS
174 ${${BBTK_PACKAGE_NAME}_LIBS}
177 ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
179 IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
180 IF(BBTK_CORE_PACKAGE)
181 SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
182 MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}")
183 # bbtk already links against wx ...
185 SET(${BBTK_PACKAGE_NAME}_LIBS
186 ${${BBTK_PACKAGE_NAME}_LIBS}
187 ${WXWIDGETS_LIBRARIES}
190 ELSE(BBTK_CORE_PACKAGE)
191 # If linking against a non-wx bbtk : problem
192 IF(NOT BBTK_BUILT_WITH_WX)
193 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.")
194 ELSE(NOT BBTK_BUILT_WITH_WX)
195 SET(USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
196 # bbtk already links against wx ...
198 SET(${BBTK_PACKAGE_NAME}_LIBS
199 ${${BBTK_PACKAGE_NAME}_LIBS}
200 ${WXWIDGETS_LIBRARIES}
203 ENDIF(NOT BBTK_BUILT_WITH_WX)
204 ENDIF(BBTK_CORE_PACKAGE)
205 ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
208 #---------------------------------------------------------------------------
211 MESSAGE(STATUS "=======================================")
212 MESSAGE(STATUS "${BBTK_PACKAGE_NAME} link libraries:")
213 MESSAGE(STATUS "${${BBTK_PACKAGE_NAME}_LIBS}")
214 MESSAGE(STATUS "=======================================")
217 #---------------------------------------------------------------------------
218 # Recurse into ADD_SUBDIRECTORY
219 ADD_SUBDIRECTORY(src)
220 ADD_SUBDIRECTORY(doc)
221 ADD_SUBDIRECTORY(bbs)
222 ADD_SUBDIRECTORY(data)
223 #---------------------------------------------------------------------------
225 MESSAGE(STATUS "=======================================")
228 #-----------------------------------------------------------------------------
230 #-----------------------------------------------------------------------------