From a26195c366a89795288009cf7e20f11afa494970 Mon Sep 17 00:00:00 2001 From: guigues Date: Tue, 22 Jan 2008 15:02:00 +0000 Subject: [PATCH] Initial revision --- CMakeLists.txt | 29 + kernel/CMakeLists.txt | 18 + kernel/appli/CMakeLists.txt | 12 + kernel/appli/bbCreatePackage/CMakeLists.txt | 48 + .../bbCreatePackage/bbCreatePackage.bat.in | 51 + .../appli/bbCreatePackage/bbCreatePackage.bbs | 59 + .../bbCreatePackage/bbCreatePackage.sh.in | 32 + .../bbCreatePackage/bbCreatePackageLinux.bbs | 67 + kernel/appli/bbfy/CMakeLists.txt | 7 + kernel/appli/bbfy/bbfy.cpp | 1001 +++++++ kernel/appli/bbi/CMakeLists.txt | 23 + kernel/appli/bbi/bbi.cxx | 202 ++ kernel/cmake/ADD_DEF.cmake | 33 + kernel/cmake/BBTKConfigurePackage.cmake | 69 + kernel/cmake/BBTKConfigurePackage_doc.cmake | 128 + kernel/cmake/BBTKConfigurePackage_src.cmake | 172 ++ kernel/cmake/BBTKDefineOptions.cmake | 7 + kernel/cmake/BBTKFindGTK2.cmake | 331 +++ kernel/cmake/BBTKFindLibraries.cmake | 179 ++ kernel/cmake/BBTKFindWX_WIN.cmake | 573 ++++ kernel/cmake/BBTKPreventInSourceBuild.cmake | 6 + kernel/cmake/BBTKResolveOptions.cmake | 18 + kernel/cmake/BBTKSingleOutputPath.cmake | 6 + kernel/cmake/FIND_AND_USE_WXWIDGETS.cmake | 63 + kernel/cmake/MARK_AS_ADVANCED_UNWANTED.cmake | 5 + kernel/cmake/bbPackage.cxx.in | 6 + kernel/cmake/bbPackage.h.in | 8 + kernel/src/CMakeLists.txt | 206 ++ kernel/src/bbtkAny.cxx | 23 + kernel/src/bbtkAny.h | 555 ++++ kernel/src/bbtkBlackBox.cxx | 1028 +++++++ kernel/src/bbtkBlackBox.h | 423 +++ kernel/src/bbtkBlackBoxDescriptor.cxx | 305 ++ kernel/src/bbtkBlackBoxDescriptor.h | 156 + kernel/src/bbtkBlackBoxInputConnector.cxx | 81 + kernel/src/bbtkBlackBoxInputConnector.h | 75 + kernel/src/bbtkBlackBoxInputDescriptor.h | 94 + kernel/src/bbtkBlackBoxOutputConnector.cxx | 103 + kernel/src/bbtkBlackBoxOutputConnector.h | 60 + kernel/src/bbtkBlackBoxOutputDescriptor.h | 84 + kernel/src/bbtkComplexBlackBox.cxx | 974 +++++++ kernel/src/bbtkComplexBlackBox.h | 178 ++ kernel/src/bbtkComplexBlackBoxDescriptor.cxx | 507 ++++ kernel/src/bbtkComplexBlackBoxDescriptor.h | 130 + .../bbtkComplexBlackBoxInputDescriptor.cxx | 51 + .../src/bbtkComplexBlackBoxInputDescriptor.h | 76 + .../bbtkComplexBlackBoxOutputDescriptor.cxx | 54 + .../src/bbtkComplexBlackBoxOutputDescriptor.h | 77 + kernel/src/bbtkConfigurationFile.cxx | 420 +++ kernel/src/bbtkConfigurationFile.h | 130 + kernel/src/bbtkConnection.cxx | 329 +++ kernel/src/bbtkConnection.h | 130 + kernel/src/bbtkData.h | 278 ++ kernel/src/bbtkDynamicLibraryHandling.h | 73 + kernel/src/bbtkException.h | 76 + kernel/src/bbtkExecuter.cxx | 553 ++++ kernel/src/bbtkExecuter.h | 205 ++ kernel/src/bbtkFactory.cxx | 1041 +++++++ kernel/src/bbtkFactory.h | 223 ++ kernel/src/bbtkInterpreter.cxx | 1586 ++++++++++ kernel/src/bbtkInterpreter.h | 208 ++ kernel/src/bbtkMessageManager.cxx | 173 ++ kernel/src/bbtkMessageManager.h | 424 +++ kernel/src/bbtkPackage.cxx | 640 ++++ kernel/src/bbtkPackage.h | 242 ++ kernel/src/bbtkRTTI.cxx | 80 + kernel/src/bbtkRTTI.h | 187 ++ kernel/src/bbtkSystem.h | 215 ++ kernel/src/bbtkTypeMapping.h | 45 + kernel/src/bbtkUserBlackBox.cxx | 288 ++ kernel/src/bbtkUserBlackBox.h | 148 + kernel/src/bbtkUserBlackBoxDescriptor.h | 62 + kernel/src/bbtkUserBlackBoxGetSetFunctor.h | 268 ++ .../src/bbtkUserBlackBoxInputDescriptor.cxx | 57 + kernel/src/bbtkUserBlackBoxInputDescriptor.h | 80 + kernel/src/bbtkUserBlackBoxMacros.h | 677 +++++ .../src/bbtkUserBlackBoxOutputDescriptor.cxx | 54 + kernel/src/bbtkUserBlackBoxOutputDescriptor.h | 75 + kernel/src/bbtkUtilities.cxx | 30 + kernel/src/bbtkUtilities.h | 87 + kernel/src/bbtkVirtualExec.h | 202 ++ kernel/src/bbtkWx.cxx | 27 + kernel/src/bbtkWx.h | 103 + kernel/src/bbtkWxBlackBox.cxx | 677 +++++ kernel/src/bbtkWxBlackBox.h | 345 +++ kernel/src/bbtkWxBrowser.cxx | 197 ++ kernel/src/bbtkWxBrowser.h | 68 + kernel/src/bbtkWxConsole.cxx | 420 +++ kernel/src/bbtkWxConsole.h | 116 + kernel/src/cmake/bbtkConfigure.h.in | 92 + kernel/src/cmake/bbtkTestFUNCTION.cxx | 38 + kernel/src/cmake/bbtkTestIstringStream.cxx | 32 + kernel/src/xmlParser.cpp | 2594 +++++++++++++++++ kernel/src/xmlParser.h | 548 ++++ packages/CMakeLists.txt | 6 + packages/wx/CMakeLists.txt | 105 + packages/wx/bbs/appli/testSlider.bbs | 6 + packages/wx/bbs/appli/testSplit.bbs | 12 + packages/wx/src/CMakeLists.txt | 5 + packages/wx/src/bbwxSlider.cxx | 392 +++ packages/wx/src/bbwxSlider.h | 176 ++ packages/wx/src/bbwxSplit.cxx | 196 ++ packages/wx/src/bbwxSplit.h | 117 + 103 files changed, 23951 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 kernel/CMakeLists.txt create mode 100644 kernel/appli/CMakeLists.txt create mode 100644 kernel/appli/bbCreatePackage/CMakeLists.txt create mode 100755 kernel/appli/bbCreatePackage/bbCreatePackage.bat.in create mode 100644 kernel/appli/bbCreatePackage/bbCreatePackage.bbs create mode 100755 kernel/appli/bbCreatePackage/bbCreatePackage.sh.in create mode 100755 kernel/appli/bbCreatePackage/bbCreatePackageLinux.bbs create mode 100644 kernel/appli/bbfy/CMakeLists.txt create mode 100644 kernel/appli/bbfy/bbfy.cpp create mode 100644 kernel/appli/bbi/CMakeLists.txt create mode 100644 kernel/appli/bbi/bbi.cxx create mode 100644 kernel/cmake/ADD_DEF.cmake create mode 100644 kernel/cmake/BBTKConfigurePackage.cmake create mode 100644 kernel/cmake/BBTKConfigurePackage_doc.cmake create mode 100644 kernel/cmake/BBTKConfigurePackage_src.cmake create mode 100644 kernel/cmake/BBTKDefineOptions.cmake create mode 100644 kernel/cmake/BBTKFindGTK2.cmake create mode 100644 kernel/cmake/BBTKFindLibraries.cmake create mode 100644 kernel/cmake/BBTKFindWX_WIN.cmake create mode 100644 kernel/cmake/BBTKPreventInSourceBuild.cmake create mode 100644 kernel/cmake/BBTKResolveOptions.cmake create mode 100644 kernel/cmake/BBTKSingleOutputPath.cmake create mode 100644 kernel/cmake/FIND_AND_USE_WXWIDGETS.cmake create mode 100644 kernel/cmake/MARK_AS_ADVANCED_UNWANTED.cmake create mode 100644 kernel/cmake/bbPackage.cxx.in create mode 100644 kernel/cmake/bbPackage.h.in create mode 100644 kernel/src/CMakeLists.txt create mode 100644 kernel/src/bbtkAny.cxx create mode 100644 kernel/src/bbtkAny.h create mode 100644 kernel/src/bbtkBlackBox.cxx create mode 100644 kernel/src/bbtkBlackBox.h create mode 100644 kernel/src/bbtkBlackBoxDescriptor.cxx create mode 100644 kernel/src/bbtkBlackBoxDescriptor.h create mode 100644 kernel/src/bbtkBlackBoxInputConnector.cxx create mode 100644 kernel/src/bbtkBlackBoxInputConnector.h create mode 100644 kernel/src/bbtkBlackBoxInputDescriptor.h create mode 100644 kernel/src/bbtkBlackBoxOutputConnector.cxx create mode 100644 kernel/src/bbtkBlackBoxOutputConnector.h create mode 100644 kernel/src/bbtkBlackBoxOutputDescriptor.h create mode 100644 kernel/src/bbtkComplexBlackBox.cxx create mode 100644 kernel/src/bbtkComplexBlackBox.h create mode 100644 kernel/src/bbtkComplexBlackBoxDescriptor.cxx create mode 100644 kernel/src/bbtkComplexBlackBoxDescriptor.h create mode 100644 kernel/src/bbtkComplexBlackBoxInputDescriptor.cxx create mode 100644 kernel/src/bbtkComplexBlackBoxInputDescriptor.h create mode 100644 kernel/src/bbtkComplexBlackBoxOutputDescriptor.cxx create mode 100644 kernel/src/bbtkComplexBlackBoxOutputDescriptor.h create mode 100644 kernel/src/bbtkConfigurationFile.cxx create mode 100644 kernel/src/bbtkConfigurationFile.h create mode 100644 kernel/src/bbtkConnection.cxx create mode 100644 kernel/src/bbtkConnection.h create mode 100644 kernel/src/bbtkData.h create mode 100644 kernel/src/bbtkDynamicLibraryHandling.h create mode 100644 kernel/src/bbtkException.h create mode 100644 kernel/src/bbtkExecuter.cxx create mode 100644 kernel/src/bbtkExecuter.h create mode 100644 kernel/src/bbtkFactory.cxx create mode 100644 kernel/src/bbtkFactory.h create mode 100644 kernel/src/bbtkInterpreter.cxx create mode 100644 kernel/src/bbtkInterpreter.h create mode 100644 kernel/src/bbtkMessageManager.cxx create mode 100644 kernel/src/bbtkMessageManager.h create mode 100644 kernel/src/bbtkPackage.cxx create mode 100644 kernel/src/bbtkPackage.h create mode 100644 kernel/src/bbtkRTTI.cxx create mode 100644 kernel/src/bbtkRTTI.h create mode 100644 kernel/src/bbtkSystem.h create mode 100644 kernel/src/bbtkTypeMapping.h create mode 100644 kernel/src/bbtkUserBlackBox.cxx create mode 100644 kernel/src/bbtkUserBlackBox.h create mode 100644 kernel/src/bbtkUserBlackBoxDescriptor.h create mode 100644 kernel/src/bbtkUserBlackBoxGetSetFunctor.h create mode 100644 kernel/src/bbtkUserBlackBoxInputDescriptor.cxx create mode 100644 kernel/src/bbtkUserBlackBoxInputDescriptor.h create mode 100644 kernel/src/bbtkUserBlackBoxMacros.h create mode 100644 kernel/src/bbtkUserBlackBoxOutputDescriptor.cxx create mode 100644 kernel/src/bbtkUserBlackBoxOutputDescriptor.h create mode 100644 kernel/src/bbtkUtilities.cxx create mode 100644 kernel/src/bbtkUtilities.h create mode 100644 kernel/src/bbtkVirtualExec.h create mode 100644 kernel/src/bbtkWx.cxx create mode 100644 kernel/src/bbtkWx.h create mode 100644 kernel/src/bbtkWxBlackBox.cxx create mode 100644 kernel/src/bbtkWxBlackBox.h create mode 100644 kernel/src/bbtkWxBrowser.cxx create mode 100644 kernel/src/bbtkWxBrowser.h create mode 100644 kernel/src/bbtkWxConsole.cxx create mode 100644 kernel/src/bbtkWxConsole.h create mode 100644 kernel/src/cmake/bbtkConfigure.h.in create mode 100644 kernel/src/cmake/bbtkTestFUNCTION.cxx create mode 100644 kernel/src/cmake/bbtkTestIstringStream.cxx create mode 100644 kernel/src/xmlParser.cpp create mode 100644 kernel/src/xmlParser.h create mode 100644 packages/CMakeLists.txt create mode 100644 packages/wx/CMakeLists.txt create mode 100644 packages/wx/bbs/appli/testSlider.bbs create mode 100644 packages/wx/bbs/appli/testSplit.bbs create mode 100644 packages/wx/src/CMakeLists.txt create mode 100644 packages/wx/src/bbwxSlider.cxx create mode 100644 packages/wx/src/bbwxSlider.h create mode 100644 packages/wx/src/bbwxSplit.cxx create mode 100644 packages/wx/src/bbwxSplit.h diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..366cbc4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,29 @@ +#----------------------------------------------------------------------------- +PROJECT(BBTK) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# BBTK version number +SET(BBTK_MAJOR_VERSION 0) +SET(BBTK_MINOR_VERSION 5) +SET(BBTK_BUILD_VERSION 0) +SET(BBTK_VERSION + "${BBTK_MAJOR_VERSION}.${BBTK_MINOR_VERSION}.${BBTK_BUILD_VERSION}") +# Now in bbtkConfigure.h file (cf. core/src) +#ADD_DEFINITIONS( -DBBTK_VERSION=${BBTK_VERSION} ) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Set global configuration of the toolkit +INCLUDE(cmake/BBTKGlobalConfiguration.cmake) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# The toolkit kernel (bbtk lib; appli : bbi, bbfy; docs; ...) +SUBDIRS(kernel) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# The "standard" packages +SUBDIRS(packages) +#----------------------------------------------------------------------------- diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt new file mode 100644 index 0000000..af6806c --- /dev/null +++ b/kernel/CMakeLists.txt @@ -0,0 +1,18 @@ +#----------------------------------------------------------------------------- +# bbtk library +SUBDIRS(src) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Documentation +#SUBDIRS(doc) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Applications (bbi, bbfy...) +OPTION(BUILD_APPLICATIONS "Build Applications (bbi, bbfy, ...)" ON) +IF(BUILD_APPLICATIONS) + SUBDIRS(appli) +ENDIF(BUILD_APPLICATIONS) +#----------------------------------------------------------------------------- + diff --git a/kernel/appli/CMakeLists.txt b/kernel/appli/CMakeLists.txt new file mode 100644 index 0000000..51c109f --- /dev/null +++ b/kernel/appli/CMakeLists.txt @@ -0,0 +1,12 @@ +# The BlackBox Interpreter +SUBDIRS(bbi) + +# Creates html documentation of a package +#SUBDIRS(bbdoc) + +# Black box code generator from xml +#SUBDIRS(bbfy) + +# Utility that creates the file architecture for a new user package +#SUBDIRS(bbCreatePackage) + diff --git a/kernel/appli/bbCreatePackage/CMakeLists.txt b/kernel/appli/bbCreatePackage/CMakeLists.txt new file mode 100644 index 0000000..c005114 --- /dev/null +++ b/kernel/appli/bbCreatePackage/CMakeLists.txt @@ -0,0 +1,48 @@ +# Installs bbCreatePackage.bat/.sh +# used to creates the file architecture for a new user package + +# go to data which install the input data to the script +SUBDIRS(data) + +# Sets the data install path +SET(bbCreatePackage_DATA_PATH + ${CMAKE_INSTALL_PREFIX}/bin/Data_bbCreatePackage) + +IF(WIN32) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.bat.in + ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage.bat + @ONLY IMMEDIATE + ) + INSTALL_FILES(/bin .bat bbCreatePackage) + INSTALL_FILES(/bin .bbs bbCreatePackage) +ENDIF(WIN32) + + +IF(UNIX) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage + @ONLY IMMEDIATE + ) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.bbs + ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage.bbs + @ONLY IMMEDIATE + ) + + INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage.bbs + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) +ENDIF(UNIX) + + + + diff --git a/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in b/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in new file mode 100755 index 0000000..c72ae29 --- /dev/null +++ b/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in @@ -0,0 +1,51 @@ +@echo off + +echo creates the file architecture for a new user package + + +if %0%1==%0 goto ERROR01 + + +set BBTKINPUT="@bbCreatePackage_DATA_PATH@" +set BBTKOUTPUT=%1 + + +echo "----- Creating black box package '%BBTKNAME%' in repository '%BBTKOUTPUT%' -----" + + +IF EXIST %BBTKOUTPUT% GOTO ERROR02 + +echo "-> Packages repository '%BBTKOUTPUT%' does not exist : creating it" +mkdir %BBTKOUTPUT% + + + + echo "-> Creating file '%BBTKOUTPUT%/CMakeLists.txt' " + copy %BBTKINPUT%\PackageCMakeLists.txt %BBTKOUTPUT%\CMakeLists.txt + echo "-> Creating file directory '%BBTKOUTPUT%/cmake' " + mkdir %BBTKOUTPUT%\cmake + echo "-> Coping files in '%BBTKOUTPUT%/cmake' " + copy %BBTKINPUT%\cmake\*.cmake %BBTKOUTPUT%\cmake + copy %BBTKINPUT%\cmake\*.in %BBTKOUTPUT%\cmake + +echo "Done !" +echo "Edit the file '%BBTKOUTPUT%/CMakeLists.txt' to customize your package" + + +goto END + + + + +:ERROR01 +echo bbCreatePackage.bat "" +goto END + +:ERROR02 +echo "ERROR : Directory '%BBTKOUTPUT%/%BBTKNAME%' already exists !" +goto end + + + +:END + diff --git a/kernel/appli/bbCreatePackage/bbCreatePackage.bbs b/kernel/appli/bbCreatePackage/bbCreatePackage.bbs new file mode 100644 index 0000000..9c685a3 --- /dev/null +++ b/kernel/appli/bbCreatePackage/bbCreatePackage.bbs @@ -0,0 +1,59 @@ +load std +load wx + +new Sizer sizer +new StaticText statictext +new StaticText statictextDirectory +new TextCtrl textctrl +new CommandButton commandbutton +new CommandButton dirbutton +new DirDialog dirdialog +new ExecSys execsys +#new ConcatStrings concatstringPackagename +new MakeFileName makeFilePackagename +new ConcatStrings concatstringCommand +new Print print +new StaticText msg1 +new StaticText msg2 +new Execbbi execbbi + +set sizer.Title "Creat Package" +set sizer.WxWidth 400 +set sizer.WxHeight 200 + +set statictext.In "This script creates a new BBTK Package" +set textctrl.Title "2) Name of the Package" +set textctrl.In "MyPackageBBTK" +set commandbutton.Label "3) Create Package" +set msg1.In "Missing directory ..?????" +set msg2.In "Ok, See result of the command in the console window" +set commandbutton.In "exec msg1" +set dirbutton.Label "1) Choose directory" +set execbbi.In "exec print; exec msg2; exec execsys;" +set dirbutton.In "connect dirdialog.Out statictextDirectory.In; exec dirdialog; exec statictextDirectory; set commandbutton.In 'exec execbbi' " +set statictextDirectory.Title "Directory" +set statictextDirectory.ProcessMode 1 + + +connect dirdialog.Out makeFilePackagename.Directory +connect textctrl.Out makeFilePackagename.File + +set msg1.WxWidth 600 +set msg1.WxHeight 80 +set msg2.WxWidth 600 +set msg2.WxHeight 80 + +set concatstringCommand.In1 "bbCreatePackage " +connect makeFilePackagename.Out concatstringCommand.In2 +connect concatstringCommand.Out execsys.In +connect concatstringCommand.Out print.In + +connect sizer.Child statictext.Parent +connect sizer.Child dirbutton.Parent +connect sizer.Child statictextDirectory.Parent +connect sizer.Child textctrl.Parent +connect sizer.Child commandbutton.Parent + +set dirbutton.ProcessMode 1 +graph CURRENT 0 +exec sizer diff --git a/kernel/appli/bbCreatePackage/bbCreatePackage.sh.in b/kernel/appli/bbCreatePackage/bbCreatePackage.sh.in new file mode 100755 index 0000000..8a25868 --- /dev/null +++ b/kernel/appli/bbCreatePackage/bbCreatePackage.sh.in @@ -0,0 +1,32 @@ +#!/bin/bash +# creates the file architecture for a new user package + +if [ $# -ne 1 ] + then + echo "usage : bbCreatePackage " + exit +fi + +INPUT=@bbCreatePackage_DATA_PATH@ +OUTPUT=$1 + +echo "----- Creating new black box package '$1' in repository '$OUTPUT' -----" + +if [ -e $OUTPUT ] + then + echo "ERROR : Directory '$OUTPUT' already exists !" + exit +fi + + +echo "-> Creating directory '$OUTPUT'" +mkdir $OUTPUT +echo "-> Creating file '$OUTPUT/CMakeLists.txt'" +cp ${INPUT}/PackageCMakeLists.txt ${OUTPUT}/CMakeLists.txt +echo "-> Creating directory '$OUTPUT/cmake'" +mkdir ${OUTPUT}/cmake +echo "-> Copying files in '$OUTPUT/cmake'" +cp ${INPUT}/cmake/*.cmake ${OUTPUT}/cmake/ +cp ${INPUT}/cmake/*.in ${OUTPUT}/cmake/ +echo "Done !" +echo "Edit the file '$OUTPUT/CMakeLists.txt' to customize your package" diff --git a/kernel/appli/bbCreatePackage/bbCreatePackageLinux.bbs b/kernel/appli/bbCreatePackage/bbCreatePackageLinux.bbs new file mode 100755 index 0000000..ceada36 --- /dev/null +++ b/kernel/appli/bbCreatePackage/bbCreatePackageLinux.bbs @@ -0,0 +1,67 @@ +# ------------------------------------------------------- +# This one, waiting the troubles with DirDialog are fixed +# ------------------------------------------------------- + +load std +load wx + +new Sizer sizer +new StaticText statictext +new StaticText statictextDirectory +new TextCtrl textctrl +new TextCtrl textctrlDirectory +new CommandButton commandbutton +new CommandButton dirbutton +new DirDialog dirdialog +new ExecSys execsys + +new MakeFileName makeFilePackagename +new ConcatStrings concatstringCommand +new Print print +new StaticText msg1 +new StaticText msg2 +new Execbbi execbbi + +set sizer.Title "Create Package" +set sizer.WxWidth 400 +set sizer.WxHeight 300 + +set statictext.In "This script creates a new BBTK Package" +set textctrl.Title "2) Name of the Package" +set textctrl.In "MyPackageBBTK" +set commandbutton.Label "3) Create Package" +set msg1.In "Missing directory ..?????" +set msg2.In "Ok, See result of the command in the console window" +set commandbutton.In "exec msg1" +set dirbutton.Label "1) Write directory name, then click here" +set execbbi.In "exec print; exec msg2; exec execsys;" + +#set dirbutton.In "connect dirdialog.Out statictextDirectory.In; exec dirdialog; exec statictextDirectory; set commandbutton.In 'exec execbbi' " +set dirbutton.In "connect textctrlDirectory.Out statictextDirectory.In ; exec statictextDirectory; set commandbutton.In 'exec execbbi' " + +set statictextDirectory.Title "Directory" +set statictextDirectory.ProcessMode 1 + +connect textctrlDirectory.Out makeFilePackagename.Directory +connect textctrl.Out makeFilePackagename.File + +set msg1.WxWidth 600 +set msg1.WxHeight 80 +set msg2.WxWidth 600 +set msg2.WxHeight 80 + +set concatstringCommand.In1 "bbCreatePackage " +connect makeFilePackagename.Out concatstringCommand.In2 +connect concatstringCommand.Out execsys.In +connect concatstringCommand.Out print.In + +connect sizer.Child statictext.Parent +connect sizer.Child textctrlDirectory.Parent +connect sizer.Child dirbutton.Parent +connect sizer.Child statictextDirectory.Parent +connect sizer.Child textctrl.Parent +connect sizer.Child commandbutton.Parent + +set dirbutton.ProcessMode 1 +#graph CURRENT 0 +exec sizer diff --git a/kernel/appli/bbfy/CMakeLists.txt b/kernel/appli/bbfy/CMakeLists.txt new file mode 100644 index 0000000..cf5814d --- /dev/null +++ b/kernel/appli/bbfy/CMakeLists.txt @@ -0,0 +1,7 @@ +SET(SOURCES + bbfy + ) + +ADD_EXECUTABLE(bbfy ${SOURCES}) +TARGET_LINK_LIBRARIES(bbfy bbtk) +INSTALL_TARGETS(/bin/ bbfy) diff --git a/kernel/appli/bbfy/bbfy.cpp b/kernel/appli/bbfy/bbfy.cpp new file mode 100644 index 0000000..0c7972a --- /dev/null +++ b/kernel/appli/bbfy/bbfy.cpp @@ -0,0 +1,1001 @@ +#ifdef WIN32 +#define _CRT_SECURE_NO_DEPRECATE +#endif + +#include +#include "xmlParser.h" +#include +#include +#include +#include + +//========================================================================== +class bbfyException +{ +public: + bbfyException(const std::string& message) : mMessage(message) {} + + std::string mMessage; +}; +//========================================================================== + +//========================================================================== +class bbfy +{ +public: + bbfy(const std::string& filename, const std::string& output_path = "", + bool verbose = false); + + void CreateBlackBox(); + void ParseXML(); + void CreateHeader(); + void CreateCode(); + + void WriteGenericITKFilterHeader(); + + void BeginNamespace(); + void EndNamespace(); + +private: + // + std::string mFilename; + std::string mOutputPath; + bool mVerbose; + + // + std::string mName; + typedef enum + { + STD, + itkImageToImageFilter, + vtkImageAlgorithm, + vtkPolyDataAlgorithm, + } + BoxType; + BoxType mType; + std::string mParentBlackBox; + std::string mItkParent; + std::string mVtkParent; + bool mGeneric; + std::string mAuthor; + std::string mDescription; + std::string mPackage; + bool mIsInNamespace; + std::string mNamespace; + // int mNbTemplateParam; + std::vector mTemplateParam; + std::string mTemplateDeclaration; + std::string mTemplateImplementation; + + std::vector mInclude; + + std::string mUserConstructor; + std::string mUserCopyConstructor; + std::string mUserDestructor; + + typedef struct + { + std::string name; + std::string type; + std::string help; + std::string special; + std::string generic_type; + } + IO; + + std::vector mInput; + std::vector mOutput; + + std::string mProcess; + + // + std::ofstream mFile; + std::string mHName; + std::string mCxxName; + +}; +//========================================================================== + + + +//========================================================================== +bbfy::bbfy(const std::string& filename, + const std::string& output_path, + bool verbose) +{ + mFilename = filename; + mOutputPath = output_path; + mVerbose = verbose; + + CreateBlackBox(); +} +//========================================================================== + +//========================================================================== +void bbfy::CreateBlackBox() +{ + // Parse XML input file + ParseXML(); + // Create output files + CreateHeader(); + CreateCode(); +} +//========================================================================== + + +//========================================================================== +void GetTextOrClear(const XMLNode& node, std::string& var) +{ + if (node.nText()>0) + { + var = node.getText(); + } + else if (node.nClear()>0) + { + var = node.getClear().lpszValue; + } + else + { + std::string mess("Error : element <"); + mess += node.getName(); + mess += "> : no text nor
 clear tag found";
+      throw bbfyException(mess);
+    }
+}
+//==========================================================================
+
+
+//==========================================================================
+void bbfy::ParseXML()
+{
+  XMLResults* res = new XMLResults;
+  XMLNode BB = XMLNode::parseFile(mFilename.c_str(),"blackbox",res);
+
+  if ( res->error != eXMLErrorNone ) 
+    {
+      std::ostringstream str;
+      str << XMLNode::getError(res->error);
+      str << " [line " << res->nLine << ", col "<nColumn<<"]"; 
+      delete res;
+      throw bbfyException(str.str());
+    }
+  delete res;
+
+  // Name
+  if (!BB.isAttributeSet("name")) 
+    {
+      throw bbfyException("Error : no 'name' attribute found (mandatory)");
+    }
+  mName = BB.getAttribute("name");
+
+  if (mVerbose) std::cout << "* Creating BlackBox '"< tag
+	  if (!BB.nChildNode("itkparent")) 
+	    {
+	      throw bbfyException("Error : blackbox type 'itkImageToImageFilter' but no  tag found (mandatory)");
+	    }
+	  GetTextOrClear(BB.getChildNode("itkparent"),mItkParent);
+	  // 
+	  mGeneric = false;
+	  if (BB.isAttributeSet("generic")) mGeneric=true;
+	}
+      else if ((bbtype=="vtkImageAlgorithm") || (bbtype=="vtkPolyDataAlgorithm"))
+	{
+	  mType = vtkImageAlgorithm;
+	  // Looks for  tag
+	  if (!BB.nChildNode("vtkparent")) 
+	    {
+	      throw bbfyException("Error : blackbox type 'vtkImageAlgorithm' but no  tag found (mandatory)");
+	    }
+	  GetTextOrClear(BB.getChildNode("vtkparent"),mVtkParent);
+	  // 
+	}
+      else 
+	{
+	  std::string mess("Error : blackbox type '");
+	  mess += bbtype;
+	  mess += "' unknown (types are 'standard','itkfilter')";
+	  throw bbfyException(mess);
+	}
+    }
+
+  // Parent black box
+  if (!BB.nChildNode("parentblackbox")) 
+    {
+      throw bbfyException("Error : no  tag found (mandatory)");
+   }
+  GetTextOrClear(BB.getChildNode("parentblackbox"),mParentBlackBox);
+
+  // Package
+  if (!BB.nChildNode("package")) 
+    {
+      throw bbfyException("Error : no  tag found (mandatory)");
+   }
+  GetTextOrClear(BB.getChildNode("package"),mPackage);
+
+  // Author
+  int i,j;
+  for (i=0,j=0; i 0)
+    {
+      mTemplateDeclaration = "<";
+      mTemplateImplementation = "<";
+      
+      for (i=0,j=0; i attribute 'name' not found (mandatory)");
+	}
+      if (!n.isAttributeSet("type"))
+	{
+	  throw bbfyException("Error :  attribute 'type' not found (mandatory)");
+	}
+
+      IO io;
+      io.name = n.getAttribute("name");
+      io.type = n.getAttribute("type"); 
+      GetTextOrClear(n,io.help);
+
+      if (n.isAttributeSet("special")) 
+	{
+	  io.special =  n.getAttribute("special");  
+	}
+
+      if (n.isAttributeSet("generic_type")) 
+	{
+	  io.generic_type =  n.getAttribute("generic_type");  
+	}
+
+      mInput.push_back(io);
+    }
+  
+  // Outputs
+  for (i=0,j=0; i attribute 'name' not found (mandatory)");
+	}
+      if (!n.isAttributeSet("type"))
+	{
+	  throw bbfyException("Error :  attribute 'type' not found (mandatory)");
+	}
+
+      IO io;
+      io.name = n.getAttribute("name"); 
+      io.type = n.getAttribute("type"); 
+      GetTextOrClear(n,io.help);
+
+      if (n.isAttributeSet("special")) 
+	{
+	  io.special =  n.getAttribute("special");  
+	}
+
+      if (n.isAttributeSet("generic_type")) 
+	{
+	  io.generic_type =  n.getAttribute("generic_type");  
+	}
+
+      mOutput.push_back(io);
+    }
+
+
+  // Process
+  // Process tag given ?
+   if (BB.nChildNode("process"))
+     {
+       GetTextOrClear(BB.getChildNode("process"),mProcess);
+     }
+}
+//==========================================================================
+
+
+//==========================================================================
+void bbfy::BeginNamespace()
+{
+  if (mIsInNamespace)
+    {
+      mFile << "namespace "<::iterator i;
+  for (i=mInclude.begin(); i!=mInclude.end(); ++i) 
+    {
+      mFile << "#include \"" << *i <<"\"\n";
+    }
+  if (mGeneric) mFile << "#include \"bbitkImage.h\"\n";
+  mFile << "\n";
+
+  // Namespace
+  BeginNamespace();
+
+  // Interface
+
+  // If it is a template class
+  if (mTemplateParam.size() > 0)
+    {
+      mFile << "template " << mTemplateDeclaration <<"\n";
+    }
+  
+  // Class declaration and parents
+  mFile << "class /*BBTK_EXPORT*/ "<::iterator ioi;
+  for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi) 
+    {
+      if (ioi->special=="") 
+	{
+	  mFile << "  BBTK_DECLARE_INPUT(" 
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	}
+      else if (ioi->special=="itk input")
+	{
+	  mFile << "  BBTK_DECLARE_ITK_INPUT(" 
+		<< "itkParent,"
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	}
+      else if (ioi->special=="vtk input")
+	{
+	  if (mType == vtkImageAlgorithm) {
+	  mFile << "  BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT(" 
+		<< "vtkParent,"
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	  } 
+	  else if (mType == vtkPolyDataAlgorithm) {
+	  mFile << "  BBTK_DECLARE_POLY_DATA_ALGORITHM_INPUT(" 
+		<< "vtkParent,"
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	  }
+	}
+      else if (ioi->special=="itk parameter")
+	{
+	  mFile << "  BBTK_DECLARE_ITK_PARAM(" 
+		<< "itkParent,"
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	}
+      else if (ioi->special=="vtk parameter")
+	{
+	  mFile << "  BBTK_DECLARE_VTK_PARAM(" 
+		<< "vtkParent,"
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	}
+      else 
+	{
+	  std::string mess("Error : input '");
+	  mess += ioi->name;
+	  mess += "', 'special' attribute '";
+	  mess += ioi->special;
+	  mess += "' unknown";
+	  throw bbfyException(mess);
+	}
+    }
+  
+  // Outputs
+  for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi) 
+    {
+      if (ioi->special=="") 
+	{
+	  mFile << "  BBTK_DECLARE_OUTPUT(" 
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	}
+      else if (ioi->special=="itk output")
+	{
+	  mFile << "  BBTK_DECLARE_ITK_OUTPUT(" 
+		<< "itkParent,"
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	}  
+      else if (ioi->special=="vtk output")
+	{
+	  mFile << "  BBTK_DECLARE_VTK_OUTPUT(" 
+		<< "vtkParent,"
+		<< ioi->name
+		<< ","
+		<< ioi->type
+		<< ");\n";
+	}  
+      else 
+	{
+	  std::string mess("Error : output '");
+	  mess += ioi->name;
+	  mess += "', 'special' attribute '";
+	  mess += ioi->special;
+	  mess += "' unknown";
+	  throw bbfyException(mess);
+	}
+    }
+  
+
+  // Process
+  if ((mType == STD)||(mProcess.size()))
+    {
+      mFile << "  BBTK_PROCESS(DoProcess);\n" ;
+      mFile << "  void DoProcess();\n";
+    }
+  else if (mType == itkImageToImageFilter)
+    {   
+      mFile << "  BBTK_PROCESS(itkParent::Update);\n" ;
+    }
+  else if ((mType == vtkImageAlgorithm) ||
+	   (mType == vtkPolyDataAlgorithm) )
+
+    {   
+      mFile << "  BBTK_PROCESS(vtkParent::Update);\n" ;
+    }
+
+  // EO black box declaration
+  mFile << "};\n\n";
+
+
+
+  // BO black box description
+  if (mTemplateParam.size()==0)
+    {
+      mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
+	    << mName << ","
+	    << mParentBlackBox << ");\n";
+      mFile << "BBTK_NAME(\"" << mName <<"\");\n";
+    }
+  else if (mTemplateParam.size()==1)
+    {
+      mFile << "BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX("
+	    << mName //<< ","
+	//<< mParentBlackBox //<< ","
+	//   << mTemplateParam[0] 
+	    << ");\n";
+      mFile << "BBTK_NAME(\"" << mName 
+	    << "<\"+bbtk::TypeName<" << mTemplateParam[0]
+	    <<">()+\">\");\n";
+    }
+ else 
+    {
+      throw bbfyException("template bb with more than 1 templ param not impl");
+    } 
+  
+  // Author
+  mFile << "BBTK_AUTHOR(\""<0)
+	{
+	  mFile << "BBTK_TEMPLATE_INPUT(";
+	} 
+      else 
+	{
+	  mFile << "BBTK_INPUT(";
+	} 
+      mFile << mName << "," << ioi->name << ",\""
+	    << ioi->help << "\"," <<  ioi->type <<");\n";
+    }
+  
+  // Outputs
+  for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi) 
+    {
+      if (mTemplateParam.size()>0)
+	{
+	  mFile << "BBTK_TEMPLATE_OUTPUT(";
+	} 
+      else 
+	{
+	  mFile << "BBTK_OUTPUT(";
+	} 
+      mFile << mName << "," << ioi->name << ",\""
+	    << ioi->help << "\"," <<  ioi->type <<");\n";
+    }
+  
+  // EO black box description
+  if (mTemplateParam.size()==0)
+    {
+      mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
+	    << mName << ");\n";
+    }
+  else if (mTemplateParam.size()==1)
+    {
+      mFile << "BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX("
+	    << mName //<< ","
+	// << mTemplateParam[0] 
+	    << ");\n";
+    }
+  else 
+    {
+      throw bbfyException("template bb with more than 1 templ param not impl");
+     
+    } 
+  
+  // Untemplatization of itk filters
+  if ( mGeneric )
+    {
+      WriteGenericITKFilterHeader();
+    }
+
+
+  // EO namespace
+  EndNamespace();
+
+  // EOF
+  mFile << "\n";
+
+  mFile.close();
+}
+//==========================================================================
+
+
+
+//==========================================================================
+void bbfy::WriteGenericITKFilterHeader()
+{
+  mFile << "\n//===================================================\n";
+  mFile << "// Generic \"untemplatized\" filter\n";
+  mFile << "//===================================================\n";
+
+  // Class declaration and parents
+  mFile << "class /*BBTK_EXPORT*/ "<::iterator ioi;
+  for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi) 
+    {
+      mFile << "  BBTK_DECLARE_INPUT(" 
+	    << ioi->name
+	    << ","
+	    << ioi->generic_type
+	    << ");\n";
+    }
+  
+  // Outputs
+  for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi) 
+    {
+      mFile << "  BBTK_DECLARE_OUTPUT(" 
+	    << ioi->name
+	    << ","
+	    << ioi->generic_type
+	    << ");\n";
+    }
+    
+  // Process
+  mFile << "  BBTK_PROCESS(ProcessSwitch);\n";
+  mFile << "  private :\n";
+  mFile << "    inline void ProcessSwitch();\n";
+  mFile << "    template  void Process();\n";
+  // EO black box declaration
+  mFile << "};\n\n";
+
+
+
+  // BO black box description
+  mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
+	<< mName << "Generic,bbtk::UserBlackBox);\n";
+  mFile << "BBTK_NAME(\"" << mName <<"\");\n";
+
+  // Author
+  mFile << "BBTK_AUTHOR(\""<name << ",\""
+	    << ioi->help << "\"," <<  ioi->generic_type <<");\n";
+    }
+  
+  // Outputs
+  for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi) 
+    {
+      mFile << "BBTK_OUTPUT(";
+      mFile << mName << "Generic," << ioi->name << ",\""
+	    << ioi->help << "\"," <<  ioi->generic_type <<");\n";
+    }
+  
+  // EO black box description
+  mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
+	<< mName << "Generic);\n";
+
+
+  //=================================================================
+  // ProcessSwitch implementation
+  mFile << "void "<< mName <<"Generic::ProcessSwitch()\n"
+	<< "{\n"
+	<< "CALL_FOR_ALL_TYPES_AND_DIM(bbGetInputIn()->GetType(),\n"
+	<< "                           bbGetInputIn()->GetDimension(),\n"
+	<< "                           Process);\n"
+	<< "}\n";
+  //=================================================================
+
+
+  //=================================================================
+  // Template process implementation
+  mFile << "template \n"
+	<< "void "<()<<\",\"<()\"< ImageType;\n"
+	<< "  typedef "< FilterType;\n"
+    
+	<< "  FilterType* f = new FilterType(\"Temp\");\n"
+    
+	<< "  f->bbSetInputIn( this->bbGetInputIn()->GetImage() );\n";
+  
+  for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi) 
+    {
+      if (ioi->name == "In") continue;
+      mFile << "  f->bbSetInput"<name<<" ( this->bbGetInput" 
+	    << ioi->name << "() );\n";
+    }
+  
+  mFile << "  f->bbUpdate();\n"
+	<< "  this->bbSetOutputOut( new itkImage( f->bbGetOutputOut() ) );\n"
+	<< "  f->UnRegister();\n"
+	<< "  bbtkDebugDecTab(\"Core\",9);\n"
+	<< "}\n\n";
+  //=================================================================
+
+
+}
+//==========================================================================
+
+
+//==========================================================================
+void bbfy::CreateCode()
+{
+  mCxxName = "bb";
+  mCxxName += mPackage;
+  mCxxName += mName;
+  mCxxName += ".cxx";
+  if (mVerbose) std::cout << " - Creating code   '"<0) 
+    {
+      // Implementation
+      mFile << "BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION("
+	    << mName << ","  
+	    << mParentBlackBox << ");\n";
+     
+      if (mGeneric) 
+	{	
+	  // Implementation
+	  mFile << "BBTK_USER_BLACK_BOX_IMPLEMENTATION("
+		<< mName << "Generic,bbtk::UserBlackBox);\n";
+	  // Package
+	  mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
+		<< mPackage << ","
+		<< mName << "Generic)\n";
+	}
+    }
+  else 
+    {
+      // Non template class
+      // Package
+      mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
+	    << mPackage << ","
+	    << mName << ")\n";
+
+      // Implementation
+      mFile << "BBTK_USER_BLACK_BOX_IMPLEMENTATION("
+	    << mName << ","  
+	    << mParentBlackBox << ");\n";
+ 
+      // Process
+      if ((mType == STD)||(mProcess.size()))
+	{
+	  mFile << "void "<4) 
+    {
+      std::cerr << "usage : "<< argv[0] <<" xml_file [output_path] [-q]" << std::endl;
+      return 1;
+    }
+
+  try 
+    {
+      std::string output_path("");
+      bool verbose = true;
+      if (argc>2) output_path = argv[2];
+      if (argc>3) verbose = false;
+      
+      bbfy B(argv[1],output_path,verbose);
+    }
+  catch (bbfyException e)
+    {
+      std::cerr << e.mMessage << std::endl;
+      return 1;
+    }
+  return 0;
+}
+//==========================================================================
+
+
diff --git a/kernel/appli/bbi/CMakeLists.txt b/kernel/appli/bbi/CMakeLists.txt
new file mode 100644
index 0000000..11857f8
--- /dev/null
+++ b/kernel/appli/bbi/CMakeLists.txt
@@ -0,0 +1,23 @@
+
+#OPTION(BUILD_bbi_GRAPHICAL "Build bbi in graphical mode (requires wxWidgets)" OFF)
+#SWITCH_ON_IF_ALL_BUILD(BUILD_bbi_GRAPHICAL)
+#IF (BUILD_bbi_GRAPHICAL)
+#  SET(USE_WXWIDGETS ON CACHE BOOL "Use WxWidgets" FORCE)
+#ENDIF (BUILD_bbi_GRAPHICAL)
+
+
+SET(SOURCES
+  bbi
+  )
+
+
+IF(bbtk_USE_WXWIDGETS AND WIN32)
+  ADD_EXECUTABLE(bbi WIN32 ${SOURCES})  
+  SET_TARGET_PROPERTIES(bbi PROPERTIES LINK_FLAGS /subsystem:console )
+ELSE(bbtk_USE_WXWIDGETS AND WIN32)
+  ADD_EXECUTABLE(bbi ${SOURCES})  
+ENDIF(bbtk_USE_WXWIDGETS AND WIN32)
+
+
+TARGET_LINK_LIBRARIES(bbi bbtk)
+INSTALL_TARGETS(/bin/ bbi)
diff --git a/kernel/appli/bbi/bbi.cxx b/kernel/appli/bbi/bbi.cxx
new file mode 100644
index 0000000..a4c9c8a
--- /dev/null
+++ b/kernel/appli/bbi/bbi.cxx
@@ -0,0 +1,202 @@
+#ifdef _USE_WXWIDGETS_
+
+//==========================================================================
+// WITH WX
+//==========================================================================
+#include "bbtkInterpreter.h"
+#include "bbtkWxBlackBox.h"
+#include "bbtkWxConsole.h"
+
+#include 
+#include 
+#include 
+
+
+static const wxCmdLineEntryDesc cmdLineDesc[] =
+{
+  { wxCMD_LINE_SWITCH, _T("c"), _T("command"), _T("turn to command line mode after file(s) processing") },
+  { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet") },
+  { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("print help") },
+  { wxCMD_LINE_SWITCH, _T("g"), _T("graphical-dialog"),   _T("prompts the user for the parameters values using dialog boxes") },
+  { wxCMD_LINE_SWITCH, _T("t"), _T("text-dialog"),   _T("prompts the user for the parameters values in text mode") },
+  { wxCMD_LINE_SWITCH, _T("n"), _T("no-command"),   _T("do not show command window") },
+  { wxCMD_LINE_PARAM,  NULL, NULL, _T("input_file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+  { wxCMD_LINE_NONE }
+};
+
+
+
+class wxBBIApp : public wxApp
+{
+public:
+  bool OnInit( );
+  int  OnExit() { 
+    //    std::cout << "wxBBIApp::OnExit()"< argv;
+  bool command;
+  bool quiet;
+  bool help;
+  bool graphical_dialog;
+  bool text_dialog;
+  bool no_command;
+
+  std::map param_map;
+  std::vector input_file;
+  
+};
+
+IMPLEMENT_APP(wxBBIApp);
+
+void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser)
+{
+  //    std::cout << "OnInitCmdLine"<Show(true);
+
+  I->SetInputs(param_map);
+
+  bool help_on_script = help && (input_file.size() > 0);
+  if (help_on_script) I->SetNoExecMode(true);
+
+  if (graphical_dialog) I->SetDialogMode(bbtk::Executer::GraphicalDialog);
+  if (text_dialog) I->SetDialogMode(bbtk::Executer::TextDialog);
+
+  std::vector::const_iterator i;
+  for (i=input_file.begin(); i!=input_file.end(); ++i) I->InterpretFile(*i);
+  I->SetNoExecMode(false);
+
+  if (help_on_script) bbtk::HelpBlackBox("workspace",false);
+
+  if (!(command || bbtk::WxBlackBox::bbGlobalIsSomeWindowShown() ))
+    {
+      I->Close();
+    }
+  return true;
+
+}
+
+
+#if defined(_WIN32) 
+
+//  How to have a Console and wxWidgets
+//  http://www.wxwidgets.org/wiki/index.php/MSVC_Setup_Guide
+//   In Visual C++ 6 (7 should be similar), to create an application that is both a console application 
+//  (cout's to the console are visible) and has a wxWidgets GUI, 
+//  you need to use the linker option "/subsystem:console" and the following code:
+int main(int argc, char* argv[])
+{
+	return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
+}
+
+#endif // defined(_WIN32) 
+
+
+#else
+//==========================================================================
+// WITHOUT WX
+//==========================================================================
+
+#include "bbtkInterpreter.h"
+
+int main(int argc, char* argv[])
+{  
+
+  if (argc>2) return 0;
+
+  std::cout << "BBI (Black Box Interpreter) - bbtk "
+	    << bbtk::GetVersion()<< " - (c) Creatis 2007"
+	    <
+    PKGCONFIG(glib-2.0 _GLIB2IncDir _GLIB2inkDir _GLIB2LinkFlags _GLIB2Cflags)
+    PKGCONFIG(gmodule-2.0 _GMODULE2IncDir _GMODULE2inkDir _GMODULE2LinkFlags _GMODULE2Cflags)
+    SET(GDIR /opt/gnome/lib/glib-2.0/include)
+
+    FIND_PATH(GTK2_GLIBCONFIG_INCLUDE_PATH glibconfig.h
+      ${_GLIB2IncDir}
+      /opt/gnome/lib64/glib-2.0/include
+      /opt/gnome/lib/glib-2.0/include
+      /opt/lib/glib-2.0/include
+      /usr/lib64/glib-2.0/include
+      /usr/lib/glib-2.0/include
+      /sw/lib/glib-2.0/include
+    )
+    #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}")
+
+    FIND_PATH(GTK2_GLIB_INCLUDE_PATH glib.h
+      ${_GLIB2IncDir}
+      /opt/include/glib-2.0
+      /opt/gnome/include/glib-2.0
+      /usr/include/glib-2.0
+      /sw/include/glib-2.0
+    )
+    #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}")
+
+    FIND_PATH(GTK2_GTKGL_INCLUDE_PATH gtkgl/gtkglarea.h
+      ${_GLIB2IncDir}
+      /usr/include
+      /usr/local/include
+      /usr/openwin/share/include
+      /opt/gnome/include
+      /opt/include
+      /sw/include
+    )
+
+    PKGCONFIG(pango _PANGOIncDir _PANGOinkDir _PANGOLinkFlags _PANGOCflags)
+
+    FIND_PATH(GTK2_PANGO_INCLUDE_PATH pango/pango.h
+      ${_PANGOIncDir}
+      /opt/gnome/include/pango-1.0
+      /opt/include/pango-1.0
+      /usr/include/pango-1.0
+      /sw/include/pango-1.0
+    )
+
+    PKGCONFIG(gdk-2.0 _GDK2IncDir _GDK2inkDir _GDK2LinkFlags _GDK2Cflags)
+
+    FIND_PATH(GTK2_GDKCONFIG_INCLUDE_PATH gdkconfig.h
+      ${_GDK2IncDir}
+      /opt/gnome/lib/gtk-2.0/include
+      /opt/gnome/lib64/gtk-2.0/include
+      /opt/lib/gtk-2.0/include
+      /usr/lib/gtk-2.0/include
+      /usr/lib64/gtk-2.0/include
+      /sw/lib/gtk-2.0/include
+    )
+
+    # Dave:
+    FIND_PATH(GTK2_GDK_INCLUDE_PATH gdk.h
+      ${_GDK2IncDir}
+      /usr/include/gtk-2.0
+      /usr/include/gtk-2.0/gdk
+    )
+    #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}")
+
+    PKGCONFIG(cairo _CAIROIncDir _CAIROinkDir _CAIROLinkFlags _CAIROCflags)
+
+    FIND_PATH(GTK2_CAIRO_INCLUDE_PATH cairo.h
+      ${_CAIROIncDir}
+      /opt/gnome/include/cairo
+      /usr/include
+      /usr/include/cairo
+      /opt/include
+      /opt/include/cairo
+      /sw/include
+      /sw/include/cairo
+    )
+    #MESSAGE(STATUS "DEBUG: GTK2_CAIRO_INCLUDE_PATH = ${GTK2_CAIRO_INCLUDE_PATH}")
+
+    PKGCONFIG(atk _ATKIncDir _ATKinkDir _ATKLinkFlags _ATKCflags)
+
+    FIND_PATH(GTK2_ATK_INCLUDE_PATH atk/atk.h
+      ${_ATKIncDir}
+      /opt/gnome/include/atk-1.0
+      /usr/include/atk-1.0
+      /opt/include/atk-1.0
+      /sw/include/atk-1.0
+    )
+    #MESSAGE(STATUS "DEBUG: GTK2_ATK_INCLUDE_PATH = ${GTK2_ATK_INCLUDE_PATH}")
+
+    FIND_LIBRARY(GTK2_GTKGL_LIBRARY
+      NAMES
+        gtkgl
+      PATHS
+        ${_GTK22IncDir}
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+    FIND_LIBRARY(GTK2_GTK_LIBRARY
+      NAMES
+        gtk-x11-2.0
+      PATHS
+        ${_GTK22LinkDir}
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+    FIND_LIBRARY(GTK2_GDK_LIBRARY
+      NAMES
+        gdk-x11-2.0
+      PATHS
+        ${_GDK2LinkDir}
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+    FIND_LIBRARY(GTK2_GMODULE_LIBRARY
+      NAMES
+        gmodule-2.0
+      PATHS
+        ${_GMODULE2inkDir}
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+    FIND_LIBRARY(GTK2_GLIB_LIBRARY
+      NAMES
+        glib-2.0
+      PATHS
+        ${_GLIB2inkDir}
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+    FIND_LIBRARY(GTK2_Xi_LIBRARY 
+      NAMES
+        Xi
+      PATHS 
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+    FIND_LIBRARY(GTK2_GTHREAD_LIBRARY
+      NAMES
+        gthread-2.0
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+
+    FIND_LIBRARY(GTK2_GOBJECT_LIBRARY
+      NAMES
+        gobject-2.0
+      PATHS
+        /usr/lib
+        /usr/local/lib
+        /usr/openwin/lib
+        /usr/X11R6/lib
+        /opt/gnome/lib
+        /opt/lib
+        /sw/lib
+    )
+
+    IF(GTK2_GTK_INCLUDE_PATH)
+      IF(GTK2_GLIBCONFIG_INCLUDE_PATH)
+        IF(GTK2_GLIB_INCLUDE_PATH)
+          IF(GTK2_GTK_LIBRARY)
+            IF(GTK2_GLIB_LIBRARY)
+              IF(GTK2_PANGO_INCLUDE_PATH)
+                IF(GTK2_ATK_INCLUDE_PATH)
+                  IF(GTK2_CAIRO_INCLUDE_PATH)
+                    # Assume that if gtk and glib were found, the other
+                    # supporting libraries have also been found.
+
+                    SET(GTK2_FOUND TRUE)
+
+                    SET(GTK2_INCLUDE_DIRS
+                      ${GTK2_GTK_INCLUDE_PATH}
+                      ${GTK2_GLIBCONFIG_INCLUDE_PATH}
+                      ${GTK2_GLIB_INCLUDE_PATH}
+                      ${GTK2_PANGO_INCLUDE_PATH}
+                      ${GTK2_GDKCONFIG_INCLUDE_PATH}
+                      # Dave:
+                      ${GTK2_GDK_INCLUDE_PATH}
+                      ${GTK2_ATK_INCLUDE_PATH}
+                      ${GTK2_CAIRO_INCLUDE_PATH}
+                    )
+
+                    SET(GTK2_LIBRARIES
+                      ${GTK2_GTK_LIBRARY}
+                      ${GTK2_GDK_LIBRARY}
+                      ${GTK2_GLIB_LIBRARY}
+                    )
+                    #${GTK2_GOBJECT_LIBRARY})
+
+                    IF(GTK2_GMODULE_LIBRARY)
+                      SET(GTK2_LIBRARIES
+                        ${GTK2_LIBRARIES}
+                        ${GTK2_GMODULE_LIBRARY}
+                      )
+                    ENDIF(GTK2_GMODULE_LIBRARY)
+
+                    IF(GTK2_GTHREAD_LIBRARY)
+                      SET(GTK2_LIBRARIES
+                        ${GTK2_LIBRARIES}
+                        ${GTK2_GTHREAD_LIBRARY}
+                      )
+                    SET(GTK2_LIBRARIES ${GTK2_LIBRARIES})
+                    ENDIF(GTK2_GTHREAD_LIBRARY)
+                  ELSE(GTK2_CAIRO_INCLUDE_PATH)
+                    MESSAGE(STATUS "Can not find cairo")
+                  ENDIF(GTK2_CAIRO_INCLUDE_PATH)
+                ELSE(GTK2_ATK_INCLUDE_PATH)
+                  MESSAGE(STATUS "Can not find atk")
+                ENDIF(GTK2_ATK_INCLUDE_PATH)
+              ELSE(GTK2_PANGO_INCLUDE_PATH)
+                MESSAGE(STATUS "Can not find pango includes")
+              ENDIF(GTK2_PANGO_INCLUDE_PATH)
+            ELSE(GTK2_GLIB_LIBRARY)
+              MESSAGE(STATUS "Can not find glib lib")
+            ENDIF(GTK2_GLIB_LIBRARY)
+          ELSE(GTK2_GTK_LIBRARY)
+            MESSAGE(STATUS "Can not find gtk lib")
+          ENDIF(GTK2_GTK_LIBRARY)
+        ELSE(GTK2_GLIB_INCLUDE_PATH)
+          MESSAGE(STATUS "Can not find glib includes")
+        ENDIF(GTK2_GLIB_INCLUDE_PATH)
+      ELSE(GTK2_GLIBCONFIG_INCLUDE_PATH)
+        MESSAGE(STATUS "Can not find glibconfig")
+      ENDIF(GTK2_GLIBCONFIG_INCLUDE_PATH)
+    ELSE (GTK2_GTK_INCLUDE_PATH)
+      MESSAGE(STATUS "Can not find gtk includes")
+    ENDIF (GTK2_GTK_INCLUDE_PATH)
+
+    IF (GTK2_FOUND)
+      IF (NOT GTK2_FIND_QUIETLY)
+        MESSAGE(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
+      ENDIF (NOT GTK2_FIND_QUIETLY)
+    ELSE (GTK2_FOUND)
+      IF (GTK2_FIND_REQUIRED)
+        MESSAGE(SEND_ERROR "Could NOT find GTK2")
+      ENDIF (GTK2_FIND_REQUIRED)
+    ENDIF (GTK2_FOUND)
+
+    MARK_AS_ADVANCED(
+      GTK2_GDK_LIBRARY
+      GTK2_GLIB_INCLUDE_PATH
+      GTK2_GLIB_LIBRARY
+      GTK2_GLIBCONFIG_INCLUDE_PATH
+      GTK2_GMODULE_LIBRARY
+      GTK2_GTHREAD_LIBRARY
+      GTK2_Xi_LIBRARY
+      GTK2_GTK_INCLUDE_PATH
+      GTK2_GTK_LIBRARY
+      GTK2_GTKGL_INCLUDE_PATH
+      GTK2_GTKGL_LIBRARY
+      GTK2_ATK_INCLUDE_PATH
+      GTK2_GDKCONFIG_INCLUDE_PATH
+      # Dave:
+      GTK2_GDK_INCLUDE_PATH
+      #GTK2_GOBJECT_LIBRARY
+      GTK2_PANGO_INCLUDE_PATH
+      # LG :
+      GTK2_CAIRO_INCLUDE_PATH
+      GTK2_GOBJECT_LIBRARY
+    )
+  ENDIF(UNIX)
+ENDIF (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
+
diff --git a/kernel/cmake/BBTKFindLibraries.cmake b/kernel/cmake/BBTKFindLibraries.cmake
new file mode 100644
index 0000000..96ff1c8
--- /dev/null
+++ b/kernel/cmake/BBTKFindLibraries.cmake
@@ -0,0 +1,179 @@
+#-----------------------------------------------------------------------------
+#OPTION(USE_VTK "Build VTK-based black boxes" OFF)
+IF(USE_VTK)
+  # Search VTK
+  FIND_PACKAGE(VTK)
+  # If vtk found
+  IF(VTK_FOUND)
+    MESSAGE ( STATUS "VTK FOUND - VERSION = ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
+    INCLUDE(${VTK_USE_FILE})
+    ADD_DEF( _USE_VTK_ )
+    SET(BBTK_VTK_LIBRARIES
+      #     vtkCommon 
+      vtkImaging  vtkGraphics vtkRendering vtkFiltering vtkCommon vtkWidgets
+      # LG : removed vtkIO because conflict with itktiff lib in ITKIO 
+      ) 
+    MARK_AS_ADVANCED(VTK_DIR)
+  ENDIF(VTK_FOUND)
+ENDIF(USE_VTK)
+#-----------------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------------
+#OPTION(USE_ITK "Build ITK-based black boxes" OFF)
+IF(USE_ITK)
+  # Search ITK
+  FIND_PACKAGE(ITK)
+  # If itk found
+  IF(ITK_FOUND)
+     MESSAGE ( STATUS "ITK FOUND - VERSION = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
+    INCLUDE(${ITK_USE_FILE})
+    ADD_DEF( _USE_ITK_ )
+    SET(BBTK_ITK_LIBRARIES
+      ITKCommon ITKIO ITKBasicFilters ITKAlgorithms
+      )  
+    MARK_AS_ADVANCED(ITK_DIR)
+   # images compilation option 
+    OPTION ( itk_IMAGE_DIM_2 "itk : Compile 2D images" ON)
+    OPTION ( itk_IMAGE_DIM_3 "itk : Compile 3D images" ON)
+    OPTION ( itk_IMAGE_DIM_4 "itk : Compile 4D images" ON)
+    OPTION ( itk_IMAGE_TYPE_CHAR "itk : Compile char images" ON)
+    OPTION ( itk_IMAGE_TYPE_UCHAR "itk : Compile unsigned char images" ON)
+    OPTION ( itk_IMAGE_TYPE_SHORT "itk : Compile short images" ON)
+    OPTION ( itk_IMAGE_TYPE_USHORT "itk : Compile unsigned short images" ON)
+    OPTION ( itk_IMAGE_TYPE_INT "itk : Compile int images" ON)
+    OPTION ( itk_IMAGE_TYPE_UINT "itk : Compile unsigned int images" ON)
+    OPTION ( itk_IMAGE_TYPE_FLOAT "itk : Compile float images" ON)
+    OPTION ( itk_IMAGE_TYPE_DOUBLE "itk : Compile double images" ON)
+    
+    IF ( itk_IMAGE_DIM_2 ) 
+      ADD_DEF( BBTK_ITK_IMAGE_DIM_2 )
+    ENDIF ( itk_IMAGE_DIM_2 )
+    
+    IF ( itk_IMAGE_DIM_3 ) 
+      ADD_DEF( BBTK_ITK_IMAGE_DIM_3 )
+    ENDIF ( itk_IMAGE_DIM_3 )
+    
+    IF ( itk_IMAGE_DIM_4 ) 
+      ADD_DEF( BBTK_ITK_IMAGE_DIM_4 )
+    ENDIF ( itk_IMAGE_DIM_4 )
+
+    IF ( itk_IMAGE_TYPE_CHAR ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_int8_t )
+    ENDIF ( itk_IMAGE_TYPE_CHAR )
+
+    IF ( itk_IMAGE_TYPE_UCHAR ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_uint8_t )
+    ENDIF ( itk_IMAGE_TYPE_UCHAR )
+    
+    IF ( itk_IMAGE_TYPE_SHORT ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_int16_t )
+    ENDIF ( itk_IMAGE_TYPE_SHORT )
+    
+    IF ( itk_IMAGE_TYPE_USHORT ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_uint16_t )
+    ENDIF ( itk_IMAGE_TYPE_USHORT )
+    
+    IF ( itk_IMAGE_TYPE_INT ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_int32_t )
+    ENDIF ( itk_IMAGE_TYPE_INT )
+    
+    IF ( itk_IMAGE_TYPE_UINT ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_uint32_t )
+    ENDIF ( itk_IMAGE_TYPE_UINT )
+    
+    IF ( itk_IMAGE_TYPE_FLOAT ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_float )
+    ENDIF ( itk_IMAGE_TYPE_FLOAT )
+    
+    IF ( itk_IMAGE_TYPE_DOUBLE ) 
+      ADD_DEF( BBTK_ITK_IMAGE_TYPE_double )
+    ENDIF ( itk_IMAGE_TYPE_DOUBLE )
+  ENDIF(ITK_FOUND)
+ENDIF(USE_ITK)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+#OPTION(USE_GDCM "Build GDCM-based black boxes" OFF)
+IF(USE_GDCM)
+  # Search GDCM
+  FIND_PACKAGE(GDCM)
+  # If gdcm found
+  IF(GDCM_FOUND)
+    INCLUDE(${GDCM_USE_FILE})
+    ADD_DEF( _USE_GDCM_ )
+    
+    SET(BBTK_GDCM_LIBRARIES
+# TO DO : USE GDCM LINK LIBRARIES !!!
+      libgdcm libgdcmjpeg8 libgdcmjpeg12libgdcmjpeg16
+      )
+  ENDIF(GDCM_FOUND)
+ENDIF(USE_GDCM)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+#OPTION(USE_WXWIDGETS "Build wxWidgets-based black boxes" OFF)
+IF(USE_WXWIDGETS)
+
+IF(WIN32)
+  # Search WXWIDGETS
+
+  #  WXWINDOWS_LIBRARY         = full path to the wxWindows library and linker flags on unix
+  #  CMAKE_WX_CXX_FLAGS        = compiler flags for building wxWindows 
+  #  WXWINDOWS_INCLUDE_PATH    = include path of wxWindows
+  SET(WXWINDOWS_USE_GL 1)
+
+  #wxWidgets build related stuff
+  SET(WXW_USE_DEBUG ON)
+  SET(WXW_USE_UNICODE OFF)
+  SET(WXW_USE_SHARED ON)
+  SET(WXW_USE_UNIV OFF)
+  SET(WXW_USE_MONO OFF)
+  SET(WXW_FILE_VERSION "28")
+  SET(WXW_VERSION "2.8")
+
+  #CMake Options
+  # Why forcing verbosity ?
+  # SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+
+  INCLUDE (${BBTK_DIR}/BBTKFindWX_WIN)
+  #
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
+  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
+  ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS}  )
+  #
+  INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
+  LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
+  SET(THE_WXWIDGETS_LIBRARIES
+    ${WXWIDGETS_LIBRARIES}     
+    debug msvcrtd
+    debug msvcprtd
+    optimized msvcrt
+    optimized msvcprt
+    )
+ENDIF(WIN32)
+IF(UNIX)
+  # GTK2
+  INCLUDE(${BBTK_DIR}/BBTKFindGTK2.cmake)
+  INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
+  LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
+  LINK_LIBRARIES(${GTK2_LIBRARIES})
+  # WX
+  # LG : Do not force but use what is installed !
+  # SET(wxWidgets_USE_LIBS base core gl)
+  FIND_PACKAGE( wxWidgets REQUIRED) 
+  INCLUDE( ${wxWidgets_USE_FILE} )
+  MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
+  SET(THE_WXWIDGETS_LIBRARIES
+    ${GTK2_LIBRARIES}
+    ${wxWidgets_LIBRARIES}
+   )
+ENDIF(UNIX)
+
+ADD_DEF( _USE_WXWIDGETS_ )
+SET(BBTK_WXWIDGETS_LIBRARIES
+  ${THE_WXWIDGETS_LIBRARIES}
+  )
+
+ENDIF(USE_WXWIDGETS)
+#-----------------------------------------------------------------------------
diff --git a/kernel/cmake/BBTKFindWX_WIN.cmake b/kernel/cmake/BBTKFindWX_WIN.cmake
new file mode 100644
index 0000000..a03d731
--- /dev/null
+++ b/kernel/cmake/BBTKFindWX_WIN.cmake
@@ -0,0 +1,573 @@
+#
+# FindwxW.cmake
+# v1.06 2006-03-27
+# Jerry Fath 2005
+# Based on work by Jorgen Bodde
+#
+# This module finds if wxWindows is installed and determines where the
+# include files and libraries are. It also determines what the name of
+# the library is. This code sets the following variables:
+#
+#  WXWIDGETS_FOUND =     wxWidgets was found
+#  WXWIDGETS_ROOT_DIR =  base wxWidgets directory
+#  WXWIDGETS_LINK_DIRECTORIES = link directories, useful for rpath on Unix
+#  WXWIDGETS_LIBRARIES       = all the wxWindows libraries ( and  linker flags on unix )
+#  WXWIDGETS_CXX_FLAGS        = compiler flags for building wxWindows
+#  WXWIDGETS_EXE_LINKER_FLAGS  = compiler flags for building wxWindows
+#  WXWIDGETS_INCLUDE_DIR    = all include path of wxWindows
+#  WXWIDGETS_DEFINITIONS  = all flags of wxWindows
+#
+#  WXWIDGETS_RELEASE_LIBRARIES       = release wxWindows libraries (Win32 only)
+#  WXWIDGETS_DEBUG_LIBRARIES       = debug wxWindows libraries (Win32 only)
+#  WXWIDGETS_COMMON_LIBRARIES  = libraries common to Release and Debug (Win32 only)
+
+# NOTE: This module REQUIRES that an environment variable named WXWIN
+# be set to the base wxWidgets installation directory.
+# Under Unix, you must also set and environment variable named WXWINCFG
+# to the name of the active build subdirectory (eg buildgtk).  As an alternative
+# to the WXWINCFG environment variable, you can set a sym link in the wxWidgets
+# root directory called wx-config which points to the active build subdirectory.
+#
+
+# These variable should be set before including this module
+#
+# WXWIDGETS_FILE_VERSION (26)
+# WXWIDGETS_VERSION (2.6)
+#
+#
+
+####################### EXAMPLE CMakeLists.txt ###################
+#
+##Required project specific settings
+#PROJECT( myprojectname )
+#SET(PROJECT_SOURCE_FILES  myfile.cpp myfile2.cpp)
+#IF( WIN32)
+#    SET(PROJECT_RC_FILE myresfile.rc)
+#ELSE( WIN32)
+#    SET(PROJECT_RC_FILE "")
+#ENDIF( WIN32)
+#
+##Optional project specific settings
+#SET(PROJECT_DEFINITIONS -D_MYPROJECT_ -D_MYPROJECT2_)
+#SET(PROJECT_INCLUDE_PATH e:/myproject/include e:/myproject2/include)
+#SET(PROJECT_LINK_DIRECTORIES e:/myproject/lib e:/myproject2/lib)
+#SET(PROJECT_LIBRARIES myprojectlib myproject2lib)
+#
+##wxWidgets build related stuff
+#SET(WXW_USE_DEBUG OFF)
+#SET(WXW_USE_UNICODE OFF)
+#SET(WXW_USE_SHARED OFF)
+#SET(WXW_USE_UNIV OFF)
+#SET(WXW_USE_MONO OFF)
+#SET(WXW_FILE_VERSION "26")
+#SET(WXW_VERSION "2.6")
+#
+#INCLUDE (FindwxW)
+#INCLUDE (UsewxW)
+#
+####################### END EXAMPLE CMakeLists.txt ###################
+
+#
+# Set WX_USE vars in CMakeLists if you don't want to default to all off
+#
+SET(WXWIDGETS_USE_DEBUG ${WXW_USE_DEBUG} CACHE BOOL "Use Debug versions of wxWindows libraries")
+SET(WXWIDGETS_USE_UNICODE ${WXW_USE_UNICODE} CACHE BOOL "Use Unicode versions of wxWindows libraries")
+SET(WXWIDGETS_USE_SHARED ${WXW_USE_SHARED} CACHE BOOL "Use shared versions of wxWindows libraries")
+SET(WXWIDGETS_USE_UNIV ${WXW_USE_UNIV} CACHE BOOL "Use Universal versions of wxWindows libraries")
+SET(WXWIDGETS_USE_MONO ${WXW_USE_MONO} CACHE BOOL "Use monolithic versions of wxWindows libraries")
+
+#
+# Style can be non-Win32 even under Windows when using MinGW
+#
+IF(WIN32)
+  SET(WIN32_STYLE_FIND 1)
+ENDIF(WIN32)
+IF(MINGW)
+  SET(WIN32_STYLE_FIND 0)
+  SET(UNIX_STYLE_FIND 1)
+ENDIF(MINGW)
+IF(UNIX)
+  SET(UNIX_STYLE_FIND 1)
+ENDIF(UNIX)
+
+#
+# Versions should be set before this file is included.  If not,
+# default to 2.6
+#
+IF(WXW_FILE_VERSION)
+  SET( WXVERSIONSUFFIX ${WXW_FILE_VERSION})
+ELSE(WXW_FILE_VERSION)
+  SET( WXVERSIONSUFFIX "26")
+ENDIF(WXW_FILE_VERSION)
+
+IF(WXW_VERSION)
+  SET( WXVERSION ${WXW_VERSION})
+ELSE(WXW_VERSION)
+  SET( WXVERSION "2.6")
+ENDIF(WXW_VERSION)
+
+#
+# Find the base wxWidgets install path
+# NOTE: WXWIN must be set
+#
+FIND_PATH( WXWIDGETS_ROOT_DIR
+   wx-config.in
+   $ENV{WXWIN}
+)
+IF(WXWIDGETS_ROOT_DIR STREQUAL "WXWIDGETS_ROOT_DIR-NOTFOUND")
+    MESSAGE( FATAL_ERROR "FATAL_ERROR: wx-config.in NOT found.  Set WXWIN")
+ENDIF(WXWIDGETS_ROOT_DIR STREQUAL "WXWIDGETS_ROOT_DIR-NOTFOUND")
+SET(WXWIDGETS_CONFIG_PATH ${WXWIDGETS_ROOT_DIR})
+
+#
+# Find library path (platform specific)
+#
+IF( WIN32_STYLE_FIND )
+
+    IF( WXWIDGETS_USE_SHARED )
+        SET(WXWIDGETS_LIB_PATH "${WXWIDGETS_ROOT_DIR}/lib/vc_dll" )
+    ELSE( WXWIDGETS_USE_SHARED )
+        SET(WXWIDGETS_LIB_PATH "${WXWIDGETS_ROOT_DIR}/lib/vc_lib" )
+    ENDIF( WXWIDGETS_USE_SHARED )
+    SET( WXWIDGETS_LINK_DIRECTORIES ${WXWIDGETS_LIB_PATH} )
+
+ELSE( WIN32_STYLE_FIND )
+  IF (UNIX_STYLE_FIND) 
+
+    #
+    # Unix uses a config specific directory under the install path
+    # specified in the WXWINCFG environment variable.
+    # If the WXWINCFG variable isn't set, we try a sym link within
+    # the WX root dir called wx-config, or the current PATH
+    #
+    FIND_PROGRAM( WX_WXCONFIG_EXECUTABLE
+                    wx-config
+                    "${WXWIDGETS_ROOT_DIR}/$ENV{WXWINCFG}"
+                    "${WXWIDGETS_ROOT_DIR}/wx-config" )
+    #
+    # Check wether wx-config can be found
+    #
+    IF(NOT EXISTS ${WX_WXCONFIG_EXECUTABLE})    
+      # we really need wx-config...
+      MESSAGE(FATAL_ERROR "FATAL_ERROR: Cannot find wx-config. Set WXWIN and WXWINCFG environment variables.")
+    ENDIF(NOT EXISTS ${WX_WXCONFIG_EXECUTABLE})    
+
+    GET_FILENAME_COMPONENT( WXWIDGETS_CONFIG_PATH
+                            WX_WXCONFIG_EXECUTABLE
+                            PATH )
+
+    SET(WXWIDGETS_LIB_PATH "${WXWIDGETS_CONFIG_PATH}/lib" )
+    SET( WXWIDGETS_LINK_DIRECTORIES ${WXWIDGETS_LIB_PATH} )
+
+  ELSE(UNIX_STYLE_FIND)
+    MESSAGE(FATAL_ERROR "FATAL_ERROR: FindwxWindows.cmake:  Platform unsupported by FindwxW.cmake. It's neither WIN32 nor UNIX")
+  ENDIF(UNIX_STYLE_FIND)
+ENDIF( WIN32_STYLE_FIND )
+
+#
+# Check options against installed libraries
+#
+SET(WX_CONFIG_ARGS "")
+SET( LIBRARYWANT  "${WXWIDGETS_LIB_PATH}/msw" )
+
+IF( WXWIDGETS_USE_UNIV )
+    SET( LIBRARYWANT "${LIBRARYWANT}univ")
+    SET( PFUNIV  "univ" )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --universal=yes")
+ELSE( WXWIDGETS_USE_UNIV )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --universal=no")
+ENDIF( WXWIDGETS_USE_UNIV )
+
+IF( WXWIDGETS_USE_UNICODE )
+    SET( LIBRARYWANT "${LIBRARYWANT}u" )
+    SET( PFUNICODE "u" )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --unicode=yes")
+ELSE( WXWIDGETS_USE_UNICODE )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --unicode=no")
+ENDIF( WXWIDGETS_USE_UNICODE )
+
+IF( WXWIDGETS_USE_DEBUG )
+    SET( PFDEBUG "d" )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --debug=yes")
+ELSE( WXWIDGETS_USE_DEBUG )
+    SET( PFDEBUG "" )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --debug=no")
+ENDIF( WXWIDGETS_USE_DEBUG )
+
+IF( WXWIDGETS_USE_SHARED )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --static=no")
+ELSE( WXWIDGETS_USE_SHARED )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS} --static=yes")
+ENDIF( WXWIDGETS_USE_SHARED )
+
+# Not sure how to check this yet!!!!!
+IF( WXWIDGETS_USE_MONO )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS}")
+ELSE( WXWIDGETS_USE_MONO )
+    SET(WX_CONFIG_ARGS "${WX_CONFIG_ARGS}")
+ENDIF( WXWIDGETS_USE_MONO )
+
+SET(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS} --libs")
+
+#
+# Platform specific method for testing installed wx Builds
+#
+IF( WIN32_STYLE_FIND )
+
+    #
+    # See if we have both release and debug wx versions
+    #
+    SET ( WX_DEBUGANDRELEASE FALSE )
+    IF( EXISTS "${LIBRARYWANT}/wx/setup.h" )
+        IF( EXISTS "${LIBRARYWANT}d/wx/setup.h" )
+            SET ( WX_DEBUGANDRELEASE TRUE )
+        ENDIF( EXISTS "${LIBRARYWANT}d/wx/setup.h" )
+    ENDIF( EXISTS "${LIBRARYWANT}/wx/setup.h" )
+
+    SET( LIBRARYWANT "${LIBRARYWANT}${PFDEBUG}" )
+    IF( NOT EXISTS "${LIBRARYWANT}/wx/setup.h" )
+        MESSAGE( SEND_ERROR "ERROR: WXWidgets config NOT found ${WX_CONFIG_ARGS}")
+    ENDIF( NOT EXISTS "${LIBRARYWANT}/wx/setup.h" )
+
+ELSE( WIN32_STYLE_FIND )
+
+    EXEC_PROGRAM(${WX_WXCONFIG_EXECUTABLE}
+        ARGS ${WX_CONFIG_ARGS_LIBS}
+        OUTPUT_VARIABLE WXWIDGETS_LIBRARIES
+        RETURN_VALUE BAD_WXCONFIG )
+    IF(BAD_WXCONFIG)
+        MESSAGE( SEND_ERROR "ERROR: WXWidgets config NOT found ${WX_CONFIG_ARGS}")
+    ENDIF(BAD_WXCONFIG)
+
+ENDIF( WIN32_STYLE_FIND )
+
+#
+#  Get compiler flags
+#
+IF( WIN32_STYLE_FIND )
+    # Not used for Windows
+    SET( WXWIDGETS_CXX_FLAGS "" )
+ELSE( WIN32_STYLE_FIND )
+    #
+    # Get CXXFLAGS from wx-config
+    #
+    EXEC_PROGRAM(${WX_WXCONFIG_EXECUTABLE}
+      ARGS "--cxxflags"
+      OUTPUT_VARIABLE WXWIDGETS_CXX_FLAGS
+      RETURN_VALUE BAD_WXCONFIG )
+    IF (BAD_WXCONFIG)
+      MESSAGE( SEND_ERROR "ERROR: wx-config --cxxflags returned an error")
+    ENDIF (BAD_WXCONFIG)
+ENDIF( WIN32_STYLE_FIND )
+
+#
+# Find include directories (platform specific)
+#
+IF( WIN32_STYLE_FIND )
+    #
+    # Set non-build specific include directories
+    #
+    SET ( WX_INCLUDE_PATH ${WXWIDGETS_ROOT_DIR}/include )
+    SET ( WXWIDGETS_INCLUDE_DIR ${WX_INCLUDE_PATH} )
+    SET( WXWIDGETS_INCLUDE_DIR ${WXWIDGETS_INCLUDE_DIR} ${WXWIDGETS_INCLUDE_DIR}/../contrib/include )
+    #
+    # Append the build specific include dir for wx/setup.h:
+    #
+    IF ( EXISTS ${LIBRARYWANT}/wx/setup.h )
+        SET( WX_INCLUDE_LIB_PATH ${LIBRARYWANT})
+        SET( WXWIDGETS_INCLUDE_DIR  ${WXWIDGETS_INCLUDE_DIR}  ${LIBRARYWANT} )
+    ELSE ( EXISTS ${LIBRARYWANT}/wx/setup.h )
+        SET( WX_INCLUDE_LIB_PATH, "")
+        MESSAGE(SEND_ERROR "ERROR: Can't find ${LIBRARYWANT}/wx/setup.h")
+    ENDIF ( EXISTS ${LIBRARYWANT}/wx/setup.h )
+
+ELSE( WIN32_STYLE_FIND )
+
+    # Pull out -I options
+    # evaluate wx-config output to separate include dirs
+    SET(WX_INCLUDE_DIR ${WXWIDGETS_CXX_FLAGS})
+    # extract include dirs (-I)
+    # use regular expression to match wildcard equivalent "-I*"
+    # with  is a space or a semicolon
+    STRING(REGEX MATCHALL "[-][I]([^ ;])+" WX_INCLUDE_DIRS_WITH_PREFIX "${WX_INCLUDE_DIR}" )
+    # remove prefix -I because we need the pure directory
+    IF(WX_INCLUDE_DIRS_WITH_PREFIX)
+      STRING(REGEX REPLACE "[-][I]" ";" WXWIDGETS_INCLUDE_DIR ${WX_INCLUDE_DIRS_WITH_PREFIX} )
+    ENDIF(WX_INCLUDE_DIRS_WITH_PREFIX)
+    # replace space separated string by semicolon separated vector
+    SEPARATE_ARGUMENTS(WXWIDGETS_INCLUDE_DIR)
+    # Remove the -I options from the CXX_FLAGS no need to duplicate
+    STRING(REGEX REPLACE "[-][I]([^ ;])+" "" WXWIDGETS_CXX_FLAGS ${WXWIDGETS_CXX_FLAGS} )
+
+    #
+    # Find XWindows
+    #
+    IF( NOT CYGWIN OR MINGW )
+        INCLUDE( ${CMAKE_ROOT}/Modules/FindX11.cmake )
+        SET( WXWIDGETS_INCLUDE_DIR ${WXWIDGETS_INCLUDE_DIR}  ${X11_INCLUDE_DIR} )
+    ENDIF( NOT CYGWIN OR MINGW )
+ENDIF( WIN32_STYLE_FIND )
+
+#
+# Find library list (platform specific)
+#
+IF( WIN32_STYLE_FIND )
+    #
+    #Misc vars used to build lib names
+    #
+    SET( PFLIBEXT ${CMAKE_STATIC_LIBRARY_SUFFIX} )
+    SET( WXPF "${WXPF}${WXVERSIONSUFFIX}" )
+    SET( PFVERSION ${WXVERSIONSUFFIX} )
+    SET( PFCOMPILER "" )
+
+    #
+    # Build the libraries list
+    #
+    SET( WX_TOKEN_LIBS "" )
+    SET( WX_MULTI_LIBRARIES "" )
+    SET( WX_MONO_LIBRARIES "" )
+    SET( WX_DEBUG_TOKEN "@1" )
+
+    #start filling library string with needed libraries for the choosen configuration.
+    #note we use tokens for debug/release and the debug suffix so we can replace later
+    SET( WXPF "${PFVERSION}${PFUNICODE}${WX_DEBUG_TOKEN}" )
+    SET(WX_MULTI_LIBRARIES ${WX_MULTI_LIBRARIES}
+        wxbase${WXPF}${PFCOMPILER}${PFLIBEXT}
+        wxbase${WXPF}_net${PFCOMPILER}${PFLIBEXT}
+        wxbase${WXPF}_xml${PFCOMPILER}${PFLIBEXT}
+    )
+
+    SET( WXPF "${PFVERSION}${PFUNICODE}${WX_DEBUG_TOKEN}" )
+    SET(WX_MULTI_LIBRARIES ${WX_MULTI_LIBRARIES}
+        wxmsw${WXPF}_adv${PFCOMPILER}${PFLIBEXT}
+        wxmsw${WXPF}_core${PFCOMPILER}${PFLIBEXT}
+        wxmsw${WXPF}_html${PFCOMPILER}${PFLIBEXT}
+        wxmsw${WXPF}_xrc${PFCOMPILER}${PFLIBEXT}
+    )
+    IF (WXWIDGETS_USE_MEDIA)
+        SET(WX_MULTI_LIBRARIES ${WX_MULTI_LIBRARIES}
+            wxmsw${WXPF}_media${PFCOMPILER}${PFLIBEXT}
+        )
+    ENDIF (WXWIDGETS_USE_MEDIA)
+
+    IF( NOT WXWIDGETS_USE_SHARED )
+        SET( WXPF "${PFVERSION}${PFUNICODE}${WX_DEBUG_TOKEN}" )
+        IF (WXWIDGETS_USE_ODBC)
+            SET(WX_MULTI_LIBRARIES ${WX_MULTI_LIBRARIES}
+                wxbase${WXPF}_odbc${PFCOMPILER}${PFLIBEXT}
+             )
+        ENDIF (WXWIDGETS_USE_ODBC)
+
+        SET( WXPF "${PFVERSION}${PFUNICODE}${WX_DEBUG_TOKEN}" )
+        IF (WXWIDGETS_USE_DBGRID)
+            SET(WX_MULTI_LIBRARIES ${WX_MULTI_LIBRARIES}
+                wxmsw${WXPF}_dbgrid${PFLIBEXT}
+            )
+        ENDIF (WXWIDGETS_USE_DBGRID)
+        IF (WXWIDGETS_USE_GL)
+            SET(WX_MULTI_LIBRARIES ${WX_MULTI_LIBRARIES}
+                wxmsw${WXPF}_gl${PFCOMPILER}${PFLIBEXT}
+            )
+        ENDIF (WXWIDGETS_USE_GL)
+    ENDIF( NOT WXWIDGETS_USE_SHARED )
+
+    IF ( WXWIDGETS_USE_UNIV )
+        SET( WXPF "${PFUNIV}${PFVERSION}${PFUNICODE}${WX_DEBUG_TOKEN}" )
+        SET(WX_MULTI_LIBRARIES ${WX_MULTI_LIBRARIES}
+            wxmsw${WXPF}_core${PFCOMPILER}${PFLIBEXT}
+        )
+    ENDIF ( WXWIDGETS_USE_UNIV )
+
+    SET(WX_MONO_LIBRARIES ${WX_MONO_LIBRARIES}
+        wxmsw${WXPF}${PFCOMPILER}${PFLIBEXT}
+    )
+
+    IF ( WXWIDGETS_USE_MONO )
+        SET(WX_TOKEN_LIBS ${WX_TOKEN_LIBS} ${WX_MONO_LIBRARIES})
+    ELSE ( WXWIDGETS_USE_MONO )
+        SET(WX_TOKEN_LIBS ${WX_TOKEN_LIBS} ${WX_MULTI_LIBRARIES})
+    ENDIF ( WXWIDGETS_USE_MONO )
+
+    SET( WXPF "${PFUNICODE}${WX_DEBUG_TOKEN}" )
+    SET(WX_TOKEN_LIBS ${WX_TOKEN_LIBS}
+        wxregex${WXPF}.lib
+    )
+
+    SET( WXPF "${WX_DEBUG_TOKEN}" )
+    SET(WX_TOKEN_LIBS ${WX_TOKEN_LIBS}
+            wxexpat${WXPF}.lib
+            wxpng${WXPF}.lib
+            wxtiff${WXPF}.lib
+            wxjpeg${WXPF}.lib
+            wxzlib${WXPF}.lib
+    )
+
+
+    SET( WXWIDGETS_COMMON_LIBRARIES 
+        comctl32${PFLIBEXT} wsock32${PFLIBEXT} rpcrt4${PFLIBEXT}
+    )
+    #
+    #Build release/debug lists by replacing tokens
+    #
+    SET( WXWIDGETS_RELEASE_LIBRARIES "" )
+    FOREACH(LOOPLIB ${WX_TOKEN_LIBS})
+        SET(WX_TMPLIB ${LOOPLIB})
+        STRING(REGEX REPLACE "[@][1]" "" WX_TMPLIB ${WX_TMPLIB} )
+        SET( WXWIDGETS_RELEASE_LIBRARIES ${WXWIDGETS_RELEASE_LIBRARIES}
+            ${WX_TMPLIB}
+        ) 
+    ENDFOREACH(LOOPLIB ${WX_TOKEN_LIBS})
+    SET( WXWIDGETS_DEBUG_LIBRARIES "" )
+    FOREACH(LOOPLIB ${WX_TOKEN_LIBS})
+        SET(WX_TMPLIB ${LOOPLIB})
+        STRING(REGEX REPLACE "[@][1]" "d" WX_TMPLIB ${WX_TMPLIB} )
+        SET( WXWIDGETS_DEBUG_LIBRARIES ${WXWIDGETS_DEBUG_LIBRARIES}
+            ${WX_TMPLIB}
+        ) 
+    ENDFOREACH(LOOPLIB ${WX_TOKEN_LIBS})
+
+    #
+    # Set full lib list to requested type
+    #
+    IF( WXWIDGETS_USE_DEBUG )
+        SET( WXWIDGETS_LIBRARIES ${WXWIDGETS_COMMON_LIBRARIES}
+            ${WXWIDGETS_DEBUG_LIBRARIES}
+        ) 
+    ELSE( WXWIDGETS_USE_DEBUG )
+        SET( WXWIDGETS_LIBRARIES ${WXWIDGETS_COMMON_LIBRARIES}
+            ${WXWIDGETS_RELEASE_LIBRARIES}
+        ) 
+    ENDIF( WXWIDGETS_USE_DEBUG )
+
+    #Not used under Windows
+    SET( WXWIDGETS_EXE_LINKER_FLAGS "" )
+
+ELSE( WIN32_STYLE_FIND )
+    #
+    # Get Library list from wx-config
+    #
+    # do we need additionial wx GL stuff like GLCanvas ?
+    IF(WXWIDGETS_USE_GL)
+      SET(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" )
+    ENDIF(WXWIDGETS_USE_GL)
+      
+    EXEC_PROGRAM(${WX_WXCONFIG_EXECUTABLE}
+      ARGS ${WX_CONFIG_ARGS_LIBS}
+      OUTPUT_VARIABLE WX_CONFIGARGS
+      RETURN_VALUE BAD_WXCONFIG )
+    IF (BAD_WXCONFIG)
+      MESSAGE( SEND_ERROR "ERROR: Specified WXWidgets config NOT found")
+    ENDIF (BAD_WXCONFIG)
+      
+    #Pull lib dirs, linker opts, and libs from wx-config --libs return
+    SET(WXWIDGETS_LINK_DIRECTORIES "")
+    SET(WXWIDGETS_EXE_LINKER_FLAGS "")
+    SET(WXWIDGETS_LIBRARIES "")
+    SEPARATE_ARGUMENTS(WX_CONFIGARGS)
+    FILE( WRITE "${PROJECT_BINARY_DIR}/findwxw-args.log" "WXWIDGETS ARGS\n" )
+    FOREACH(WXARG ${WX_CONFIGARGS})
+      FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw-args.log" "WXARG: ${WXARG}\n" )
+      IF(WXARG MATCHES "^-L")
+        SET(WXWIDGETS_LINK_DIRECTORIES ${WXWIDGETS_LINK_DIRECTORIES} ${WXARG})
+      ELSE(WXARG MATCHES "^-L")
+        IF(WXARG MATCHES "^-l")
+          SET(WXWIDGETS_LIBRARIES "${WXWIDGETS_LIBRARIES} ${WXARG}")
+        ELSE(WXARG MATCHES "^-l")
+          IF(WXARG MATCHES "^-")
+            SET(WXWIDGETS_EXE_LINKER_FLAGS "${WXWIDGETS_EXE_LINKER_FLAGS} ${WXARG}")
+          ELSE(WXARG MATCHES "^-")
+            SET(WXWIDGETS_LIBRARIES "${WXWIDGETS_LIBRARIES} ${WXARG}")
+          ENDIF(WXARG MATCHES "^-")
+        ENDIF(WXARG MATCHES "^-l")
+      ENDIF(WXARG MATCHES "^-L")
+    ENDFOREACH(WXARG ${WX_CONFIGARGS})
+
+    #Separate library names with ;
+    SEPARATE_ARGUMENTS(WXWIDGETS_LIBRARIES)
+
+    # remove prefix -L because we need the pure directory for LINK_DIRECTORIES
+    # replace -L by ; because the separator seems to be lost otherwise (bug or
+    # feature?)
+    SET(WX_LINK_DIRECTORIES_WITH_PREFIX ${WXWIDGETS_LINK_DIRECTORIES})
+    IF(WX_LINK_DIRECTORIES_WITH_PREFIX)
+      STRING(REGEX REPLACE "[-][L]" ";" WXWIDGETS_LINK_DIRECTORIES ${WX_LINK_DIRECTORIES_WITH_PREFIX} )
+      #MESSAGE("DBG  WXWIDGETS_LINK_DIRECTORIES=${WXWIDGETS_LINK_DIRECTORIES}")
+    ENDIF(WX_LINK_DIRECTORIES_WITH_PREFIX)
+    # replace space separated string by semicolon separated vector to make it
+    # work with LINK_DIRECTORIES
+    SEPARATE_ARGUMENTS(WXWIDGETS_LINK_DIRECTORIES)
+
+
+    #
+    # Unix puts all the libs in the WXWIDGETS_LIBRARIES var
+    # We don't know debug/release libs under unix, so we set the
+    # common var to full set as well and leave debug/release sets blank
+    #
+    SET( WXWIDGETS_RELEASE_LIBRARIES "" )
+    SET( WXWIDGETS_DEBUG_LIBRARIES "" )
+    SET(WXWIDGETS_COMMON_LIBRARIES ${WXWIDGETS_LIBRARIES})
+
+ENDIF( WIN32_STYLE_FIND )
+
+
+#
+# Find wx.rc
+#
+SET( WXWIDGETS_RC ${WXWIDGETS_ROOT_DIR}/include/wx/msw/wx.rc )
+IF( NOT WIN32_STYLE_FIND )
+    IF( NOT CYGWIN OR MINGW )
+        SET( WXWIDGETS_RC "" )
+    ENDIF( NOT CYGWIN OR MINGW )
+ENDIF( NOT WIN32_STYLE_FIND )
+
+#
+# Set preprocessor defs
+#
+STRING(TOUPPER ${CMAKE_SYSTEM_NAME} WX_SYSNAME)
+SET( WXWIDGETS_DEFINITIONS ${WXWIDGETS_DEFINITIONS} "-D${WX_SYSNAME}" )
+
+IF(WIN32_STYLE_FIND)
+    SET( WXWIDGETS_DEFINITIONS ${WXWIDGETS_DEFINITIONS} -DWIN32 -D__WXMSW__  )
+ELSE(WIN32_STYLE_FIND)
+    IF( CYGWIN )
+        SET( WXWIDGETS_DEFINITIONS ${WXWIDGETS_DEFINITIONS} -D__GNUWIN32__  -O2 -D_WIN32_IE=0x400 -MMD -Wall  )
+    ENDIF( CYGWIN )
+ENDIF(WIN32_STYLE_FIND)
+
+IF( WXWIDGETS_USE_SHARED )
+    SET( WXWIDGETS_DEFINITIONS ${WXWIDGETS_DEFINITIONS} -DWXUSINGDLL  )
+ENDIF( WXWIDGETS_USE_SHARED )
+
+IF( WXWIDGETS_USE_DEBUG )
+    SET( WXWIDGETS_DEFINITIONS ${WXWIDGETS_DEFINITIONS} -D_DEBUG_  -D__WXDEBUG__  -DWXDEBUG=1 )
+ENDIF( WXWIDGETS_USE_DEBUG )
+
+IF ( WXWIDGETS_USE_UNICODE )
+    SET( WXWIDGETS_DEFINITIONS ${WXWIDGETS_DEFINITIONS} -DwxUSE_UNICODE  )
+ENDIF ( WXWIDGETS_USE_UNICODE )
+
+#
+# Set the WXWIDGETS_FOUND var
+#
+IF(WXWIDGETS_LIBRARIES AND WXWIDGETS_INCLUDE_DIR)
+    SET(WXWIDGETS_FOUND 1)
+ENDIF(WXWIDGETS_LIBRARIES AND WXWIDGETS_INCLUDE_DIR)
+
+#
+# Mark advanced vars
+#
+MARK_AS_ADVANCED(WXWIDGETS_ROOT_DIR)
+
+#
+# Log results
+#
+FILE( WRITE "${PROJECT_BINARY_DIR}/findwxw.log" "FindwxW.cmake version 1.06\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_FOUND: ${WXWIDGETS_FOUND}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_LINK_DIRECTORIES: ${WXWIDGETS_LINK_DIRECTORIES}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_LIBRARIES: ${WXWIDGETS_LIBRARIES}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_RELEASE_LIBRARIES: ${WXWIDGETS_RELEASE_LIBRARIES}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_DEBUG_LIBRARIES: ${WXWIDGETS_DEBUG_LIBRARIES}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_CXX_FLAGS: ${WXWIDGETS_CXX_FLAGS}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_EXE_LINKER_FLAGS: ${WXWIDGETS_EXE_LINKER_FLAGS}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_INCLUDE_DIR: ${WXWIDGETS_INCLUDE_DIR}\n" )
+FILE( APPEND "${PROJECT_BINARY_DIR}/findwxw.log" "WXWIDGETS_DEFINITIONS: ${WXWIDGETS_DEFINITIONS}\n" )
diff --git a/kernel/cmake/BBTKPreventInSourceBuild.cmake b/kernel/cmake/BBTKPreventInSourceBuild.cmake
new file mode 100644
index 0000000..de12a49
--- /dev/null
+++ b/kernel/cmake/BBTKPreventInSourceBuild.cmake
@@ -0,0 +1,6 @@
+#-----------------------------------------------------------------------------
+# Building in the source tree is forbidden ! 
+IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+  MESSAGE(FATAL_ERROR "Building in the source tree is not allowed !! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' and build outside the sources")
+ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+#-----------------------------------------------------------------------------
diff --git a/kernel/cmake/BBTKResolveOptions.cmake b/kernel/cmake/BBTKResolveOptions.cmake
new file mode 100644
index 0000000..bc784da
--- /dev/null
+++ b/kernel/cmake/BBTKResolveOptions.cmake
@@ -0,0 +1,18 @@
+#-----------------------------------------------------------------------------
+# messages compilation options 
+IF (BBTK_COMPILE_MESSAGES) 
+  ADD_DEF( BBTK_COMPILE_MESSAGES )
+ENDIF (BBTK_COMPILE_MESSAGES) 
+
+IF (BBTK_COMPILE_DEBUG_MESSAGES) 
+  ADD_DEF( BBTK_COMPILE_DEBUG_MESSAGES )
+ENDIF (BBTK_COMPILE_DEBUG_MESSAGES) 
+
+IF (BBTK_COMPILE_WARNING_MESSAGES) 
+  ADD_DEF( BBTK_COMPILE_WARNING_MESSAGES )
+ENDIF (BBTK_COMPILE_WARNING_MESSAGES) 
+
+IF (BBTK_COMPILE_ERROR_MESSAGES) 
+  ADD_DEF( BBTK_COMPILE_ERROR_MESSAGES )
+ENDIF (BBTK_COMPILE_ERROR_MESSAGES) 
+#-----------------------------------------------------------------------------
diff --git a/kernel/cmake/BBTKSingleOutputPath.cmake b/kernel/cmake/BBTKSingleOutputPath.cmake
new file mode 100644
index 0000000..15f63a7
--- /dev/null
+++ b/kernel/cmake/BBTKSingleOutputPath.cmake
@@ -0,0 +1,6 @@
+#-----------------------------------------------------------------------------
+# Path for binaries : default = bin 
+SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
+SET (LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
+MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
+#-----------------------------------------------------------------------------
diff --git a/kernel/cmake/FIND_AND_USE_WXWIDGETS.cmake b/kernel/cmake/FIND_AND_USE_WXWIDGETS.cmake
new file mode 100644
index 0000000..c9a748c
--- /dev/null
+++ b/kernel/cmake/FIND_AND_USE_WXWIDGETS.cmake
@@ -0,0 +1,63 @@
+
+
+MACRO(FIND_AND_USE_WXWIDGETS)
+
+  IF(WIN32)
+    # Search WXWIDGETS
+    
+    #  WXWINDOWS_LIBRARY         = full path to the wxWindows library and linker flags on unix
+    #  CMAKE_WX_CXX_FLAGS        = compiler flags for building wxWindows
+    #  WXWINDOWS_INCLUDE_PATH    = include path of wxWindows
+    #  WXWIDGETS_LIBRARIES       = wx libraries
+    
+    SET(WXWINDOWS_USE_GL 1)
+
+    #wxWidgets build related stuff
+    SET(WXW_USE_DEBUG    ON)
+    SET(WXW_USE_UNICODE  OFF)
+    SET(WXW_USE_SHARED   ON)
+    SET(WXW_USE_UNIV     OFF)
+    SET(WXW_USE_MONO     OFF)
+    SET(WXW_FILE_VERSION "28")
+    SET(WXW_VERSION      "2.8")
+    
+    #CMake Options
+    SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+    
+    INCLUDE (cmake/FindwxW.cmake)
+    #
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
+    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
+    ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS}  )
+    #
+    INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
+    LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
+    SET(WXWIDGETS_LIBRARIES
+      ${WXWIDGETS_LIBRARIES}     
+      debug msvcrtd
+      debug msvcprtd
+      optimized msvcrt
+      optimized msvcprt
+      )
+  ENDIF(WIN32)
+  IF(UNIX)
+    # GTK2
+    INCLUDE(cmake/FindGTK2.cmake)
+    INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
+    LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
+    LINK_LIBRARIES(${GTK2_LIBRARIES})
+    # WX
+    #SET(wxWidgets_USE_LIBS base core gl)
+    FIND_PACKAGE( wxWidgets REQUIRED) 
+    INCLUDE( ${wxWidgets_USE_FILE} )
+    MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
+    SET(WXWIDGETS_LIBRARIES
+      ${wxWidgets_LIBRARIES}
+      ${GTK2_LIBRARIES}
+      )
+    MARK_AS_ADVANCED(GTK2_CAIRO_INCLUDE_PATH)
+    MARK_AS_ADVANCED(GTK2_GOBJECT_LIBRARY)
+  ENDIF(UNIX)
+
+ENDMACRO(FIND_AND_USE_WXWIDGETS)
+  
diff --git a/kernel/cmake/MARK_AS_ADVANCED_UNWANTED.cmake b/kernel/cmake/MARK_AS_ADVANCED_UNWANTED.cmake
new file mode 100644
index 0000000..a7c7192
--- /dev/null
+++ b/kernel/cmake/MARK_AS_ADVANCED_UNWANTED.cmake
@@ -0,0 +1,5 @@
+#-----------------------------------------------------------------------------
+# DO NOT WANT TO SEE THIS
+MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
+#-----------------------------------------------------------------------------
+
diff --git a/kernel/cmake/bbPackage.cxx.in b/kernel/cmake/bbPackage.cxx.in
new file mode 100644
index 0000000..21d47fc
--- /dev/null
+++ b/kernel/cmake/bbPackage.cxx.in
@@ -0,0 +1,6 @@
+#include "bb@BBTK_PACKAGE_NAME@Package.h"
+
+BBTK_IMPLEMENT_PACKAGE(@BBTK_PACKAGE_NAME@,
+	"@BBTK_PACKAGE_AUTHOR@",
+	"@BBTK_PACKAGE_DESCRIPTION@",
+	"@BBTK_PACKAGE_VERSION@")
diff --git a/kernel/cmake/bbPackage.h.in b/kernel/cmake/bbPackage.h.in
new file mode 100644
index 0000000..102f8b3
--- /dev/null
+++ b/kernel/cmake/bbPackage.h.in
@@ -0,0 +1,8 @@
+#ifndef __bb@BBTK_PACKAGE_NAME@Package_h_INCLUDED__
+#define __bb@BBTK_PACKAGE_NAME@Package_h_INCLUDED__
+
+#include "bbtkPackage.h"
+
+BBTK_DECLARE_PACKAGE(@BBTK_PACKAGE_NAME@)
+
+#endif
diff --git a/kernel/src/CMakeLists.txt b/kernel/src/CMakeLists.txt
new file mode 100644
index 0000000..6182ac1
--- /dev/null
+++ b/kernel/src/CMakeLists.txt
@@ -0,0 +1,206 @@
+#-----------------------------------------------------------------------------
+# BUILDS AND INSTALLS THE LIBRARY BBTK
+#-----------------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------------
+# Tests 
+#-----------------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------------
+# Test if compiler defines the pseudo-macro __FUNCTION__
+IF("BBTK_COMPILER_HAS_FUNCTION" MATCHES "^BBTK_COMPILER_HAS_FUNCTION$")
+  MESSAGE(STATUS "Checking support for __FUNCTION__ in compiler")
+  TRY_COMPILE(BBTK_COMPILER_HAS_FUNCTION
+              ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/Function
+              ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bbtkTestFUNCTION.cxx
+              OUTPUT_VARIABLE OUTPUT)
+  IF(BBTK_COMPILER_HAS_FUNCTION)
+    MESSAGE(STATUS "Checking support for __FUNCTION__ -- yes")
+    SET(BBTK_COMPILER_HAS_FUNCTION 1 CACHE INTERNAL "Support for extension C __FUNCTION__")
+    WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/CMakeOutput.log
+      "Determining if the C compiler supports __FUNCTION__ "
+      "passed with the following output:\n"
+      "${OUTPUT}\n" APPEND)
+  ELSE(BBTK_COMPILER_HAS_FUNCTION)
+    MESSAGE(STATUS "Checking support for __FUNCTION__ -- no")
+    SET(BBTK_COMPILER_HAS_FUNCTION 0 CACHE INTERNAL "Support for extension C __FUNCTION__")
+    WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/CMakeError.log
+      "Determining if the C compiler supports __FUNCTION__ "
+      "failed with the following output:\n"
+      "${OUTPUT}\n" APPEND)
+  ENDIF(BBTK_COMPILER_HAS_FUNCTION)
+ENDIF("BBTK_COMPILER_HAS_FUNCTION" MATCHES "^BBTK_COMPILER_HAS_FUNCTION$")
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Test is compiler support istringstream
+IF("BBTK_TEST_ISTRINGSTREAM" MATCHES "^BBTK_TEST_ISTRINGSTREAM$")
+  MESSAGE(STATUS "Checking istringstream")
+  TRY_RUN(BBTK_TEST_ISTRINGSTREAM BBTK_TEST_ISTRINGSTREAM_COMPILED
+          ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/
+          ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bbtkTestIstringStream.cxx)
+  IF(BBTK_TEST_ISTRINGSTREAM_COMPILED)
+    IF(BBTK_TEST_ISTRINGSTREAM)
+      MESSAGE(STATUS "Checking istringstream works -- yes")
+      SET(BBTK_TEST_ISTRINGSTREAM 1 CACHE INTERNAL "Whether istringstream works.")
+    ELSE(BBTK_TEST_ISTRINGSTREAM)
+      MESSAGE(STATUS "Checking istringstream works -- no")
+      SET(BBTK_TEST_ISTRINGSTREAM 0 CACHE INTERNAL "Whether istringstream works.")
+    ENDIF(BBTK_TEST_ISTRINGSTREAM)
+  ELSE(BBTK_TEST_ISTRINGSTREAM_COMPILED)
+    MESSAGE(STATUS "Checking istringstream -- failed")
+  ENDIF(BBTK_TEST_ISTRINGSTREAM_COMPILED)
+ENDIF("BBTK_TEST_ISTRINGSTREAM" MATCHES "^BBTK_TEST_ISTRINGSTREAM$")
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
+CHECK_INCLUDE_FILE("stdint.h"       CMAKE_HAVE_STDINT_H)
+IF(UNIX) #Avoid polluting Win32 cmakecache
+  CHECK_INCLUDE_FILE("inttypes.h"   CMAKE_HAVE_INTTYPES_H)
+  # termios 
+  CHECK_INCLUDE_FILE("termios.h"   CMAKE_HAVE_TERMIOS_H)
+ENDIF(UNIX)
+# Special Time support, two conventions: *NIX vs Win32
+CHECK_INCLUDE_FILE("sys/times.h"    CMAKE_HAVE_SYS_TIMES_H)
+CHECK_INCLUDE_FILE("sys/timeb.h"    CMAKE_HAVE_SYS_TIMEB_H)
+#-----------------------------------------------------------------------------
+
+  
+
+#-----------------------------------------------------------------------------
+# bbtk library dependencies
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# WXWIDGETS
+OPTION(BBTK_USE_WXWIDGETS "Build bbtk library and applications in graphical mode using the wxWidgets library" OFF)
+
+IF(BBTK_USE_WXWIDGETS)
+  SET(USE_WXWIDGETS ON CACHE BOOL "Use WxWidgets" FORCE)
+
+#  INCLUDE(cmake/FIND_AND_USE_WXWIDGETS.cmake)
+#  FIND_AND_USE_WXWIDGETS()
+#  ADD_DEF( _USE_WXWIDGETS_ )
+  SET(BBTK_LINK_LIBRARIES
+    ${BBTK_LINK_LIBRARIES}
+    ${BBTK_WXWIDGETS_LIBRARIES} 
+    )
+ENDIF(BBTK_USE_WXWIDGETS)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# On unix systems, need to link against dl for dynamic librairies open/close
+IF(UNIX)
+  SET(BBTK_LINK_LIBRARIES
+    ${BBTK_LINK_LIBRARIES}
+    dl) 
+ENDIF(UNIX)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# EO bbtk library dependencies
+#-----------------------------------------------------------------------------
+
+
+
+
+
+
+
+#-----------------------------------------------------------------------------
+# Generates the bbtkConfigure.h file
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/bbtkConfigure.h.in
+               ${CMAKE_CURRENT_BINARY_DIR}/bbtkConfigure.h 
+	       @ONLY IMMEDIATE
+               )
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+IF(NOT BBTK_INSTALL_NO_DEVELOPMENT)
+  INSTALL_FILES(/include/bbtk FILES bbtkConfigure.h)
+ENDIF(NOT BBTK_INSTALL_NO_DEVELOPMENT)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Add the path to current dir for apps to find bbtkConfigure.h
+# LG : already done in upper dir
+#INCLUDE_DIRECTORIES(
+#  ${CMAKE_CURRENT_BINARY_DIR} #for bbtkConfigure.h
+#)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# EO Generates the bbtkConfigure.h file
+#-----------------------------------------------------------------------------
+
+
+
+
+
+
+
+#-----------------------------------------------------------------------------
+# bbtk library creation
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Sources files 
+FILE(GLOB SOURCES "." "*.cxx" "*.cpp")
+FILE(GLOB SOURCES_H "." "*.h" )
+#-----------------------------------------------------------------------------
+# lib definition
+ADD_LIBRARY(bbtk SHARED ${SOURCES} ${SOURCES_H})
+#-----------------------------------------------------------------------------
+TARGET_LINK_LIBRARIES(bbtk ${BBTK_LINK_LIBRARIES})
+#-----------------------------------------------------------------------------
+
+#IF(UNIX)
+# for gnu linker : version script used to define exported symbols
+#SET_TARGET_PROPERTIES(bbtk PROPERTIES 
+#  LINK_FLAGS_DEBUG -Wl,--version-script=bbtk.map)
+#SET_TARGET_PROPERTIES(bbtk PROPERTIES
+#  LINK_FLAGS_RELEASE -Wl,--version-script=bbtk.map)
+#ENDIF(UNIX)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# EO bbtk library creation
+#-----------------------------------------------------------------------------
+
+
+
+
+
+
+#-----------------------------------------------------------------------------
+# bbtk library installation
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+INSTALL_FILES(/include/bbtk "\\.h$")
+INSTALL_TARGETS(/lib bbtk)
+#-----------------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------------
+# TO DO : create FindBBTK.cmake
+#INCLUDE(InstallFindBBTK.cmake)
+#-----------------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------------
+# EO bbtk library installation
+#-----------------------------------------------------------------------------
+
+
+
+#-----------------------------------------------------------------------------
+# EOF
+#-----------------------------------------------------------------------------
+
diff --git a/kernel/src/bbtkAny.cxx b/kernel/src/bbtkAny.cxx
new file mode 100644
index 0000000..97d39f1
--- /dev/null
+++ b/kernel/src/bbtkAny.cxx
@@ -0,0 +1,23 @@
+#include "bbtkAny.h"
+
+
+namespace bbtk
+{
+  /// The TypeTraits which validates all integer types
+  template <> const bool integer::value = true; 
+  template <> const bool integer::value = true;
+  template <> const bool integer::value = true; 
+  template <> const bool integer::value = true; 
+  template <> const bool integer::value = true; 
+  template <> const bool integer::value = true; 
+  template <> const bool integer::value = true;
+  template <> const bool integer::value = true; 
+  template <> const bool integer::value = true; 
+  template <> const bool integer::value = true; 
+
+  /// The TypeTraits which validates all floating point number types
+  template <> const bool floating_point::value = true;
+  template <> const bool floating_point::value = true;
+}
+
+  
diff --git a/kernel/src/bbtkAny.h b/kernel/src/bbtkAny.h
new file mode 100644
index 0000000..45ed576
--- /dev/null
+++ b/kernel/src/bbtkAny.h
@@ -0,0 +1,555 @@
+/*=========================================================================
+                                                                                
+  Program:   bbtk
+  Module:    $RCSfile: bbtkAny.h,v $
+  Language:  C++
+  Date:      $Date: 2008/01/22 15:02:00 $
+  Version:   $Revision: 1.1 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See doc/license.txt or
+  http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+/**
+ *\file
+ *\brief  Defines the class any which can store any type of data (adapted from boost::any).
+ */
+#ifndef __BBTKANY_H_INCLUDED__
+#define __BBTKANY_H_INCLUDED__
+
+/*
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+*/
+#include 
+#include "bbtkRTTI.h"
+#include "bbtkMessageManager.h"
+#include "bbtkException.h"
+
+#ifdef _USE_BOOST_
+#include 
+#endif 
+
+namespace bbtk 
+{
+
+
+
+
+
+  //=========================================================
+  /// Abstract class used by the any class to store values
+  class anyplaceholder
+  {
+  public: // structors
+    
+    virtual ~anyplaceholder() {}
+    
+  public: // queries
+    
+    /// returns the type of the held value
+    virtual const std::type_info & type() const = 0;
+    /// returns the type of the pointed held value
+    virtual const std::type_info & pointed_type() const = 0;
+    
+    /// returns true iff the stored value is a pointer
+    virtual bool is_pointer() const = 0;
+    
+    /// If the held value is a pointer then 
+    /// returns its value
+    virtual void* get_pointer() const = 0;
+ 
+    /// 
+    virtual void* get_pointer_to( const std::type_info& ) const = 0;
+   
+    virtual anyplaceholder * clone() const = 0;
+    
+  };
+  //=========================================================
+  
+  //=========================================================
+  /// Concrete template class used by the any class to store values
+  /// which stores a value of type ValueType
+  template
+  class anyholder : public anyplaceholder
+  {
+  public: // structors
+    
+    anyholder(const ValueType & value)
+      : held(value)
+    {}
+    
+  public: // queries
+    
+    virtual const std::type_info & type() const { return typeid(ValueType);}
+    virtual bool is_pointer() const { return false; }
+    virtual const std::type_info & pointed_type() const { return typeid(void); }
+    virtual void* get_pointer() const { return 0; }
+    virtual void* get_pointer_to( const std::type_info& ) const { return 0; }
+    virtual anyplaceholder * clone() const { return new anyholder(held); }
+    
+    public: // representation
+    
+    ValueType held;
+    
+  };
+  //=========================================================
+  
+  //=========================================================
+  /// specialization of anyholder for pointer types
+  template
+  class anyholder : public anyplaceholder
+  {
+  public: // structors
+    
+    anyholder(ValueType* const & value)
+      : held(value)
+    { }
+    
+  public: // queries
+    
+    virtual const std::type_info & type() const
+    {
+      return typeid(ValueType*);
+    }
+    
+    virtual bool is_pointer() const { return true; }
+    virtual const std::type_info & pointed_type() const { return typeid(ValueType); }
+    virtual void* get_pointer() const { 
+      return (void*)held; 
+    }
+    virtual void* get_pointer_to( const std::type_info& t) const 
+    { 
+      return run_time_up_or_down_cast(t,typeid(ValueType),held);
+    }
+
+    virtual anyplaceholder * clone() const { return new anyholder(held); }
+    
+  public: // representation
+    
+    ValueType* held;
+    
+  };
+  //=========================================================
+
+
+  /** A magic class which can store any type of data which 
+   * is allowed by the template template parameter TypeTrait.
+   *
+   * The only requirement on TypeTrait is to have the member :
+   *    static const bool value;
+   * which is true iff the type T is an allowed type 
+   * 
+   * TypeTraits compliant objects are usually template structs 
+   * for which the initialisation of value is set to false by default 
+   * and set to true for the allowed types (template specialisation)
+   * Example :
+   *   template  struct mytypes { static const bool value; };
+   *   template  const bool mytypes::value = false;
+   *   template <> const bool mytypes::value = true;
+   *   template <> const bool mytypes::value = true; 
+   * etc.
+   * You can use any boost type_trait, like is_pointer, is_floating_point, etc.
+   *
+   * The class any is a generalisation of the boost::any class 
+   * (see http://www.boost.org/doc/html/any.html).
+   * The boost::any class itself is reproduced by any,
+   * where thing is a TypeTrait whose value is true for all types.
+   **/
+  template