]> Creatis software - bbtk.git/blob - kernel/appli/bbPostInstallPackage/bbPostInstallPackage.bat.in
Feature #1774
[bbtk.git] / kernel / appli / bbPostInstallPackage / bbPostInstallPackage.bat.in
1 rem # ---------------------------------------------------------------------
2 rem #
3 rem # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 rem #                        pour la SantÈ)
5 rem # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 rem # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 rem # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 rem #
9 rem #  This software is governed by the CeCILL-B license under French law and
10 rem #  abiding by the rules of distribution of free software. You can  use,
11 rem #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 rem #  license as circulated by CEA, CNRS and INRIA at the following URL
13 rem #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 rem #  or in the file LICENSE.txt.
15 rem #
16 rem #  As a counterpart to the access to the source code and  rights to copy,
17 rem #  modify and redistribute granted by the license, users are provided only
18 rem #  with a limited warranty  and the software's author,  the holder of the
19 rem #  economic rights,  and the successive licensors  have only  limited
20 rem #  liability.
21 rem #
22 rem #  The fact that you are presently reading this means that you have had
23 rem #  knowledge of the CeCILL-B license and that you accept its terms.
24 rem # ------------------------------------------------------------------------ */
25 rem
26
27 @echo off
28
29 echo creates the file architecture for a new user package
30
31
32 if %0%1==%0 goto ERROR01
33
34
35 rem bbCreatePackage path
36 set BINPATH=%~dp0
37 rem Input data path
38 set INPUT="%BINPATH%\@bbCreatePackage_DATA_REL_PATH_FROM_BIN@\void-Package"
39
40 set OUTPUT=%1
41 set PACK=%2
42 set AUTHOR=%3
43 set DESCRIPTION=%4
44
45 echo output=  %OUTPUT%
46 echo bin   =  %BINPATH%
47 echo input =  %INPUT%
48 echo pack  =  %PACK%
49 echo author  =  %AUTHOR%
50 echo description  =  %DESCRIPTION%
51
52 IF EXIST %OUTPUT%\%PACK% GOTO ERROR02
53
54 echo "** Creating new black box package '%PACK%' in folder '%OUTPUT%'"
55
56 mkdir %OUTPUT%\%PACK%
57 xcopy %INPUT% %OUTPUT%\%PACK% /S
58 "%BINPATH%\bbSed" %OUTPUT%\%PACK%\CMakeLists.txt  WITHOUT_NAME "%PACK%" > %OUTPUT%\%PACK%\CMakeLists2.txt
59 "%BINPATH%\bbSed" %OUTPUT%\%PACK%\CMakeLists2.txt  WITHOUT_AUTHOR %AUTHOR% > %OUTPUT%\%PACK%\CMakeLists3.txt
60 "%BINPATH%\bbSed" %OUTPUT%\%PACK%\CMakeLists3.txt  WITHOUT_DESCRIPTION %DESCRIPTION% > %OUTPUT%\%PACK%\CMakeLists.txt
61 del "%OUTPUT%\%PACK%\CMakeLists2.txt" 
62 del "%OUTPUT%\%PACK%\CMakeLists3.txt"
63
64 echo
65 echo "Package created !"
66 echo
67 echo ==>
68 echo "==> Edit the file '%OUTPUT%\%PACK%\CMakeLists.txt' to customize your package"
69 echo ==>
70 echo
71 echo
72
73
74 goto END
75
76
77 :ERROR01
78 echo bbCreatePackage.bat "<package-path> <package-name> [author] [description] "
79 goto END
80
81 :ERROR02
82 echo "ERROR : Directory '%OUTPUT%/%PACK%' already exists !"  
83 goto end
84
85
86
87 :END
88