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