]> Creatis software - creaContours.git/blob - bbtk/Configure.cmake
*** empty log message ***
[creaContours.git] / bbtk / Configure.cmake
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 #-----------------------------------------------------------------------------
6
7 #-----------------------------------------------------------------------------
8 IF(BBTK_CORE_PACKAGE)
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 #-----------------------------------------------------------------------------
14
15
16 #-----------------------------------------------------------------------------
17 # IF THE USER HAS CHOSEN TO BUILD THE PACKAGE
18 IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
19   #---------------------------------------------------------------------------
20   
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
27     # Search BBTK
28     FIND_PACKAGE(BBTK)
29     # If bbtk found
30     IF(BBTK_FOUND)
31       INCLUDE(${BBTK_USE_FILE})
32       SET(BBTK_PACKAGE_LIBS 
33         ${BBTK_PACKAGE_LIBS}
34         ${BBTK_LIBRARIES})
35       MARK_AS_ADVANCED(BBTK_DIR)
36     ENDIF(BBTK_FOUND)
37   ENDIF(NOT BBTK_CORE_PACKAGE)
38     
39   #===========================================================================
40   # Include package configuration cmake script from bbtk dir
41   INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
42   #===========================================================================
43   
44   
45   #---------------------------------------------------------------------------
46 ELSE(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
47   #-------------------------------------------------------------------------
48   
49   #-----------------------------------------------------------------------
50   IF(BBTK_CORE_PACKAGE)
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};"
57       #      "" TEMP
58       #      ${BBTK_PACKAGES_DEPS})
59       #    
60       #    SET(BBTK_PACKAGES_DEPS ${TEMP}
61       #      CACHE INTERNAL "bbtk packages dependencies" FORCE)
62     ENDIF(${BBTK_PACKAGE_NAME}_IN_DEPS)
63     #-----------------------------------------------------------------------
64     
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)
71   
72   #-------------------------------------------------------------------------
73 ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})