-#===========================================================================
-# If the package is not a "core" bbtk package (included into the toolkit)
-# then we have to find (and use) bbtk
-IF(NOT BBTK_CORE_PACKAGE)
- #-------------------------------------------------------------------------
- # Find and use the Black Box Toolkit
- # Search BBTK
- FIND_PACKAGE(BBTK)
- # If bbtk found
- IF(BBTK_FOUND)
- INCLUDE(${BBTK_USE_FILE})
- SET(BBTK_PACKAGE_LIBS
- ${BBTK_PACKAGE_LIBS}
- ${BBTK_LIBRARIES})
- MARK_AS_ADVANCED(BBTK_DIR)
- ENDIF(BBTK_FOUND)
- #-------------------------------------------------------------------------
-ENDIF(NOT BBTK_CORE_PACKAGE)
-#===========================================================================
+#-----------------------------------------------------------------------------
+# DOES THE USER WANT TO BUILD THE PACKAGE ?
+OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}
+ "Build the bbtk package ${BBTK_PACKAGE_NAME} ?" OFF)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+IF(BBTK_CORE_PACKAGE)
+ IF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
+ SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
+ ENDIF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
+ENDIF(BBTK_CORE_PACKAGE)
+#-----------------------------------------------------------------------------
-#===========================================================================
-# Include package configuration cmake script from bbtk dir
-INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
-#===========================================================================
+#-----------------------------------------------------------------------------
+# IF THE USER HAS CHOSEN TO BUILD THE PACKAGE
+IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
+ #---------------------------------------------------------------------------
+
+ #===========================================================================
+ # If the package is not a "core" bbtk package (included into the toolkit)
+ # then we have to find (and use) bbtk
+ IF(NOT BBTK_CORE_PACKAGE)
+ #-------------------------------------------------------------------------
+ # Find and use the Black Box Toolkit
+ # Search BBTK
+ FIND_PACKAGE(BBTK)
+ # If bbtk found
+ IF(BBTK_FOUND)
+ INCLUDE(${BBTK_USE_FILE})
+ SET(BBTK_PACKAGE_LIBS
+ ${BBTK_PACKAGE_LIBS}
+ ${BBTK_LIBRARIES})
+ MARK_AS_ADVANCED(BBTK_DIR)
+ ENDIF(BBTK_FOUND)
+ ENDIF(NOT BBTK_CORE_PACKAGE)
+
+ #===========================================================================
+ # Include package configuration cmake script from bbtk dir
+ INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
+ #===========================================================================
+
+
+ #---------------------------------------------------------------------------
+ELSE(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
+ #-------------------------------------------------------------------------
+
+ #-----------------------------------------------------------------------
+ IF(BBTK_CORE_PACKAGE)
+ #-----------------------------------------------------------------------
+ # If package deps in global deps : reset global deps
+ IF(${BBTK_PACKAGE_NAME}_IN_DEPS)
+ SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL
+ "bbtk packages dependencies" FORCE)
+ # STRING(REPLACE "${${BBTK_PACKAGE_NAME}_DEPS};"
+ # "" TEMP
+ # ${BBTK_PACKAGES_DEPS})
+ #
+ # SET(BBTK_PACKAGES_DEPS ${TEMP}
+ # CACHE INTERNAL "bbtk packages dependencies" FORCE)
+ ENDIF(${BBTK_PACKAGE_NAME}_IN_DEPS)
+ #-----------------------------------------------------------------------
+
+ #-----------------------------------------------------------------------
+ # Remove the package include scripts to avoid loading it by include *
+ FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbs)
+ FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbs)
+ #-----------------------------------------------------------------------
+ ENDIF(BBTK_CORE_PACKAGE)
+
+ #-------------------------------------------------------------------------
+ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
# for which the macro SWITCH_ON_IF_BUILD_ALL have been used are set to ON
# The -- prepended to the options ensure that it will appear as the
# first option when running ccmake/CMakeSetup
-OPTION(--BUILD_ALL "Build all ?" ON)
-#OPTION(--SET_BUILD_ALL_OFF "Build all ?" OFF)
-#MARK_AS_ADVANCED(--SET_BUILD_ALL_OFF)
+IF (BBTK_CORE_PACKAGE)
+ OPTION(--BUILD_ALL "Build all ?" ON)
+ #OPTION(--SET_BUILD_ALL_OFF "Build all ?" OFF)
+ #MARK_AS_ADVANCED(--SET_BUILD_ALL_OFF)
-MACRO(SWITCH_ON_IF_BUILD_ALL VAR)
-#OPTION(--${VAR}_SET_BUILD_ALL_OFF "Build all ?" OFF)
-#MARK_AS_ADVANCED(--${VAR}_SET_BUILD_ALL_OFF)
-IF (--BUILD_ALL)
-# IF (--${VAR}_SET_BUILD_ALL_OFF)
-# MESSAGE(ERROR "${VAR} -> Build All OFF")
-# SET(--BUILD_ALL OFF CACHE BOOL "Build all ?" FORCE)
-# SET(--${VAR}_SET_BUILD_ALL_OFF OFF CACHE BOOL "" FORCE)
-# ELSE (--${VAR}_SET_BUILD_ALL_OFF)
- SET(${VAR} ON CACHE BOOL "Forced to ON by --BUILD_ALL" FORCE)
-# SET(--${VAR}_SET_BUILD_ALL_OFF ON CACHE BOOL "" FORCE)
-# MESSAGE(ERROR "Build All -> ${VAR}")
-# ENDIF (--${VAR}_SET_BUILD_ALL_OFF)
-ENDIF(--BUILD_ALL)
-ENDMACRO(SWITCH_ON_IF_BUILD_ALL)
+ MACRO(SWITCH_ON_IF_BUILD_ALL VAR)
+ #OPTION(--${VAR}_SET_BUILD_ALL_OFF "Build all ?" OFF)
+ #MARK_AS_ADVANCED(--${VAR}_SET_BUILD_ALL_OFF)
+ IF (--BUILD_ALL)
+ # IF (--${VAR}_SET_BUILD_ALL_OFF)
+ # MESSAGE(ERROR "${VAR} -> Build All OFF")
+ # SET(--BUILD_ALL OFF CACHE BOOL "Build all ?" FORCE)
+ # SET(--${VAR}_SET_BUILD_ALL_OFF OFF CACHE BOOL "" FORCE)
+ # ELSE (--${VAR}_SET_BUILD_ALL_OFF)
+ SET(${VAR} ON CACHE BOOL "Forced to ON by --BUILD_ALL" FORCE)
+ # SET(--${VAR}_SET_BUILD_ALL_OFF ON CACHE BOOL "" FORCE)
+ # MESSAGE(ERROR "Build All -> ${VAR}")
+ # ENDIF (--${VAR}_SET_BUILD_ALL_OFF)
+ ENDIF(--BUILD_ALL)
+ ENDMACRO(SWITCH_ON_IF_BUILD_ALL)
+ELSE (BBTK_CORE_PACKAGE)
+ MACRO(SWITCH_ON_IF_BUILD_ALL VAR)
+ ENDMACRO(SWITCH_ON_IF_BUILD_ALL)
+ENDIF (BBTK_CORE_PACKAGE)
#-----------------------------------------------------------------------------
+
+
#---------------------------------------------------------------------------
-# If not a core package must include necessary cmake scripts
IF(NOT BBTK_CORE_PACKAGE)
- #
+ #-------------------------------------------------------------------------
+ # If not a core package must include necessary cmake scripts
INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackagePaths.cmake)
INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildAllOption.cmake)
-# INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
+ # INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake)
#-------------------------------------------------------------------------
# Configure bbtk_config_build.xml.in for bbi to find the bbs
ENDIF(NOT BBTK_CORE_PACKAGE)
#---------------------------------------------------------------------------
+
+#---------------------------------------------------------------------------
+SET(${BBTK_PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+#---------------------------------------------------------------------------
+
#----------------------------------------------------------------------------
# USER DEFINED ADDITIONAL INCLUDE DIRS
INCLUDE_DIRECTORIES(${${BBTK_PACKAGE_NAME}_INCLUDE_DIRS})
#----------------------------------------------------------------------------
-#-----------------------------------------------------------------------------
-SET(${BBTK_PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# DOES THE USER WANT TO BUILD THE PACKAGE ?
-OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}
- "Build the bbtk package ${BBTK_PACKAGE_NAME} ?" OFF)
-IF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
- SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
-ENDIF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
+#---------------------------------------------------------------------------
# Package dependencies
SET(${BBTK_PACKAGE_NAME}_DEPS bb${BBTK_PACKAGE_NAME})
STRING(REGEX MATCH "${${BBTK_PACKAGE_NAME}_DEPS}"
${BBTK_PACKAGE_NAME}_IN_DEPS
"${BBTK_PACKAGES_DEPS}")
-#-----------------------------------------------------------------------------
+#---------------------------------------------------------------------------
#SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL "bbtk packages dependencies" FORCE)
-#-----------------------------------------------------------------------------
-# IF THE USER HAS CHOSEN TO BUILD THE PACKAGE
-IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- #---------------------------------------------------------------------------
-
-
- #----------------------------------------------------------------------------
- # VARS CONFIGURED IN bbPackage.h AND IN doc/bbdoc/header.html.in
- SET(BBTK_PACKAGE_AUTHOR "${${BBTK_PACKAGE_NAME}_AUTHOR}")
- SET(BBTK_PACKAGE_DESCRIPTION "${${BBTK_PACKAGE_NAME}_DESCRIPTION}")
- SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
- SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
- SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
- SET(BBTK_PACKAGE_VERSION
- "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
- #----------------------------------------------------------------------------
-
-
- #---------------------------------------------------------------------------
- # If package deps not in global deps : add them
- IF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
- SET(BBTK_PACKAGES_DEPS "${${BBTK_PACKAGE_NAME}_DEPS};${BBTK_PACKAGES_DEPS}"
- CACHE INTERNAL "bbtk packages dependencies" FORCE)
- # MESSAGE(STATUS "Packages=${BBTK_PACKAGES_DEPS}")
- ENDIF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
- #---------------------------------------------------------------------------
-
- #---------------------------------------------------------------------------
- # Package dependencies
- IF(${BBTK_PACKAGE_NAME}_USE_VTK)
- SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
- SET(${BBTK_PACKAGE_NAME}_LIBS
- ${${BBTK_PACKAGE_NAME}_LIBS}
- ${BBTK_VTK_LIBRARIES}
- )
- ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
-
- IF(${BBTK_PACKAGE_NAME}_USE_ITK)
- SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE)
- SET(${BBTK_PACKAGE_NAME}_LIBS
- ${${BBTK_PACKAGE_NAME}_LIBS}
- ${BBTK_ITK_LIBRARIES}
- )
- ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
-
- IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
- SET(USE_GDCM ON CACHE BOOL "Use GDCM" FORCE)
- SET(${BBTK_PACKAGE_NAME}_LIBS
- ${${BBTK_PACKAGE_NAME}_LIBS}
- ${BBTK_GDCM_LIBRARIES}
- )
- ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM)
-
- IF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
- SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE)
- SET(${BBTK_PACKAGE_NAME}_LIBS
- ${${BBTK_PACKAGE_NAME}_LIBS}
- ${BBTK_GSMIS_LIBRARIES}
- )
- ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
-
- IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
- IF(BBTK_CORE_PACKAGE)
- SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
- MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}")
+
+
+#----------------------------------------------------------------------------
+# VARS CONFIGURED IN bbPackage.h AND IN doc/bbdoc/header.html.in
+SET(BBTK_PACKAGE_AUTHOR "${${BBTK_PACKAGE_NAME}_AUTHOR}")
+SET(BBTK_PACKAGE_DESCRIPTION "${${BBTK_PACKAGE_NAME}_DESCRIPTION}")
+SET(BBTK_PACKAGE_MAJOR_VERSION ${${BBTK_PACKAGE_NAME}_MAJOR_VERSION})
+SET(BBTK_PACKAGE_MINOR_VERSION ${${BBTK_PACKAGE_NAME}_MINOR_VERSION})
+SET(BBTK_PACKAGE_BUILD_VERSION ${${BBTK_PACKAGE_NAME}_BUILD_VERSION})
+SET(BBTK_PACKAGE_VERSION
+ "\"${${BBTK_PACKAGE_NAME}_MAJOR_VERSION}.${${BBTK_PACKAGE_NAME}_MINOR_VERSION}.${${BBTK_PACKAGE_NAME}_BUILD_VERSION}\"")
+#----------------------------------------------------------------------------
+
+
+#---------------------------------------------------------------------------
+# If package deps not in global deps : add them
+IF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
+ SET(BBTK_PACKAGES_DEPS "${${BBTK_PACKAGE_NAME}_DEPS};${BBTK_PACKAGES_DEPS}"
+ CACHE INTERNAL "bbtk packages dependencies" FORCE)
+ # MESSAGE(STATUS "Packages=${BBTK_PACKAGES_DEPS}")
+ENDIF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
+#---------------------------------------------------------------------------
+
+#---------------------------------------------------------------------------
+# Package dependencies
+IF(${BBTK_PACKAGE_NAME}_USE_VTK)
+ SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ ${BBTK_VTK_LIBRARIES}
+ )
+ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
+
+IF(${BBTK_PACKAGE_NAME}_USE_ITK)
+ SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ ${BBTK_ITK_LIBRARIES}
+ )
+ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
+
+IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
+ SET(USE_GDCM ON CACHE BOOL "Use GDCM" FORCE)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ ${BBTK_GDCM_LIBRARIES}
+ )
+ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM)
+
+IF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
+ SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ ${BBTK_GSMIS_LIBRARIES}
+ )
+ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
+
+IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
+ IF(BBTK_CORE_PACKAGE)
+ SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
+ MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}")
+ # bbtk already links against wx ...
+ IF(WIN32)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ ${BBTK_WXWIDGETS_LIBRARIES}
+ )
+ ENDIF(WIN32)
+ ELSE(BBTK_CORE_PACKAGE)
+ # If linking against a non-wx bbtk : problem
+ IF(NOT BBTK_BUILT_WITH_WX)
+ 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.")
+ ELSE(NOT BBTK_BUILT_WITH_WX)
+ SET(USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
# bbtk already links against wx ...
IF(WIN32)
- SET(${BBTK_PACKAGE_NAME}_LIBS
- ${${BBTK_PACKAGE_NAME}_LIBS}
- ${BBTK_WXWIDGETS_LIBRARIES}
- )
- ENDIF(WIN32)
- ELSE(BBTK_CORE_PACKAGE)
- # If linking against a non-wx bbtk : problem
- IF(NOT BBTK_BUILT_WITH_WX)
- 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.")
- ELSE(NOT BBTK_BUILT_WITH_WX)
- SET(USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE)
-# bbtk already links against wx ...
- IF(WIN32)
- SET(${BBTK_PACKAGE_NAME}_LIBS
- ${${BBTK_PACKAGE_NAME}_LIBS}
- ${BBTK_WXWIDGETS_LIBRARIES}
- )
- ENDIF(WIN32)
- ENDIF(NOT BBTK_BUILT_WITH_WX)
- ENDIF(BBTK_CORE_PACKAGE)
- ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
-
-
- #---------------------------------------------------------------------------
-
-
-
- #---------------------------------------------------------------------------
- # Recurse into subdirs
- SUBDIRS(src)
- SUBDIRS(doc)
- SUBDIRS(bbs)
- SUBDIRS(data)
- #---------------------------------------------------------------------------
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ ${BBTK_WXWIDGETS_LIBRARIES}
+ )
+ ENDIF(WIN32)
+ ENDIF(NOT BBTK_BUILT_WITH_WX)
+ ENDIF(BBTK_CORE_PACKAGE)
+ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
+
#---------------------------------------------------------------------------
-ELSE(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- #-------------------------------------------------------------------------
-
- #-----------------------------------------------------------------------
- # If package deps in global deps : reset global deps
- IF(${BBTK_PACKAGE_NAME}_IN_DEPS)
- SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL
- "bbtk packages dependencies" FORCE)
-# STRING(REPLACE "${${BBTK_PACKAGE_NAME}_DEPS};"
-# "" TEMP
-# ${BBTK_PACKAGES_DEPS})
-#
-# SET(BBTK_PACKAGES_DEPS ${TEMP}
-# CACHE INTERNAL "bbtk packages dependencies" FORCE)
- ENDIF(${BBTK_PACKAGE_NAME}_IN_DEPS)
- #-----------------------------------------------------------------------
-
- #-----------------------------------------------------------------------
- # Remove the package include scripts to avoid loading it by include *
- FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbs)
- FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbs)
- #-----------------------------------------------------------------------
-
+
+
+#---------------------------------------------------------------------------
+# Recurse into subdirs
+SUBDIRS(src)
+SUBDIRS(doc)
+SUBDIRS(bbs)
+SUBDIRS(data)
#---------------------------------------------------------------------------
-ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
+
+
#-----------------------------------------------------------------------------
# EOF
#-----------------------------------------------------------------------------