]> Creatis software - bbtk.git/blob - kernel/appli/bbCreateBlackBox/CMakeLists.txt
Feature #1774
[bbtk.git] / kernel / appli / bbCreateBlackBox / CMakeLists.txt
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 # Installs bbCreateBlackBox.bat/.sh  
27 # used to creates a new black box source file (xml or C++)
28
29 # Relative path to the data used by bbCreateBlackBox from data root folder
30 SET(bbCreateBlackBox_DATA_REL_PATH_FROM_DATA kernel/bbCreateBlackBox)
31
32 # Configure / Install the template xml files used by bbCreateBlackBox
33 # Copy it into build tree
34
35 FILE(GLOB_RECURSE LST_FILE_VOID_CREATE_PACKAGE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/xml-templates *.xml )
36 FOREACH( iLST  ${LST_FILE_VOID_CREATE_PACKAGE})
37      STRING(SUBSTRING ${iLST} 0 3 subStrTmp )
38   IF( ${subStrTmp} STREQUAL "../" )
39         # ...
40   ELSE( ${subStrTmp} STREQUAL "../" )
41     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/xml-templates/${iLST} 
42       ${BBTK_DATA_BUILD_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}/xml-templates/${iLST} 
43       COPYONLY )
44   ENDIF( ${subStrTmp} STREQUAL "../" )
45 ENDFOREACH(iLST)
46 # Install the build tree folder
47 INSTALL( 
48   DIRECTORY ${BBTK_DATA_BUILD_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}/xml-templates
49   DESTINATION ${BBTK_DATA_INSTALL_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}
50   )  
51
52 # Configure / Install the script bbCreateBlackBox
53 SET(bbCreateBlackBox_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA})
54 FILE(TO_NATIVE_PATH ${bbCreateBlackBox_DATA_REL_PATH_FROM_BIN} bbCreateBlackBox_DATA_REL_PATH_FROM_BIN)
55 IF(WIN32)
56   # Build tree 
57   CONFIGURE_FILE(
58     ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.bat.in
59     ${bbtk_BINARY_DIR}/RelWithDebInfo/bbCreateBlackBox.bat
60     @ONLY IMMEDIATE
61     )
62   CONFIGURE_FILE(
63     ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.bat.in
64     ${bbtk_BINARY_DIR}/Debug/bbCreateBlackBox.bat
65     @ONLY IMMEDIATE
66     )
67   CONFIGURE_FILE(
68     ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.bat.in
69     ${bbtk_BINARY_DIR}/Release/bbCreateBlackBox.bat
70     @ONLY IMMEDIATE
71     )
72   # install tree
73   INSTALL(
74     PROGRAMS ${bbtk_BINARY_DIR}/Debug/bbCreateBlackBox.bat
75     DESTINATION bin
76     )
77 ENDIF(WIN32)
78
79
80 IF(UNIX)
81   # Build tree 
82   CONFIGURE_FILE(
83     ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.sh.in
84     ${bbtk_BINARY_DIR}/bin/bbCreateBlackBox
85     @ONLY IMMEDIATE
86     )
87   # Install tree
88   INSTALL(
89     FILES ${bbtk_BINARY_DIR}/bin/bbCreateBlackBox
90     DESTINATION bin
91     PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
92     )
93 ENDIF(UNIX)
94
95
96
97