]> Creatis software - bbtk.git/blob - kernel/appli/bbCreatePackage/bbCreatePackage.bat.in
5817406c1f486f64eebe4fc529e70758b13c3787
[bbtk.git] / kernel / appli / bbCreatePackage / bbCreatePackage.bat.in
1 @echo off
2
3 echo creates the file architecture for a new user package
4
5
6 if %0%1==%0 goto ERROR01
7
8
9 rem bbCreatePackage path
10 set BINPATH=%~dp0
11 rem Input data path
12 set INPUT="%BINPATH%\@bbCreatePackage_DATA_REL_PATH_FROM_BIN@\void-Package"
13
14 set OUTPUT=%1
15 set PACK=%2
16 set AUTHOR=%3
17 set DESCRIPTION=%4
18 set PACK_DIRECTORY=bbtk_%PACK%_PKG
19
20 echo output=  %OUTPUT%
21 echo bin   =  %BINPATH%
22 echo input =  %INPUT%
23 echo pack  =  %PACK%
24 echo author  =  %AUTHOR%
25 echo description  =  %DESCRIPTION%
26 echo pack_directory = %PACK_DIRECTORY%
27
28 IF EXIST %OUTPUT%\%PACK_DIRECTORY% GOTO ERROR02
29
30 echo "** Creating new black box package '%PACK%' in folder '%OUTPUT%'"
31
32 mkdir %OUTPUT%\%PACK_DIRECTORY%
33 xcopy %INPUT% %OUTPUT%\%PACK_DIRECTORY% /S
34 "%BINPATH%\bbSed" %OUTPUT%\%PACK_DIRECTORY%\CMakeLists.txt   WITHOUT_NAME "%PACK%"             > %OUTPUT%\%PACK_DIRECTORY%\CMakeLists2.txt
35 "%BINPATH%\bbSed" %OUTPUT%\%PACK_DIRECTORY%\CMakeLists2.txt  WITHOUT_AUTHOR %AUTHOR%           > %OUTPUT%\%PACK_DIRECTORY%\CMakeLists3.txt
36 "%BINPATH%\bbSed" %OUTPUT%\%PACK_DIRECTORY%\CMakeLists3.txt  WITHOUT_DESCRIPTION %DESCRIPTION% > %OUTPUT%\%PACK_DIRECTORY%\CMakeLists.txt
37 del "%OUTPUT%\%PACK_DIRECTORY%\CMakeLists2.txt" 
38 del "%OUTPUT%\%PACK_DIRECTORY%\CMakeLists3.txt"
39 echo "Done !" 
40 echo "Edit the file '%OUTPUT%\%PACK_DIRECTORY%\CMakeLists.txt' to customize your package"
41
42
43
44 goto END
45
46
47 :ERROR01
48 echo bbCreatePackage.bat "<package-path> <package-name> [author] [description] "
49 goto END
50
51 :ERROR02
52 echo "ERROR : Directory '%OUTPUT%/%PACK_DIRECTORY%' already exists !"  
53 goto end
54
55
56
57 :END
58