Salome HOME
passage to petsc 3.14.0
[tools/sat_salome.git] / products / compil_scripts / qt.bat
1 @echo off
2
3 echo ##########################################################################
4 echo Qt %VERSION%
5 echo ##########################################################################
6
7 IF NOT DEFINED SAT_DEBUG (
8   SET SAT_DEBUG=0
9 )
10
11 SET PRODUCT_BUILD_TYPE=-release
12 REM TODO: NGH: not Tested yet
13 REM if %SAT_DEBUG% == 1 (
14 REM   set PRODUCT_BUILD_TYPE=-debug
15 REM )
16
17 if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%
18 REM clean BUILD directory
19 if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR%
20 mkdir %BUILD_DIR%
21
22 cd %SOURCE_DIR%
23
24 REM Configure
25 echo.
26 echo --------------------------------------------------------------------------
27 echo *** configure  
28 echo --------------------------------------------------------------------------
29
30 set QT_OPTIONS=-platform win32-msvc2017
31 set QT_OPTIONS=%QT_OPTIONS% -opensource -confirm-license %PRODUCT_BUILD_TYPE%
32 set QT_OPTIONS=%QT_OPTIONS% -no-angle -opengl desktop -nomake examples -nomake tests 
33 set QT_OPTIONS=%QT_OPTIONS%  -skip qtwebengine  -skip wayland -skip qtgamepad -no-openssl
34 set QT_OPTIONS=%QT_OPTIONS% -prefix %PRODUCT_INSTALL%
35 call configure  %QT_OPTIONS%
36 if NOT %ERRORLEVEL% == 0 (
37     echo "ERROR on configure"
38     exit 1
39 )
40
41 REM Compilation with nmake as said in qt documentation
42 REM nmake can crash because of multi-threading problems
43 REM Thus, we will try to run it 42 times until it works
44 set /a remaining_tries = 42
45 :nmake
46 echo *** Trying to run nmake %remaining_tries% more time.
47 set /a remaining_tries = remaining_tries - 1
48 nmake
49 if NOT %ERRORLEVEL% == 0 if %remaining_tries% gtr 0 (
50     goto nmake
51 )
52 if %remaining_tries% == 0 (
53     echo "ERROR on nmake"
54     exit 2
55 )
56
57 REM Installation
58 echo.
59 echo --------------------------------------------------------------------------
60 echo *** nmake install
61 echo --------------------------------------------------------------------------
62
63 nmake install
64 if NOT %ERRORLEVEL% == 0 (
65     echo "ERROR on nmake install"
66     exit 3
67 )
68
69 echo "*** Adding qt.conf file in order to be able to compile using the moved Qt installation"
70 echo [Paths] >  %PRODUCT_INSTALL%\bin\qt.conf
71 echo Prefix=../ >> %PRODUCT_INSTALL%\bin\qt.conf
72
73 echo.
74 echo ########## END
75