Salome HOME
spns #41595: move to Qt 5.15 [Windows] + Fix sip 5.5.0 installation issue if embedded...
[tools/sat_salome.git] / products / compil_scripts / qwt-6.1.6.bat
1 @echo off
2
3 echo ##########################################################################
4 echo qwt %VERSION%
5 echo ##########################################################################
6
7 IF NOT DEFINED SAT_DEBUG (
8   SET SAT_DEBUG=0
9 )
10
11 if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%
12
13 if exist "%BUILD_DIR%" rmdir /Q /S "%BUILD_DIR%"
14 mkdir %BUILD_DIR%
15
16 cd %SOURCE_DIR%
17 xcopy * %BUILD_DIR% /E /I /Q
18 if NOT %ERRORLEVEL% == 0 (
19     echo ERROR on xcopy
20     exit 1
21 )
22 cd %BUILD_DIR%
23
24 echo.
25 echo --------------------------------------------------------------------------
26 echo *** prepare qmake
27 echo --------------------------------------------------------------------------
28 echo.
29
30 rem # Remplacement des antislashs par des slashs
31 set str=%PRODUCT_INSTALL%
32 set str=%str:\=/%
33
34 call :GETTEMPNAME
35 attrib -R qwtconfig.pri 
36 sed "s|\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\)\(.*\)|\1=\2%str%|g" < qwtconfig.pri > %tmpfile%
37 move /y %tmpfile% qwtconfig.pri
38
39 cd designer
40 call :GETTEMPNAME
41 attrib -R designer.pro 
42 sed "s|\(target\.path[[:space:]]*\)=\([[:space:]]*\).*|\1=\2\$\$QWT_INSTALL_PREFIX/plugins/designer|g" < designer.pro > %tmpfile%
43 move /y %tmpfile% designer.pro
44 cd ..
45
46 REM remove debug build only if release build is requested
47 if %SAT_DEBUG% == 0 (
48   call :GETTEMPNAME
49   attrib -R qwtbuild.pri
50   sed "s|\(CONFIG[[:space:]]*+=[[:space:]]*debug_and_release\)|#\1|g" < qwtbuild.pri > %tmpfile%
51   move /y %tmpfile% qwtbuild.pri
52   sed "s|\(CONFIG[[:space:]]*+=[[:space:]]*build_all\)|#\1|g" < qwtbuild.pri > %tmpfile%
53   move /y %tmpfile% qwtbuild.pri
54 )
55
56 echo.
57 echo --------------------------------------------------------------------------
58 echo *** qmake
59 echo --------------------------------------------------------------------------
60 echo.
61
62 qmake
63 if NOT %ERRORLEVEL% == 0 (
64     echo ERROR on qmake : %ERRORLEVEL%
65     exit 1
66 )
67
68 echo.
69 echo --------------------------------------------------------------------------
70 echo *** nmake
71 echo --------------------------------------------------------------------------
72 echo.
73
74 nmake 
75 if NOT %ERRORLEVEL% == 0 (
76     echo ERROR on nmake
77     exit 2
78 )
79
80 echo.
81 echo --------------------------------------------------------------------------
82 echo *** nmake install
83 echo --------------------------------------------------------------------------
84 echo.
85
86 nmake install
87 if NOT %ERRORLEVEL% == 0 (
88     echo ERROR on nmake install
89     exit 3
90 )
91
92 echo.
93 echo ########## END
94
95 :: ========== FUNCTIONS ==========
96 exit /B
97
98 :GETTEMPNAME
99   set tmpfile=%TMP%\mytempfile-%RANDOM%.tmp
100   if exist "%tmpfile%" GOTO :GETTEMPNAME 
101   exit /B