-#
-# Test CMake version
-#
+#-----------------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
-#MARK_AS_ADVANCED( FORCE CMAKE_BACKWARDS_COMPATIBILITY )
-
-# for CMake 2.6 corrected behaviour (see "cmake --help-policy CMP0003")
-IF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
- CMAKE_POLICY(SET CMP0003 NEW)
- CMAKE_POLICY(SET CMP0005 NEW)
-ENDIF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
-
+#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
PROJECT(BBTK)
#-----------------------------------------------------------------------------
-
#-----------------------------------------------------------------------------
# Set global configuration of the toolkit
INCLUDE(kernel/cmake/BBTKRootCMakeLists.cmake)
-#-----------------------------------------------------------------------------
+#===========================================================================
# DOES THE USER WANT TO BUILD THE PACKAGE ?
OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}
"Build the bbtk package ${BBTK_PACKAGE_NAME} ?" OFF)
-#-----------------------------------------------------------------------------
+#===========================================================================
-#-----------------------------------------------------------------------------
-IF(BBTK_CORE_PACKAGE)
- IF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
- SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- ENDIF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
-ENDIF(BBTK_CORE_PACKAGE)
-#-----------------------------------------------------------------------------
-
-
-#-----------------------------------------------------------------------------
-# IF THE USER HAS CHOSEN TO BUILD THE PACKAGE
IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- #---------------------------------------------------------------------------
-
+ #===========================================================================
+ # THE USER HAS CHOSEN TO BUILD THE PACKAGE
+ #===========================================================================
+
#===========================================================================
# If the package is not a "core" bbtk package (included into the toolkit)
- # then we have to find (and use) bbtk
+ # then we have to find and use bbtk
IF(NOT BBTK_CORE_PACKAGE)
- #-------------------------------------------------------------------------
- # Find and use the Black Box Toolkit
- # Search BBTK
- FIND_PACKAGE(BBTK)
- # If bbtk found
- IF(BBTK_FOUND)
- INCLUDE(${BBTK_USE_FILE})
- SET(BBTK_PACKAGE_LIBS
- ${BBTK_PACKAGE_LIBS}
- ${BBTK_LIBRARIES})
- MARK_AS_ADVANCED(BBTK_DIR)
- ENDIF(BBTK_FOUND)
+ FIND_PACKAGE(BBTK REQUIRED)
+ INCLUDE(${BBTK_USE_FILE})
ENDIF(NOT BBTK_CORE_PACKAGE)
-
- #===========================================================================
- # Include package configuration cmake script from bbtk dir
- INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
#===========================================================================
+ #===========================================================================
+ # Include package configuration cmake script from bbtk cmake dir
+ INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
+ #===========================================================================
- #---------------------------------------------------------------------------
ELSE(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- #-------------------------------------------------------------------------
-
- #-----------------------------------------------------------------------
+
+ #===========================================================================
+ # Else if it is a core package we have to reset some things...
IF(BBTK_CORE_PACKAGE)
- #-----------------------------------------------------------------------
- # If package deps in global deps : reset global deps
- IF(${BBTK_PACKAGE_NAME}_IN_DEPS)
- SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL
- "bbtk packages dependencies" FORCE)
- # STRING(REPLACE "${${BBTK_PACKAGE_NAME}_DEPS};"
- # "" TEMP
- # ${BBTK_PACKAGES_DEPS})
- #
- # SET(BBTK_PACKAGES_DEPS ${TEMP}
- # CACHE INTERNAL "bbtk packages dependencies" FORCE)
- ENDIF(${BBTK_PACKAGE_NAME}_IN_DEPS)
- #-----------------------------------------------------------------------
-
- #-----------------------------------------------------------------------
- # Remove the package include scripts to avoid loading it by include *
- FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbs)
- FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbs)
- #-----------------------------------------------------------------------
+ INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_BuildOff.cmake)
ENDIF(BBTK_CORE_PACKAGE)
-
- #-------------------------------------------------------------------------
+ #===========================================================================
+
ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
mFile << "#define " << included <<"\n";
// Includes
- // mFile << "#include \"bbtkAtomicBlackBox.h\"\n";
+ mFile << "#include \"bb" << mPackage << "_EXPORT.h\"\n";
std::vector<std::string>::iterator i;
for (i=mInclude.begin(); i!=mInclude.end(); ++i)
{
}
// Class declaration and parents
- mFile << "class /*BBTK_EXPORT*/ "<<mName<<"\n";
+ mFile << "class bb"<<mPackage<<"_EXPORT "<<mName<<"\n";
mFile << " : \n";
/*
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "Adding definitions:")
# Set C preprocessor definitions
-ADD_DEF_WITH_VAL(BBTK_SHARE_REL_PATH "${BBTK_SHARE_REL_PATH}")
-ADD_DEF_WITH_VAL(BBTK_DOC_REL_PATH "${BBTK_DOC_REL_PATH}")
-ADD_DEF_WITH_VAL(BBTK_BBS_REL_PATH "${BBTK_BBS_REL_PATH}")
-ADD_DEF_WITH_VAL(BBTK_DATA_REL_PATH "${BBTK_DATA_REL_PATH}")
+CREA_DEFINE_WITH_VAL(BBTK_SHARE_REL_PATH "${BBTK_SHARE_REL_PATH}")
+CREA_DEFINE_WITH_VAL(BBTK_DOC_REL_PATH "${BBTK_DOC_REL_PATH}")
+CREA_DEFINE_WITH_VAL(BBTK_BBS_REL_PATH "${BBTK_BBS_REL_PATH}")
+CREA_DEFINE_WITH_VAL(BBTK_DATA_REL_PATH "${BBTK_DATA_REL_PATH}")
#-----------------------------------------------------------------------------
# messages compilation options
IF (BBTK_COMPILE_MESSAGES)
- ADD_DEF( BBTK_COMPILE_MESSAGES )
+ CREA_DEFINE( BBTK_COMPILE_MESSAGES )
ENDIF (BBTK_COMPILE_MESSAGES)
IF (BBTK_COMPILE_DEBUG_MESSAGES)
- ADD_DEF( BBTK_COMPILE_DEBUG_MESSAGES )
+ CREA_DEFINE( BBTK_COMPILE_DEBUG_MESSAGES )
ENDIF (BBTK_COMPILE_DEBUG_MESSAGES)
IF (BBTK_COMPILE_WARNING_MESSAGES)
- ADD_DEF( BBTK_COMPILE_WARNING_MESSAGES )
+ CREA_DEFINE( BBTK_COMPILE_WARNING_MESSAGES )
ENDIF (BBTK_COMPILE_WARNING_MESSAGES)
IF (BBTK_COMPILE_ERROR_MESSAGES)
- ADD_DEF( BBTK_COMPILE_ERROR_MESSAGES )
+ CREA_DEFINE( BBTK_COMPILE_ERROR_MESSAGES )
ENDIF (BBTK_COMPILE_ERROR_MESSAGES)
#-----------------------------------------------------------------------------
IF(APPLE)
- ADD_DEF(MACOSX)
+ CREA_DEFINE(MACOSX)
ELSE(APPLE)
IF("${CMAKE_SYSTEM}" MATCHES "Linux")
- ADD_DEF(LINUX)
+ CREA_DEFINE(LINUX)
ELSE("${CMAKE_SYSTEM}" MATCHES "Linux")
IF(WIN32)
- ADD_DEF(WIN32)
+ CREA_DEFINE(WIN32)
ELSE(WIN32)
MESSAGE(FATAL_ERROR "${CMAKE_SYSTEM} unsupported ! Build at your own risks ! (remove this line from kernel/cmake/BBTKAddDefinitions.cmake)")
ENDIF(WIN32)
ENDIF("${CMAKE_SYSTEM}" MATCHES "Linux")
ENDIF(APPLE)
#-----------------------------------------------------------------------------
+
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
# The -- prepended to the options ensure that it will appear as the
# first option when running ccmake/CMakeSetup
IF (BBTK_CORE_PACKAGE)
- OPTION(--BUILD_ALL "Build all ?" ON)
+ OPTION(--BUILD_ALL "Build all ?" OFF)
#OPTION(--SET_BUILD_ALL_OFF "Build all ?" OFF)
#MARK_AS_ADVANCED(--SET_BUILD_ALL_OFF)
+MESSAGE(STATUS "")
MESSAGE(STATUS "=======================================")
MESSAGE(STATUS "CONFIGURING BBTK PACKAGE ${BBTK_PACKAGE_NAME}")
SET(${BBTK_PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
#---------------------------------------------------------------------------
-
#---------------------------------------------------------------------------
IF(NOT BBTK_CORE_PACKAGE)
+ #---------------------------------------------------------------------------
+ SET(BBTK_PACKAGE_LIBS
+ ${BBTK_PACKAGE_LIBS}
+ ${BBTK_LIBRARIES})
+ MARK_AS_ADVANCED(BBTK_DIR)
#-------------------------------------------------------------------------
# If not a core package must include necessary cmake scripts
INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackagePaths.cmake)
SUBDIRS(data)
#---------------------------------------------------------------------------
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
#-----------------------------------------------------------------------------
# EOF
--- /dev/null
+# If it is a core package and is build is set to off...
+IF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
+ SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
+ENDIF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
+
+#-----------------------------------------------------------------------
+# If package deps in global deps : reset global deps
+IF(${BBTK_PACKAGE_NAME}_IN_DEPS)
+ SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL
+ "bbtk packages dependencies" FORCE)
+ # STRING(REPLACE "${${BBTK_PACKAGE_NAME}_DEPS};"
+ # "" TEMP
+ # ${BBTK_PACKAGES_DEPS})
+ #
+ # SET(BBTK_PACKAGES_DEPS ${TEMP}
+ # CACHE INTERNAL "bbtk packages dependencies" FORCE)
+ENDIF(${BBTK_PACKAGE_NAME}_IN_DEPS)
+#-----------------------------------------------------------------------
+
+#-----------------------------------------------------------------------
+# Remove the package include scripts to avoid loading it by include *
+FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbp)
+FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbp)
+#-----------------------------------------------------------------------
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} )
#----------------------------------------------------------------------------
-
-
+#----------------------------------------------------------------------------
+# CREATES bb${BBTK_PACKAGE_NAME}_EXPORT.h
+CREA_DYNAMIC_LIBRARY_EXPORT(bb${BBTK_PACKAGE_NAME})
+INSTALL(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/bb${BBTK_PACKAGE_NAME}_EXPORT.h
+ DESTINATION include/bb${BBTK_PACKAGE_NAME}
+ )
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
"Use the shipped boost C++ library (${BBTK_SHIPPED_BOOST})" ON)
#-----------------------------------------------------------------------------
+#-----------------------------------------------------------------------------
OPTION(BBTK_USE_WXWIDGETS "Build bbtk with wxWidgets ?" OFF)
IF(BBTK_USE_WXWIDGETS)
SET(USE_WXWIDGETS ON CACHE BOOL "Use WxWidgets" FORCE)
ELSE(BBTK_USE_WXWIDGETS)
SET(USE_WXWIDGETS OFF CACHE BOOL "Use WxWidgets" FORCE)
ENDIF(BBTK_USE_WXWIDGETS)
+#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
OPTION(BBTK_USE_KWWIDGETS "Build bbtk with KWWidgets ?" OFF)
-
IF (BBTK_USE_KWWIDGETS)
SET(USE_KW ON CACHE BOOL "Use KWWidgets" FORCE)
ELSE (BBTK_USE_KWWIDGETS)
SET(USE_KW OFF CACHE BOOL "Use KWWidgets" FORCE)
ENDIF (BBTK_USE_KWWIDGETS)
+#-----------------------------------------------------------------------------
#SWITCH_ON_IF_BUILD_ALL(BUILD_KWWIDGETS)
+
+#-----------------------------------------------------------------------------
+IF(USE_ITK)
+ IF(ITK_FOUND)
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "=======================================")
+ MESSAGE(STATUS "Resolving ITK images options...")
+ # 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 )
+ CREA_DEFINE( BBTK_ITK_IMAGE_DIM_2 )
+ ENDIF ( itk_IMAGE_DIM_2 )
+
+ IF ( itk_IMAGE_DIM_3 )
+ CREA_DEFINE( BBTK_ITK_IMAGE_DIM_3 )
+ ENDIF ( itk_IMAGE_DIM_3 )
+
+ IF ( itk_IMAGE_DIM_4 )
+ CREA_DEFINE( BBTK_ITK_IMAGE_DIM_4 )
+ ENDIF ( itk_IMAGE_DIM_4 )
+
+ IF ( itk_IMAGE_TYPE_CHAR )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_int8_t )
+ ENDIF ( itk_IMAGE_TYPE_CHAR )
+
+ IF ( itk_IMAGE_TYPE_UCHAR )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_uint8_t )
+ ENDIF ( itk_IMAGE_TYPE_UCHAR )
+
+ IF ( itk_IMAGE_TYPE_SHORT )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_int16_t )
+ ENDIF ( itk_IMAGE_TYPE_SHORT )
+
+ IF ( itk_IMAGE_TYPE_USHORT )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_uint16_t )
+ ENDIF ( itk_IMAGE_TYPE_USHORT )
+
+ IF ( itk_IMAGE_TYPE_INT )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_int32_t )
+ ENDIF ( itk_IMAGE_TYPE_INT )
+
+ IF ( itk_IMAGE_TYPE_UINT )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_uint32_t )
+ ENDIF ( itk_IMAGE_TYPE_UINT )
+
+ IF ( itk_IMAGE_TYPE_FLOAT )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_float )
+ ENDIF ( itk_IMAGE_TYPE_FLOAT )
+
+ IF ( itk_IMAGE_TYPE_DOUBLE )
+ CREA_DEFINE( BBTK_ITK_IMAGE_TYPE_double )
+ ENDIF ( itk_IMAGE_TYPE_DOUBLE )
+ MESSAGE(STATUS "=======================================")
+
+ ENDIF(ITK_FOUND)
+ENDIF(USE_ITK)
+#-----------------------------------------------------------------------------
+
-
-#-----------------------------------------------------------------------------
-IF(USE_KW)
- # Search KWWidgets
- FIND_PACKAGE(KWWidgets)
- # If found
- IF(KWWidgets_FOUND)
- MESSAGE ( STATUS "=======================================")
- MESSAGE ( STATUS "Looking for KWWidgets... found")
- MESSAGE ( STATUS "* Dir = ${KWWidgets_DIR}")
- MESSAGE ( STATUS "* Version = ${KWWidgets_MAJOR_VERSION}.${KWWidgets_MINOR_VERSION}.${KWWidgets_BUILD_VERSION}")
- INCLUDE(${KWWidgets_USE_FILE})
- ADD_DEF( USE_KWWIDGETS )
- SET(BBTK_KWWIDGETS_LIBRARIES
- ${KWWidgets_LIBRARIES}
- )
- MARK_AS_ADVANCED(KWWidgets_DIR)
- ELSE(KWWidgets_FOUND)
- message(FATAL_ERROR "KWWidgets_DIR not found")
- ENDIF(KWWidgets_FOUND)
-ENDIF(USE_KW)
#-----------------------------------------------------------------------------
-
+MESSAGE ( STATUS "")
+MESSAGE ( STATUS "=======================================")
+MESSAGE ( STATUS " LOOKING FOR LIBRARIES NEEDED")
+MESSAGE ( STATUS "=======================================")
+MESSAGE ( STATUS "")
#-----------------------------------------------------------------------------
-#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 "=======================================")
- MESSAGE ( STATUS "Looking for VTK... found")
- MESSAGE ( STATUS "* Dir = ${VTK_DIR}")
- MESSAGE ( STATUS "* Version = ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
- INCLUDE(${VTK_USE_FILE})
- ADD_DEF( _USE_VTK_ )
- SET(BBTK_VTK_LIBRARIES
- vtkCommon # Mandatory
- vtkFiltering # vtkImageData
- vtkRendering # vtkProp3D
- vtkWidgets # vtkImagePlaneWidget
- vtkIO # vtkMetaImageReader/Writer
- vtkImaging # filters such as vtkImageAnisotropicDiffusion3D
- vtkGraphics # vtkContourFilter, sources
- vtkVolumeRendering # Mappers
-# vtkGenericFiltering
- )
- MARK_AS_ADVANCED(VTK_DIR)
- ELSE(VTK_FOUND)
- message(FATAL_ERROR "VTK_DIR not found")
- ENDIF(VTK_FOUND)
-ENDIF(USE_VTK)
+
#-----------------------------------------------------------------------------
-
-
+# 11/12/08 : BBTK IS NOW BASED ON crea
+SET(CREA_VERBOSE_CMAKE TRUE)
+FIND_PACKAGE(crea REQUIRED)
+IF (crea_FOUND)
+ INCLUDE(${crea_USE_FILE})
+ENDIF(crea_FOUND)
#-----------------------------------------------------------------------------
-#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 "=======================================")
- MESSAGE ( STATUS "Looking for ITK... found")
- MESSAGE ( STATUS "* Dir = ${ITK_DIR}")
- MESSAGE ( STATUS "* 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 )
- ELSE(ITK_FOUND)
- message(FATAL_ERROR "ITK_DIR not found")
- ENDIF(ITK_FOUND)
-ENDIF(USE_ITK)
#-----------------------------------------------------------------------------
+# USE SHIPPED BOOST ?
+IF(BBTK_USE_SHIPPED_BOOST)
+ MESSAGE ( STATUS "=======================================")
+ MESSAGE(STATUS "bbtk uses shipped boost C++ library (${BBTK_SHIPPED_BOOST})")
+ INCLUDE_DIRECTORIES(
+ ${PROJECT_SOURCE_DIR}/kernel/src/ThirdParty/${BBTK_SHIPPED_BOOST})
-
+ # TO DO : CLEANLY BLOCK auto_link.hpp INCLUSION
+ #CREA_DEFINE(BOOST_SIGNALS_NO_LIB)
+ SET(BBTK_BOOST_LIBRARIES
+ bbtk_boost_signals
+ )
+
+ELSE(BBTK_USE_SHIPPED_BOOST)
+ SET(USE_BOOST ON CACHE BOOL "Use boost C++ library" FORCE)
+ SET(BBTK_BOOST_LIBRARIES
+ boost_signals
+ )
+ENDIF(BBTK_USE_SHIPPED_BOOST)
#-----------------------------------------------------------------------------
-#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_ )
- MESSAGE ( STATUS "=======================================")
- MESSAGE ( STATUS "Looking for GDCM... found")
- MESSAGE ( STATUS "* Dir = ${GDCM_DIR}")
- MESSAGE ( STATUS "* Version = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
- MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}")
-
- # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with
- # embedded gdcm in ITK and will result in hard seg faults !
- IF (GDCM_NAME_SPACE STREQUAL "gdcm")
- MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value")
- ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm")
- MARK_AS_ADVANCED(GDCM_DIR)
-
- SET(BBTK_GDCM_LIBRARIES
-# TO DO : USE GDCM LINK LIBRARIES !!!
-# IF gdcm WAS NOT COMPILE WITH VTK THE ABOVE FORCED LINK WITH vtkgdcm DOES NOT WORK
- ${GDCM_LIBRARIES}
-#gdcm gdcmjpeg8 gdcmjpeg12 gdcmjpeg16
- )
-
-# IF(USE_VTK )
-# SET(BBTK_GDCM_LIBRARIES
-# ${BBTK_GDCM_LIBRARIES}
-# vtkgdcm
-# )
-# ENDIF(USE_VTK)
- ENDIF(GDCM_FOUND)
-ENDIF(USE_GDCM)
+#-----------------------------------------------------------------------------
+CREA_FIND_AND_USE_LIBRARIES()
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-IF(USE_WXWIDGETS)
- MESSAGE ( STATUS "=======================================")
- INCLUDE(${BBTK_CMAKE_DIR}/BBTKWxWidgets.cmake)
- BBTK_FIND_WXWIDGETS()
- BBTK_USE_WXWIDGETS()
-ENDIF(USE_WXWIDGETS)
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS " ... ALL NEEDED LIBRARIES FOUND")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
#-----------------------------------------------------------------------------
-
#-----------------------------------------------------------------------------
-IF(USE_DOXYGEN)
- MESSAGE ( STATUS "=======================================")
- FIND_PACKAGE(Doxygen REQUIRED)
-# MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN}")
- IF(DOXYGEN)
-
- ELSE(DOXYGEN)
- MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation")
- ENDIF(DOXYGEN)
-ENDIF(USE_DOXYGEN)
+# bbtk library dependencies
#-----------------------------------------------------------------------------
+#-----------------------------------------------------------------------------
+# WXWIDGETS
+IF(BBTK_USE_WXWIDGETS)
+ SET(BBTK_LINK_LIBRARIES
+ ${BBTK_LINK_LIBRARIES}
+ ${WXWIDGETS_LIBRARIES}
+ )
+ENDIF(BBTK_USE_WXWIDGETS)
+#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-IF(USE_LATEX)
- FIND_PACKAGE(LATEX REQUIRED)
- MESSAGE ( STATUS "=======================================")
- MESSAGE(STATUS "Looking for latex... - found ${LATEX_COMPILER}")
-ENDIF(USE_LATEX)
+# KWWIDGETS
+IF(BBTK_USE_KWWIDGETS)
+ SET(BBTK_LINK_LIBRARIES
+ ${BBTK_LINK_LIBRARIES}
+ ${KWWIDGETS_LIBRARIES}
+ )
+ENDIF(BBTK_USE_KWWIDGETS)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-IF(USE_TTH)
- FIND_FILE(LATEX_tth_CONVERTER NAME tth tth.exe PATHS . $ENV{CREATIS}/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux)
- IF (NOT LATEX_tth_CONVERTER)
- MESSAGE(FATAL_ERROR "TTH not found (LATEX_tth_CONVERTER). Required to build the HTML documentation from tex source")
- ELSE (NOT LATEX_tth_CONVERTER)
- MESSAGE ( STATUS "=======================================")
- MESSAGE(STATUS "Looking for tth... - found ${LATEX_tth_CONVERTER}")
- ENDIF(NOT LATEX_tth_CONVERTER)
- MARK_AS_ADVANCED(LATEX_tth_CONVERTER)
-ENDIF(USE_TTH)
+# BOOST
+SET(BBTK_LINK_LIBRARIES
+ ${BBTK_LINK_LIBRARIES}
+ ${BBTK_BOOST_LIBRARIES}
+ )
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-IF(USE_BOOST)
- IF(BBTK_USE_SHIPPED_BOOST)
- MESSAGE ( STATUS "=======================================")
- MESSAGE(STATUS "bbtk uses shipped boost C++ library (${BBTK_SHIPPED_BOOST})")
- INCLUDE_DIRECTORIES(
- ${PROJECT_SOURCE_DIR}/kernel/src/ThirdParty/${BBTK_SHIPPED_BOOST})
+# 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)
+#-----------------------------------------------------------------------------
- # TO DO : CLEANLY BLOCK auto_link.hpp INCLUSION
- #ADD_DEF(BOOST_SIGNALS_NO_LIB)
- SET(BBTK_BOOST_LIBRARIES
- bbtk_boost_signals
- )
+#-----------------------------------------------------------------------------
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "bbtk LINK LIBRARIES:")
+MESSAGE(STATUS "${BBTK_LINK_LIBRARIES}")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
+#-----------------------------------------------------------------------------
- ELSE(BBTK_USE_SHIPPED_BOOST)
- FIND_PACKAGE(Boost REQUIRED)
- MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
- IF(Boost_FOUND)
- MESSAGE ( STATUS "=======================================")
- MESSAGE(STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}")
- INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
- LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
- SET(BBTK_BOOST_LIBRARIES
- boost_signals
- )
- ELSE(Boost_FOUND)
- MESSAGE(FATAL_ERROR "boost C++ library not found - either set Boost_INCLUDE_DIR or set BBTK_USE_SHIPPED_BOOST to ON to use shipped ${BBTK_SHIPPED_BOOST}")
- ENDIF(Boost_FOUND)
- ENDIF(BBTK_USE_SHIPPED_BOOST)
-ENDIF(USE_BOOST)
#-----------------------------------------------------------------------------
+# EO bbtk library dependencies
+#-----------------------------------------------------------------------------
+
ENDIF(WIN32)
SET(BBTK_PACKAGE_LIB_PATH ${BBTK_LIB_PATH})
+MESSAGE(STATUS "")
+MESSAGE(STATUS "===============================================")
+MESSAGE(STATUS "Setting up base pathes:")
MESSAGE(STATUS "* BBTK_BIN_PATH =${BBTK_BIN_PATH}")
MESSAGE(STATUS "* BBTK_LIB_PATH =${BBTK_LIB_PATH}")
MESSAGE(STATUS "* BBTK_PACKAGE_LIB_PATH =${BBTK_PACKAGE_LIB_PATH}")
MESSAGE(STATUS "* BBTK_DOC_REL_PATH =${BBTK_DOC_REL_PATH}")
MESSAGE(STATUS "* BBTK_BBS_REL_PATH =${BBTK_BBS_REL_PATH}")
MESSAGE(STATUS "* BBTK_DATA_REL_PATH =${BBTK_DATA_REL_PATH}")
+MESSAGE(STATUS "===============================================")
#-----------------------------------------------------------------------------
-#-----------------------------------------------------------------------------
-# MACRO TO ADD A COMPILER DEFINITION WHICH ADDS ALSO THE DEF
-# INTO DOXYGEN PREDEFINED VAR
-# (OTHERWISE DOXYGEN WOULD NOT PARSE THE FILES BLOCKED)
-MACRO(ADD_DEF DEF)
- MESSAGE(STATUS "* Added definition -D${DEF}")
- ADD_DEFINITIONS( -D${DEF} )
- SET(DOXYGEN_DOC_PREDEFINED
- ${DOXYGEN_DOC_PREDEFINED};${DEF}
- CACHE
- STRING
- ""
- FORCE)
- MARK_AS_ADVANCED(DOXYGEN_DOC_PREDEFINED)
-ENDMACRO(ADD_DEF)
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# MACRO TO ADD A COMPILER DEFINITION WITH VALUE WHICH ADDS ALSO THE DEF
-# INTO DOXYGEN PREDEFINED VAR
-# (OTHERWISE DOXYGEN WOULD NOT PARSE THE FILES BLOCKED)
-MACRO(ADD_DEF_WITH_VAL DEF VAL)
- MESSAGE(STATUS "* Added definition -D${DEF}=${VAL}")
- ADD_DEFINITIONS( -D${DEF}=${VAL} )
- SET(DOXYGEN_DOC_PREDEFINED
- ${DOXYGEN_DOC_PREDEFINED};${DEF}=${VAL}
- CACHE
- STRING
- ""
- FORCE)
- MARK_AS_ADVANCED(DOXYGEN_DOC_PREDEFINED)
-ENDMACRO(ADD_DEF_WITH_VAL)
-#-----------------------------------------------------------------------------
-
-
#========================================================================
# MACRO WHICH COPIES ALL IMAGES (png, jpg, gif)
# FROM SOURCE TREE TO DOC BUILD TREE
ENDMACRO(BBTK_DOC_INSTALL_IMAGES)
#========================================================================
-#========================================================================
-# Creates a directory if it does not exist
-MACRO(MKDIR DIR)
- IF(NOT IS_DIRECTORY ${DIR})
- MESSAGE(STATUS "* Creating directory '${DIR}'")
- FILE(MAKE_DIRECTORY ${DIR})
- ENDIF(NOT IS_DIRECTORY ${DIR})
-ENDMACRO(MKDIR)
-#========================================================================
#========================================================================
#----------------------------------------------------------------------------
INCLUDE(${BBTK_CMAKE_DIR}/BBTKMacros.cmake)
#----------------------------------------------------------------------------
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake)
+#----------------------------------------------------------------------------
INCLUDE(${BBTK_CMAKE_DIR}/BBTKKernelConfig.cmake)
#----------------------------------------------------------------------------
INCLUDE(${BBTK_CMAKE_DIR}/BBTKSetDeducedPaths.cmake)
#----------------------------------------------------------------------------
-INCLUDE(${BBTK_CMAKE_DIR}/BBTKPreventInSourceBuild.cmake)
+# NOW IN CREA :
+#INCLUDE(${BBTK_CMAKE_DIR}/BBTKPreventInSourceBuild.cmake)
+CREA_PREVENT_IN_SOURCE_BUILD()
#----------------------------------------------------------------------------
INCLUDE(${BBTK_CMAKE_DIR}/BBTKBuildAllOption.cmake)
#----------------------------------------------------------------------------
INCLUDE(${BBTK_CMAKE_DIR}/BBTKMarkAsAdvanced.cmake)
#----------------------------------------------------------------------------
-INCLUDE(${BBTK_CMAKE_DIR}/BBTKFindLibraries.cmake)
-#----------------------------------------------------------------------------
INCLUDE(${BBTK_CMAKE_DIR}/BBTKDefineOptions.cmake)
#----------------------------------------------------------------------------
INCLUDE(${BBTK_CMAKE_DIR}/BBTKAddDefinitions.cmake)
+MESSAGE(STATUS "===============================================")
+MESSAGE(STATUS "Setting up deduced pathes:")
# Black box docs relative path
SET(BBTK_BBDOC_REL_PATH ${BBTK_DOC_REL_PATH}/bbdoc)
# Doxygen docs relative path
# Create build directories if necessary
-MKDIR(${BBTK_DOC_BUILD_PATH})
-MKDIR(${BBTK_BBDOC_BUILD_PATH})
-MKDIR(${BBTK_DOXYGEN_BUILD_PATH})
-MKDIR(${BBTK_BBS_BUILD_PATH})
-MKDIR(${BBTK_DATA_BUILD_PATH})
+CREA_MKDIR(${BBTK_DOC_BUILD_PATH})
+CREA_MKDIR(${BBTK_BBDOC_BUILD_PATH})
+CREA_MKDIR(${BBTK_DOXYGEN_BUILD_PATH})
+CREA_MKDIR(${BBTK_BBS_BUILD_PATH})
+CREA_MKDIR(${BBTK_DATA_BUILD_PATH})
#-----------------------------------------------------------------------------
SET (EXECUTABLE_OUTPUT_PATH
#-----------------------------------------------------------------------------
+MESSAGE(STATUS "===============================================")
#define __bb@BBTK_PACKAGE_NAME@Package_h_INCLUDED__
#include "bbtkPackage.h"
+#include "bb@BBTK_PACKAGE_NAME@_EXPORT.h"
BBTK_DECLARE_PACKAGE(@BBTK_PACKAGE_NAME@)
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "Configuring bbtk Developers' Guide build ")
BBTK_DOC_INSTALL_IMAGES(bbtkDevelopersGuide)
BBTK_BUILD_LATEX_DOC(bbtkDevelopersGuide bbtkDevelopersGuide)
BBTK_BUILD_HTML_DOC_FROM_LATEX(bbtkDevelopersGuide bbtkDevelopersGuide)
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "Configuring bbtk doxygen doc")
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/CodingStyle.html
"${DOXYGEN_DOC_PREDEFINED}"
)
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "Configuring bbtk Package Developers' Guide build ")
BBTK_DOC_INSTALL_IMAGES(bbtkPackageDevelopersGuide)
BBTK_BUILD_LATEX_DOC(bbtkPackageDevelopersGuide bbtkPackageDevelopersGuide)
BBTK_BUILD_HTML_DOC_FROM_LATEX(bbtkPackageDevelopersGuide bbtkPackageDevelopersGuide)
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "Configuring bbtk Users' Guide build ")
+
BBTK_DOC_INSTALL_IMAGES(bbtkUsersGuide)
BBTK_BUILD_LATEX_DOC(bbtkUsersGuide bbtkUsersGuide)
BBTK_BUILD_HTML_DOC_FROM_LATEX(bbtkUsersGuide bbtkUsersGuide)
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "Configuring bbtk html doc")
+
# Configure & install images
BBTK_DOC_INSTALL_IMAGES(bbtkWebSite)
)
+MESSAGE(STATUS "=======================================")
# Tests
#-----------------------------------------------------------------------------
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "CONFIGURING bbtk LIBRARY")
+
#-----------------------------------------------------------------------------
# Test if compiler defines the pseudo-macro __FUNCTION__
#-----------------------------------------------------------------------------
-# bbtk library dependencies
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# WXWIDGETS
-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)
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# KWWIDGETS
-IF(BBTK_USE_KWWIDGETS)
- SET(USE_KWWIDGETS ON CACHE BOOL "Use KWWidgets" FORCE)
-
-# INCLUDE(cmake/FIND_AND_USE_WXWIDGETS.cmake)
-# FIND_AND_USE_WXWIDGETS()
-# ADD_DEF( _USE_WXWIDGETS_ )
- SET(BBTK_LINK_LIBRARIES
- ${BBTK_LINK_LIBRARIES}
- ${BBTK_KWWIDGETS_LIBRARIES}
- )
-ENDIF(BBTK_USE_KWWIDGETS)
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# BOOST
-SET(BBTK_USE_BOOST TRUE)
-
-IF(BBTK_USE_BOOST)
- SET(USE_BOOST ON CACHE BOOL "Use boost C++ library" FORCE)
- SET(BBTK_LINK_LIBRARIES
- ${BBTK_LINK_LIBRARIES}
- ${BBTK_BOOST_LIBRARIES}
- )
-ENDIF(BBTK_USE_BOOST)
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# 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)
-#-----------------------------------------------------------------------------
-
-MESSAGE(STATUS "bbtk link libraries = ${BBTK_LINK_LIBRARIES}")
-
-#-----------------------------------------------------------------------------
-# EO bbtk library dependencies
-#-----------------------------------------------------------------------------
-
# bbtk library creation
#-----------------------------------------------------------------------------
# Symbols must be exported (Windows)
-ADD_DEF(BBTK_EXPORT_SYMBOLS)
+CREA_DEFINE(BBTK_EXPORT_SYMBOLS)
#ADD_DEFINITIONS(-DCHECKBOXVIEW=1)
#-----------------------------------------------------------------------------
FILE(GLOB SOURCES_H "." "*.h" )
IF(BBTK_USE_KWWIDGETS)
-include("${KWWidgets_CMAKE_DIR}/KWWidgetsWrappingMacros.cmake")
-kwwidgets_wrap_tcl(bbtk LIB_TCL_SRCS "vtkKWBlackBoxDialog.cxx" "")
-SET(SOURCES ${SOURCES} ${LIB_TCL_SRCS})
+ IF(KWWIDGETS_FOUND)
+ include("${KWWidgets_CMAKE_DIR}/KWWidgetsWrappingMacros.cmake")
+ kwwidgets_wrap_tcl(bbtk LIB_TCL_SRCS "vtkKWBlackBoxDialog.cxx" "")
+ SET(SOURCES ${SOURCES} ${LIB_TCL_SRCS})
+ ENDIF(KWWIDGETS_FOUND)
ENDIF(BBTK_USE_KWWIDGETS)
#-----------------------------------------------------------------------------
SUBDIRS(ThirdParty)
#-----------------------------------------------------------------------------
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
+
#-----------------------------------------------------------------------------
# EOF
#-----------------------------------------------------------------------------
Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/12/11 09:50:35 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2008/12/11 15:30:04 $
+ Version: $Revision: 1.38 $
=========================================================================*/
/* ---------------------------------------------------------------------
bool BlackBox::bbCanReact() const
{
return ( bbGlobalGetSomeBoxExecuting()
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
|| Wx::IsSomeWindowAlive()
#endif
);
Program: bbtk
Module: $RCSfile: bbtkExecuter.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:13 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2008/12/11 15:30:04 $
+ Version: $Revision: 1.24 $
=========================================================================*/
/* ---------------------------------------------------------------------
#include "bbtkUtilities.h"
#include <fstream>
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
#include <wx/textdlg.h>
#endif
std::cin >> ans;
Set(box,input,ans);
}
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
// If the dialog mode is set to GraphicalDialog
// A dialog box is pop up
else if (mDialogMode == GraphicalDialog)
Program: bbtk
Module: $RCSfile: bbtkInterpreter.h,v $
Language: C++
- Date: $Date: 2008/11/26 12:36:43 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2008/12/11 15:30:04 $
+ Version: $Revision: 1.37 $
=========================================================================*/
/* ---------------------------------------------------------------------
namespace bbtk
{
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
class WxConsole;
#endif
void SetThrow(bool b) { mThrow = b; }
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
/// Sets the user of the interpreter (if any)
void SetUser(InterpreterUser* c) { mUser = c; }
/// Gets the InterpreterUser of this
Program: bbtk
Module: $RCSfile: bbtkWx.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:14 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/12/11 15:30:04 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
//===========================================================================
// Wx headers
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#include <wx/datetime.h>
#endif //__WXGTK__
// EO Wx headers
-#else //_USE_WXWIDGETS_
+#else //USE_WXWIDGETS
// define wxWindow
typedef void wxWindow;
-#endif // EO _USE_WXWIDGETS_
+#endif // EO USE_WXWIDGETS
//===========================================================================
//===========================================================================
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
//==================================================================
/// Conversion std::string to wxString
inline wxString std2wx(const std::string& s){
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.h,v $
Language: C++
- Date: $Date: 2008/12/11 09:50:35 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2008/12/11 15:30:04 $
+ Version: $Revision: 1.24 $
========================================================================*/
*/
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
#ifndef __bbtkWxBlackBox_h__
#endif //__bbtkWxBlackBox_h__
-#endif //_USE_WXWIDGETS_
+#endif //USE_WXWIDGETS
Program: bbtk
Module: $RCSfile: bbtkWxStreamRedirector.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:15 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/12/11 15:30:04 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
*/
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
#ifndef __bbtkWxStreamRedirector_h__
#endif // __bbtkWxStreamRedirector_h__
-#endif //_USE_WXWIDGETS_
+#endif //USE_WXWIDGETS
-#-----------------------------------------------------------------------------
+#===========================================================================
# DOES THE USER WANT TO BUILD THE PACKAGE ?
OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}
"Build the bbtk package ${BBTK_PACKAGE_NAME} ?" OFF)
-#-----------------------------------------------------------------------------
+#===========================================================================
-#-----------------------------------------------------------------------------
-IF(BBTK_CORE_PACKAGE)
- IF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
- SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- ENDIF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
-ENDIF(BBTK_CORE_PACKAGE)
-#-----------------------------------------------------------------------------
-
-
-#-----------------------------------------------------------------------------
-# IF THE USER HAS CHOSEN TO BUILD THE PACKAGE
IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- #---------------------------------------------------------------------------
-
+ #===========================================================================
+ # THE USER HAS CHOSEN TO BUILD THE PACKAGE
+ #===========================================================================
+
#===========================================================================
# If the package is not a "core" bbtk package (included into the toolkit)
- # then we have to find (and use) bbtk
+ # then we have to find and use bbtk
IF(NOT BBTK_CORE_PACKAGE)
- #-------------------------------------------------------------------------
- # Find and use the Black Box Toolkit
- # Search BBTK
- FIND_PACKAGE(BBTK)
- # If bbtk found
- IF(BBTK_FOUND)
- INCLUDE(${BBTK_USE_FILE})
- SET(BBTK_PACKAGE_LIBS
- ${BBTK_PACKAGE_LIBS}
- ${BBTK_LIBRARIES})
- MARK_AS_ADVANCED(BBTK_DIR)
- ENDIF(BBTK_FOUND)
+ FIND_PACKAGE(BBTK REQUIRED)
+ INCLUDE(${BBTK_USE_FILE})
ENDIF(NOT BBTK_CORE_PACKAGE)
-
- #===========================================================================
- # Include package configuration cmake script from bbtk dir
- INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
#===========================================================================
+ #===========================================================================
+ # Include package configuration cmake script from bbtk cmake dir
+ INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
+ #===========================================================================
- #---------------------------------------------------------------------------
ELSE(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
- #-------------------------------------------------------------------------
-
- #-----------------------------------------------------------------------
+
+ #===========================================================================
+ # Else if it is a core package we have to reset some things...
IF(BBTK_CORE_PACKAGE)
- #-----------------------------------------------------------------------
- # If package deps in global deps : reset global deps
- IF(${BBTK_PACKAGE_NAME}_IN_DEPS)
- SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL
- "bbtk packages dependencies" FORCE)
- # STRING(REPLACE "${${BBTK_PACKAGE_NAME}_DEPS};"
- # "" TEMP
- # ${BBTK_PACKAGES_DEPS})
- #
- # SET(BBTK_PACKAGES_DEPS ${TEMP}
- # CACHE INTERNAL "bbtk packages dependencies" FORCE)
- ENDIF(${BBTK_PACKAGE_NAME}_IN_DEPS)
- #-----------------------------------------------------------------------
-
- #-----------------------------------------------------------------------
- # Remove the package include scripts to avoid loading it by include *
- FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbs)
- FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbs)
- #-----------------------------------------------------------------------
+ INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_BuildOff.cmake)
ENDIF(BBTK_CORE_PACKAGE)
-
- #-------------------------------------------------------------------------
+ #===========================================================================
+
ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
Program: bbtk
Module: $RCSfile: bbstdASCII.h,v $
Language: C++
- Date: $Date: 2008/11/25 11:17:20 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/12/11 15:30:09 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
#ifndef __bbstdASCII_h_INCLUDED__
#define __bbstdASCII_h_INCLUDED__
#include "bbtkAtomicBlackBox.h"
+#include "bbstd_EXPORT.h"
#include "iostream"
namespace bbstd
{
- class /*BBTK_EXPORT*/ ASCII
+ class bbstd_EXPORT ASCII
:
public bbtk::AtomicBlackBox
{
result = NULL;
}
+/*
void Transform::bbUserCopyConstructor()
{
}
+*/
void Transform::bbUserDestructor()
{
namespace bbvtk
{
-
-class /*BBTK_EXPORT*/ Transform
- :
- public bbtk::AtomicBlackBox
-{
- BBTK_BLACK_BOX_INTERFACE(Transform,bbtk::AtomicBlackBox);
-//==================================================================
-/// User callback called in the box contructor
-virtual void bbUserConstructor();
-/// User callback called in the box copy constructor
-virtual void bbUserCopyConstructor();
-/// User callback called in the box destructor
-virtual void bbUserDestructor();
-//==================================================================
- BBTK_DECLARE_INPUT(In,vtkLinearTransform *);
- BBTK_DECLARE_INPUT(Scale,std::vector<double>);
- BBTK_DECLARE_INPUT(RotateWXYZ,std::vector<double>);
- BBTK_DECLARE_INPUT(Translate,std::vector<double>);
- BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
- BBTK_DECLARE_OUTPUT(Out,vtkLinearTransform *);
- BBTK_PROCESS(Process);
- void Process();
-
- std::vector<double> vecScale;
- std::vector<double> vecRotateWXYZ;
- std::vector<double> vecTranslate;
- std::vector<double> vecSpacing;
- vtkTransform *result;
+
+ class /*BBTK_EXPORT*/ Transform
+ :
+ public bbtk::AtomicBlackBox
+ {
+ BBTK_BLACK_BOX_INTERFACE(Transform,bbtk::AtomicBlackBox);
+ //==================================================================
+ /// User callback called in the box contructor
+ virtual void bbUserConstructor();
+ /// User callback called in the box copy constructor
+ //virtual void bbUserCopyConstructor();
+ /// User callback called in the box destructor
+ virtual void bbUserDestructor();
+ //==================================================================
+ BBTK_DECLARE_INPUT(In,vtkLinearTransform *);
+ BBTK_DECLARE_INPUT(Scale,std::vector<double>);
+ BBTK_DECLARE_INPUT(RotateWXYZ,std::vector<double>);
+ BBTK_DECLARE_INPUT(Translate,std::vector<double>);
+ BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(Out,vtkLinearTransform *);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ std::vector<double> vecScale;
+ std::vector<double> vecRotateWXYZ;
+ std::vector<double> vecTranslate;
+ std::vector<double> vecSpacing;
+ vtkTransform *result;
};
-
-BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
-BBTK_NAME("Transform");
-BBTK_AUTHOR("InfoTeam CREATIS-LRMN");
-BBTK_DESCRIPTION("vtkTransform");
-BBTK_CATEGORY("math");
-BBTK_INPUT(Transform,In,"vtkTransform to be concatenate",vtkLinearTransform *,"");
-BBTK_INPUT(Transform,Scale,"vector with sx sy sz",std::vector<double>,"");
-BBTK_INPUT(Transform,Translate,"vector with x y z",std::vector<double>,"");
-BBTK_INPUT(Transform,Spacing,"vector with spacingX spacingY spacingZ",std::vector<double>,"");
-BBTK_INPUT(Transform,RotateWXYZ,"vector with Angle Vx Vy Vz",std::vector<double>,"");
-BBTK_OUTPUT(Transform,Out,"vtkTransform result",vtkLinearTransform *,"");
-BBTK_END_DESCRIBE_BLACK_BOX(Transform);
+
+ BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
+ BBTK_NAME("Transform");
+ BBTK_AUTHOR("InfoTeam CREATIS-LRMN");
+ BBTK_DESCRIPTION("vtkTransform");
+ BBTK_CATEGORY("math");
+ BBTK_INPUT(Transform,In,"vtkTransform to be concatenate",vtkLinearTransform *,"");
+ BBTK_INPUT(Transform,Scale,"vector with sx sy sz",std::vector<double>,"");
+ BBTK_INPUT(Transform,Translate,"vector with x y z",std::vector<double>,"");
+ BBTK_INPUT(Transform,Spacing,"vector with spacingX spacingY spacingZ",std::vector<double>,"");
+ BBTK_INPUT(Transform,RotateWXYZ,"vector with Angle Vx Vy Vz",std::vector<double>,"");
+ BBTK_OUTPUT(Transform,Out,"vtkTransform result",vtkLinearTransform *,"");
+ BBTK_END_DESCRIBE_BLACK_BOX(Transform);
}
// EO namespace bbvtk
Program: bbtk
Module: $RCSfile: bbwxLayoutLine.h,v $
Language: C++
- Date: $Date: 2008/11/24 15:45:51 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/12/11 15:30:14 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
#define __bbWxLayoutLine_h__
#include "bbtkWxBlackBox.h"
-
+#include "bbwx_EXPORT.h"
namespace bbwx
- class /*BBTK_EXPORT*/ LayoutLine : public bbtk::WxBlackBox
+ class bbwx_EXPORT LayoutLine : public bbtk::WxBlackBox
{
BBTK_BLACK_BOX_INTERFACE(LayoutLine,bbtk::WxBlackBox);
Program: bbtk
Module: $RCSfile: bbwxSlider.cxx,v $
Language: C++
- Date: $Date: 2008/11/24 15:45:51 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2008/12/11 15:30:14 $
+ Version: $Revision: 1.16 $
=========================================================================*/
/* ---------------------------------------------------------------------
namespace bbwx
{
+ //--------------------------------------------------------------------------
+ // The widget created by the box
+ class SliderWidget : public wxPanel
+ {
+ public:
+ /// Ctor with the two first params the parent window and the creator box
+ /// which must be passed to the WxBlackBoxWidget constructor.
+ /// The other params initialize the widget
+ SliderWidget(Slider* box, wxWindow *parent,
+ int orientation,
+ bool changeresolution,
+ bool label,
+ wxString title,
+ int vmin,
+ int vmax,
+ int value,
+ int track);
+ /// Dtor
+ ~SliderWidget();
+ /// Events callbacks
+ /// Called when the slider is moved
+ void OnSliderTrack(wxScrollEvent& event);
+ /// Called when the slider is released
+ void OnSliderRelease(wxScrollEvent& event);
+ /// Called when the little slider which controls the resolution
+ /// of the main slider is moved (if activated)
+ void OnResolutionOfSlider(wxScrollEvent& event);
+
+ // Accessors
+ int GetValue() { return mwxSlider->GetValue(); }
+ void SetRange(int min, int max);
+ // Update the texts which display the min/max/current values of the slider
+ void RefreshLabels();
+
+ private:
+ Slider* mBox;
+ wxSlider *mwxSlider;
+ wxSlider *mResolutionOfSlider;
+ int min;
+ int max;
+ int reactiveOnTrack;
+ wxStaticText *label_vertical;
+ wxStaticText *label_min;
+ wxStaticText *label_max;
+ };
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
+
+
//-------------------------------------------------------------------------
SliderWidget::SliderWidget(Slider* box, wxWindow *parent,
int orientation,
Program: bbtk
Module: $RCSfile: bbwxSlider.h,v $
Language: C++
- Date: $Date: 2008/11/24 15:45:51 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2008/12/11 15:30:14 $
+ Version: $Revision: 1.15 $
=========================================================================*/
/* ---------------------------------------------------------------------
// Include wxBlackBox definition
#include "bbtkWxBlackBox.h"
+#include "bbwx_EXPORT.h"
// Namespace of the package "wx" is "bbwx"
namespace bbwx
{
- //--------------------------------------------------------------------------
- // Forward declaration of the box
- class Slider;
-
- //--------------------------------------------------------------------------
- // The widget created by the box
- class SliderWidget : public wxPanel
- {
- public:
- /// Ctor with the two first params the parent window and the creator box
- /// which must be passed to the WxBlackBoxWidget constructor.
- /// The other params initialize the widget
- SliderWidget(Slider* box, wxWindow *parent,
- int orientation,
- bool changeresolution,
- bool label,
- wxString title,
- int vmin,
- int vmax,
- int value,
- int track);
- /// Dtor
- ~SliderWidget();
- /// Events callbacks
- /// Called when the slider is moved
- void OnSliderTrack(wxScrollEvent& event);
- /// Called when the slider is released
- void OnSliderRelease(wxScrollEvent& event);
- /// Called when the little slider which controls the resolution
- /// of the main slider is moved (if activated)
- void OnResolutionOfSlider(wxScrollEvent& event);
-
- // Accessors
- int GetValue() { return mwxSlider->GetValue(); }
- void SetRange(int min, int max);
- // Update the texts which display the min/max/current values of the slider
- void RefreshLabels();
-
- private:
- Slider* mBox;
- wxSlider *mwxSlider;
- wxSlider *mResolutionOfSlider;
- int min;
- int max;
- int reactiveOnTrack;
- wxStaticText *label_vertical;
- wxStaticText *label_min;
- wxStaticText *label_max;
- };
- //------------------------------------------------------------------------
- //------------------------------------------------------------------------
- //------------------------------------------------------------------------
+
-
-
//------------------------------------------------------------------------
// The black box
- class /*BBTK_EXPORT*/ Slider : public bbtk::WxBlackBox
+ class bbwx_EXPORT Slider : public bbtk::WxBlackBox
{
BBTK_BLACK_BOX_INTERFACE(Slider,bbtk::WxBlackBox);
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/12/11 09:50:38 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2008/12/11 15:30:17 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
+#ifdef USE_VTK
#include "bbwxvtkViewer2D.h"
}//namespace bbtk
#endif
+#endif
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.h,v $
Language: C++
- Date: $Date: 2008/12/11 09:50:38 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2008/12/11 15:30:17 $
+ Version: $Revision: 1.15 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
-#ifdef _USE_WXWIDGETS_
-#ifdef _USE_VTK_
+#ifdef USE_WXWIDGETS
+#ifdef USE_VTK
#ifndef __bbwxvtkViewer2D_h__
#endif //__bbwxvtkViewer2D_h__
-#endif //_USE_VTK_
-#endif //_USE_WXWIDGETS_
+#endif //USE_VTK
+#endif //USE_WXWIDGETS