--- /dev/null
+
+
+#----------------------------------------------------------------------------
+IF(BBTK_PACKAGE_INCLUDE_ALL_BBS_BOXES)
+ FILE(GLOB BBTK_PACKAGE_BBS_BOXES "boxes" "*.bbs")
+ENDIF(BBTK_PACKAGE_INCLUDE_ALL_BBS_BOXES)
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+IF(BBTK_PACKAGE_INCLUDE_ALL_BBS_APPLI)
+ FILE(GLOB BBTK_PACKAGE_BBS_APPLI "appli" "*.bbs")
+ENDIF(BBTK_PACKAGE_INCLUDE_ALL_BBS_APPLI)
+#----------------------------------------------------------------------------
+
+INCLUDE(${BBTK_DIR}/BBTKCreatePackageIncludeScript.cmake)
+
+BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT(
+ "${BBTK_PACKAGE_NAME}"
+ "${BBTK_PACKAGE_BBS_BOXES}"
+ "${BBTK_PACKAGE_BBS_APPLI}"
+ )
--- /dev/null
+
+
+MACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT BBTK_PACKAGE_NAME BBTK_PACKAGE_BBS_BOXES BBTK_PACKAGE_BBS_APPLI )
+
+ SET(OUTPUT_PATH ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME})
+ SET(OUTPUT_FILE ${PROJECT_BINARY_DIR}/${OUTPUT_PATH}/${BBTK_PACKAGE_NAME}.bbs)
+
+ MESSAGE(ERROR "${BBTK_PACKAGE_BBS_BOXES} - ${BBTK_PACKAGE_BBS_APPLI}")
+
+ # Creates the file ${BBTK_PACKAGE_NAME}.bbs
+ FILE(WRITE
+ "${OUTPUT_FILE}"
+ "# Include script for bbtk package '${BBTK_PACKAGE_NAME}' - automatically generated by cmake (macro BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)\n")
+ FILE(APPEND
+ "${OUTPUT_FILE}"
+ "load ${BBTK_PACKAGE_NAME}\n"
+ "package ${BBTK_PACKAGE_NAME}\n"
+ )
+ FOREACH(bbs ${BBTK_PACKAGE_BBS_BOXES})
+ FILE(APPEND
+ "${OUTPUT_FILE}"
+ "include ${bbs}\n"
+ )
+ ENDFOREACH(bbs)
+ FOREACH(bbs ${BBTK_PACKAGE_BBS_APPLI})
+ FILE(APPEND
+ "${OUTPUT_FILE}"
+ "define ${bbs}\n"
+ "include ${bbs}\n"
+ "endefine"
+ )
+ ENDFOREACH(bbs)
+ FILE(APPEND
+ "${OUTPUT_FILE}"
+ "endpackage\n"
+ )
+
+# ADD_CUSTOM_TARGET(${BBTK_PACKAGE_NAME}.bbs ALL
+# DEPENDS ${OUTPUT_FILE}
+# )
+
+ INSTALL(
+ FILES ${OUTPUT_FILE}
+ DESTINATION ${OUTPUT_PATH}
+ )
+
+ENDMACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)
-
-#===========================================================================
-# THE NAME OF THE BBTK PACKAGE = NAME OF THE CURRENT DIRECTORY
-# GET_FILENAME_COMPONENT(BBTK_PACKAGE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
-SET(BBTK_PACKAGE_NAME wx)
-#===========================================================================
-
-#===========================================================================
-# UNCOMMENT NEXT LINE IF IT IS A STANDALONE PROJECT,
-# I.E. WHICH IS NOT INCLUDED INTO A WIDER PROJECT WHICH RECURSED INTO THIS
-# DIRECTORY BY SUBDIRS.
-# ELSE PUT A "SUBDIRS(this_directory)" COMMAND INTO ../CMakeLists.txt
-# PROJECT(${BBTK_PACKAGE_NAME})
-#===========================================================================
-
-
-#===========================================================================
-# SET(BBTK_PACKAGE_USE_VTK ON)
-# SET(BBTK_PACKAGE_USE_ITK ON)
-# SET(BBTK_PACKAGE_USE_GDCM ON)
-# SET(BBTK_PACKAGE_USE_GSMIS ON)
-SET(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS ON)
-#===========================================================================
-
-#===========================================================================
-# PACKAGE AUTHOR
-# !!! NO COMMA ALLOWED !!!
-SET(BBTK_PACKAGE_AUTHOR "eduardo.davila/laurent.guigues@creatis.insa-lyon.fr")
-#===========================================================================
-
-#===========================================================================
-# PACKAGE DESCRIPTION
-SET(BBTK_PACKAGE_DESCRIPTION "Basic graphical interface elements (sliders, buttons ...) based on wxWidgets")
#===========================================================================
-
-#===========================================================================
-# PACKAGE VERSION NUMBER
-SET(BBTK_PACKAGE_MAJOR_VERSION 1)
-SET(BBTK_PACKAGE_MINOR_VERSION 0)
-SET(BBTK_PACKAGE_BUILD_VERSION 0)
-#===========================================================================
-
-#===========================================================================
-# THE SOURCES OF THE PACKAGE
-# EITHER UNCOMMENT NEXT LINE TO COMPILE ALL .cxx OF THE DIRECTORY :
-SET(BBTK_PACKAGE_COMPILE_ALL_CXX ON)
-# ... OR LIST THE FILES TO COMPILE MANUALLY :
-#SET(PACKAGE_SOURCES
-# LIST HERE THE FILES TO COMPILE TO BUILD THE LIB
-# E.G. TO COMPILE "toto.cxx" ADD "toto" (NO EXTENSION)
-# )
-#===========================================================================
-
-
+# Include user defined package settings
+INCLUDE(PackageSettings.cmake)
#===========================================================================
-INCLUDE_DIRECTORIES(
- # LIST HERE YOUR INCLUDE DIRECTORIES (EXCEPT BBTK'S)
- # (Of course, if you build a package outside bbtk,
- # you have to list *all* the include directories -including BBTK's-)
- )
-#===========================================================================
-
-
-#===========================================================================
-SET(BBTK_PACKAGE_LIBS
- # LIST HERE THE LIBS TO LINK AGAINST (EXCEPT BBTK)
- )
-#===========================================================================
-
-
#===========================================================================
# Include package configuration cmake script
INCLUDE(${BBTK_DIR}/BBTKConfigurePackage.cmake)
--- /dev/null
+#===========================================================================
+# SETTINGS FOR A BBTK PACKAGE
+#===========================================================================
+
+
+#===========================================================================
+# THE NAME OF THE BBTK PACKAGE = NAME OF THE CURRENT DIRECTORY
+# GET_FILENAME_COMPONENT(BBTK_PACKAGE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+SET(BBTK_PACKAGE_NAME wx)
+#===========================================================================
+
+#===========================================================================
+# UNCOMMENT NEXT LINE IF IT IS A STANDALONE PROJECT,
+# I.E. WHICH IS NOT INCLUDED INTO A WIDER PROJECT WHICH RECURSED INTO THIS
+# DIRECTORY BY SUBDIRS.
+# ELSE PUT A "SUBDIRS(this_directory)" COMMAND INTO ../CMakeLists.txt
+# PROJECT(${BBTK_PACKAGE_NAME})
+#===========================================================================
+
+
+#===========================================================================
+# SET(BBTK_PACKAGE_USE_VTK ON)
+# SET(BBTK_PACKAGE_USE_ITK ON)
+# SET(BBTK_PACKAGE_USE_GDCM ON)
+# SET(BBTK_PACKAGE_USE_GSMIS ON)
+SET(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS ON)
+#===========================================================================
+
+#===========================================================================
+# PACKAGE AUTHOR
+# !!! NO COMMA ALLOWED !!!
+SET(BBTK_PACKAGE_AUTHOR "eduardo.davila/laurent.guigues@creatis.insa-lyon.fr")
+#===========================================================================
+
+#===========================================================================
+# PACKAGE DESCRIPTION
+SET(BBTK_PACKAGE_DESCRIPTION "Basic graphical interface elements (sliders, buttons ...) based on wxWidgets")
+#===========================================================================
+
+#===========================================================================
+# PACKAGE VERSION NUMBER
+SET(BBTK_PACKAGE_MAJOR_VERSION 1)
+SET(BBTK_PACKAGE_MINOR_VERSION 0)
+SET(BBTK_PACKAGE_BUILD_VERSION 0)
+#===========================================================================
+
+#===========================================================================
+# THE SOURCES OF THE PACKAGE
+# EITHER UNCOMMENT NEXT LINE TO COMPILE ALL .cxx OF THE src DIRECTORY :
+SET(BBTK_PACKAGE_COMPILE_ALL_CXX ON)
+# ... OR LIST THE FILES TO COMPILE MANUALLY :
+#SET(PACKAGE_SOURCES
+# LIST HERE THE FILES TO COMPILE TO BUILD THE LIB
+# E.G. TO COMPILE "toto.cxx" ADD "toto" (NO EXTENSION)
+# THE PATH MUST BE RELATIVE TO THE src FOLDER
+# )
+#===========================================================================
+
+#===========================================================================
+# THE SCRIPT-DEFINED BOXES OF THE PACKAGE (bbs)
+# EITHER UNCOMMENT NEXT LINE TO INCLUDE ALL .bbs OF THE bbs/boxes DIRECTORY :
+SET(BBTK_PACKAGE_INCLUDE_ALL_BBS_BOXES ON)
+# ... OR LIST THE FILES TO INCLUDE MANUALLY :
+# SET(BBTK_PACKAGE_BBS_BOXES
+# LIST HERE THE bbs FILES TO INCLUDE
+# E.G. TO INCLUDE "boxes/bbtoto.bbs" ADD "boxes/bbtoto" (NO EXTENSION)
+# !! THE PATH MUST BE RELATIVE TO THE bbs FOLDER !!
+#)
+#===========================================================================
+
+#===========================================================================
+# THE SCRIPT-DEFINED APPLICATIONS OF THE PACKAGE (bbs)
+# EITHER UNCOMMENT NEXT LINE TO INCLUDE ALL .bbs OF THE bbs/appli DIRECTORY :
+SET(BBTK_PACKAGE_INCLUDE_ALL_BBS_APPLI ON)
+# ... OR LIST THE FILES TO INCLUDE MANUALLY :
+# SET(BBTK_PACKAGE_BBS_APPLI
+# LIST HERE THE bbs FILES TO INCLUDE
+# E.G. TO INCLUDE "appli/testToto.bbs" ADD "appli/testToto" (NO EXTENSION)
+# !! THE PATH MUST BE RELATIVE TO THE bbs FOLDER !!
+#)
+#===========================================================================
+
+#===========================================================================
+INCLUDE_DIRECTORIES(
+ # LIST HERE YOUR INCLUDE DIRECTORIES
+ # EXCEPT BBTK'S AND THE INCLUDE DIRS THAT WERE SET
+ # BY INCLUDING A LIBRARY USE FILE
+ )
+#===========================================================================
+
+
+#===========================================================================
+SET(BBTK_PACKAGE_LIBS
+ # LIST HERE THE LIBS TO LINK AGAINST (EXCEPT BBTK)
+ )
+#===========================================================================
+
+
+
+#===========================================================================
+# EOF
+#===========================================================================
+
--- /dev/null
+
+INCLUDE(${BBTK_DIR}/BBTKConfigurePackage_bbs.cmake)
+
+