]> Creatis software - bbtk.git/blob - kernel/cmake/BBTKMacros.cmake
*** empty log message ***
[bbtk.git] / kernel / cmake / BBTKMacros.cmake
1
2 #-----------------------------------------------------------------------------
3 # MACRO TO ADD A COMPILER DEFINITION WHICH ADDS ALSO THE DEF 
4 # INTO DOXYGEN PREDEFINED VAR 
5 # (OTHERWISE DOXYGEN WOULD NOT PARSE THE FILES BLOCKED)
6 MACRO(ADD_DEF DEF)
7   MESSAGE(STATUS "* Added definition -D${DEF}")
8   ADD_DEFINITIONS( -D${DEF} )
9   SET(DOXYGEN_DOC_PREDEFINED 
10     ${DOXYGEN_DOC_PREDEFINED};${DEF}
11     CACHE 
12     STRING 
13     ""
14     FORCE)
15   MARK_AS_ADVANCED(DOXYGEN_DOC_PREDEFINED)
16 ENDMACRO(ADD_DEF)
17 #-----------------------------------------------------------------------------
18
19 #-----------------------------------------------------------------------------
20 # MACRO TO ADD A COMPILER DEFINITION WITH VALUE WHICH ADDS ALSO THE DEF 
21 # INTO DOXYGEN PREDEFINED VAR 
22 # (OTHERWISE DOXYGEN WOULD NOT PARSE THE FILES BLOCKED)
23 MACRO(ADD_DEF_WITH_VAL DEF VAL)
24   MESSAGE(STATUS "* Added definition -D${DEF}=${VAL}")
25   ADD_DEFINITIONS( -D${DEF}=${VAL} )
26   SET(DOXYGEN_DOC_PREDEFINED 
27     ${DOXYGEN_DOC_PREDEFINED};${DEF}=${VAL}
28     CACHE 
29     STRING 
30     ""
31     FORCE)
32   MARK_AS_ADVANCED(DOXYGEN_DOC_PREDEFINED)
33 ENDMACRO(ADD_DEF_WITH_VAL)
34 #-----------------------------------------------------------------------------
35
36
37 #========================================================================
38 # MACRO WHICH COPIES ALL IMAGES (png, jpg, gif) 
39 # FROM SOURCE TREE TO DOC BUILD TREE
40 # AND INSTALL THEM IN BBTK DOC TREE
41 MACRO(BBTK_DOC_INSTALL_IMAGES DOC_RELATIVE_INSTALL_PATH)
42   FILE(GLOB PNG_IMAGES "*.png")
43   FILE(GLOB JPG_IMAGES "*.jpg")
44   FILE(GLOB TIF_IMAGES "*.tif")
45   SET(IMAGES
46     ${PNG_IMAGES}
47     ${JPG_IMAGES}
48     ${TIF_IMAGES}
49     )
50  #   MESSAGE(ERROR ${IMAGES})
51   FOREACH(image ${IMAGES})  
52     GET_FILENAME_COMPONENT(filename "${image}" NAME)
53     CONFIGURE_FILE(
54       ${image}
55        ${BBTK_DOC_BUILD_PATH}/${DOC_RELATIVE_INSTALL_PATH}/${filename}
56       COPYONLY
57       ) 
58     #  IF (WIN32)
59 #       CONFIGURE_FILE(
60 #          ${image}
61 #          ${CMAKE_CURRENT_BINARY_DIR}/${filename}
62 #          COPYONLY
63 #         )
64 #      ENDIF(WIN32)
65     # MESSAGE(ERROR "${image} (${filename}) in :  ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH}/${filename}")
66   ENDFOREACH(image)
67   INSTALL( 
68       FILES ${IMAGES} 
69       DESTINATION ${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH}
70     )  
71 ENDMACRO(BBTK_DOC_INSTALL_IMAGES)
72 #========================================================================