1 #-----------------------------------------------------------------------------
2 # DOES THE USER WANT TO BUILD THE PACKAGE ?
3 OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}
4 "Build the bbtk package ${BBTK_PACKAGE_NAME} ?" OFF)
5 #-----------------------------------------------------------------------------
7 #-----------------------------------------------------------------------------
9 IF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
10 SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
11 ENDIF(NOT ${BBTK_PACKAGE_NAME}_EXCLUDE_FROM_BUILD_ALL)
12 ENDIF(BBTK_CORE_PACKAGE)
13 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17 # IF THE USER HAS CHOSEN TO BUILD THE PACKAGE
18 IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
19 #---------------------------------------------------------------------------
21 #===========================================================================
22 # If the package is not a "core" bbtk package (included into the toolkit)
23 # then we have to find (and use) bbtk
24 IF(NOT BBTK_CORE_PACKAGE)
25 #-------------------------------------------------------------------------
26 # Find and use the Black Box Toolkit
31 INCLUDE(${BBTK_USE_FILE})
35 MARK_AS_ADVANCED(BBTK_DIR)
37 ENDIF(NOT BBTK_CORE_PACKAGE)
39 #===========================================================================
40 # Include package configuration cmake script from bbtk dir
41 INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
42 #===========================================================================
45 #---------------------------------------------------------------------------
46 ELSE(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
47 #-------------------------------------------------------------------------
49 #-----------------------------------------------------------------------
51 #-----------------------------------------------------------------------
52 # If package deps in global deps : reset global deps
53 IF(${BBTK_PACKAGE_NAME}_IN_DEPS)
54 SET(BBTK_PACKAGES_DEPS "" CACHE INTERNAL
55 "bbtk packages dependencies" FORCE)
56 # STRING(REPLACE "${${BBTK_PACKAGE_NAME}_DEPS};"
58 # ${BBTK_PACKAGES_DEPS})
60 # SET(BBTK_PACKAGES_DEPS ${TEMP}
61 # CACHE INTERNAL "bbtk packages dependencies" FORCE)
62 ENDIF(${BBTK_PACKAGE_NAME}_IN_DEPS)
63 #-----------------------------------------------------------------------
65 #-----------------------------------------------------------------------
66 # Remove the package include scripts to avoid loading it by include *
67 FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbs)
68 FILE(REMOVE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbs)
69 #-----------------------------------------------------------------------
70 ENDIF(BBTK_CORE_PACKAGE)
72 #-------------------------------------------------------------------------
73 ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})