]> Creatis software - bbtk.git/blob - kernel/cmake/BBTKMacros.cmake
8b1c2ae0f58bb5515725f0b47dff38eaa0d79c03
[bbtk.git] / kernel / cmake / BBTKMacros.cmake
1  # ---------------------------------------------------------------------
2  #
3  # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4  #                        pour la SantÈ)
5  # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6  # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7  # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8  #
9  #  This software is governed by the CeCILL-B license under French law and
10  #  abiding by the rules of distribution of free software. You can  use,
11  #  modify and/ or redistribute the software under the terms of the CeCILL-B
12  #  license as circulated by CEA, CNRS and INRIA at the following URL
13  #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14  #  or in the file LICENSE.txt.
15  #
16  #  As a counterpart to the access to the source code and  rights to copy,
17  #  modify and redistribute granted by the license, users are provided only
18  #  with a limited warranty  and the software's author,  the holder of the
19  #  economic rights,  and the successive licensors  have only  limited
20  #  liability.
21  #
22  #  The fact that you are presently reading this means that you have had
23  #  knowledge of the CeCILL-B license and that you accept its terms.
24  # ------------------------------------------------------------------------ */
25
26
27
28 #========================================================================
29 # MACRO WHICH COPIES ALL IMAGES (png, jpg, gif) 
30 # FROM SOURCE TREE TO DOC BUILD TREE
31 # AND INSTALL THEM IN BBTK DOC TREE
32 MACRO(BBTK_DOC_INSTALL_IMAGES DOC_RELATIVE_INSTALL_PATH)
33   MESSAGE(STATUS "* Copying png,jpg,tif images in ${BBTK_DOC_BUILD_PATH}/${DOC_RELATIVE_INSTALL_PATH}")
34   FILE(GLOB PNG_IMAGES "*.png")
35   FILE(GLOB JPG_IMAGES "*.jpg")
36   FILE(GLOB TIF_IMAGES "*.tif")
37   SET(IMAGES
38     ${PNG_IMAGES}
39     ${JPG_IMAGES}
40     ${TIF_IMAGES}
41     )
42 #    MESSAGE(ERROR ${IMAGES} )
43   FOREACH(image ${IMAGES})  
44     GET_FILENAME_COMPONENT(filename "${image}" NAME)
45     CONFIGURE_FILE(
46       ${image}
47        ${BBTK_DOC_BUILD_PATH}/${DOC_RELATIVE_INSTALL_PATH}/${filename}
48       COPYONLY
49       ) 
50       
51     #  IF (WIN32)
52 #       CONFIGURE_FILE(
53 #          ${image}
54 #          ${CMAKE_CURRENT_BINARY_DIR}/${filename}
55 #          COPYONLY
56 #         )
57 #      ENDIF(WIN32)
58     # MESSAGE(ERROR "${image} (${filename}) in :  ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH}/${filename}")
59   ENDFOREACH(image)
60   INSTALL( 
61       FILES ${IMAGES} 
62       DESTINATION ${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH}
63     )  
64 ENDMACRO(BBTK_DOC_INSTALL_IMAGES)
65 #========================================================================
66
67
68
69 #========================================================================
70 MACRO(MAKE_DLL_PATH)
71   IF(WIN32)
72     IF(USE_DOT)
73       IF (NOT DOT_DIR)
74         FIND_PATH(DOT_DIR dot.exe PATHS $ENV{PATH} )
75         IF(NOT DOT_DIR)
76           MESSAGE(FATAL_ERROR "Dot not found : set DOT_DIR to the folder containing dot.exe")
77         ELSE(NOT DOT_DIR)
78           MESSAGE(STATUS "Looking for dot... - found in ${DOT_DIR}")
79          ENDIF(NOT DOT_DIR)
80       ENDIF(NOT DOT_DIR)
81     ENDIF(USE_DOT)      
82 #    SET(DLL_PATHA Path=${ADDITIONAL_DLL_PATH}__RR__%WXWIN%/lib/vc_dll/__RR__%VTK_DIR%__RR__%ITK_DIR%/../../bin/__RR__%PATH%__RR__${DOT_DIR})
83     SET(DLL_PATHA ${ADDITIONAL_DLL_PATH}__RR__${DOT_DIR}__RR__)
84                 
85     FOREACH(APATH $ENV{PATH})
86           SET(DLL_PATHA ${DLL_PATHA}__RR__${APATH})
87     ENDFOREACH(APATH)
88     STRING(REPLACE "__RR__" "\;" DLL_PATH ${DLL_PATHA} )
89   ENDIF(WIN32)  
90 ENDMACRO(MAKE_DLL_PATH)
91 #========================================================================