Salome HOME
spns #29880 : UB22.04 support: opencv - omniORB
[tools/sat_salome.git] / products / compil_scripts / lata.bat
1 @echo off
2
3 echo ##########################################################################
4 echo Installing LATA %VERSION%
5 echo ##########################################################################
6
7
8 if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%
9 if NOT exist "%PRODUCT_INSTALL%\lib" mkdir %PRODUCT_INSTALL%\lib
10
11 REM clean BUILD directory
12 if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR%
13 mkdir %BUILD_DIR%
14
15 robocopy %SOURCE_DIR% %BUILD_DIR% /E /NP /NFL /NDL /NS /NC
16 if NOT %ERRORLEVEL% == 1 (
17     echo ERROR when copying archive
18     exit 1
19 )
20
21 REM LATA source directory
22 set LATA_SRC_DIR=%BUILD_DIR%\src
23
24 REM LATA binary directory
25 set LATA_BIN_DIR=%BUILD_DIR%\bin
26
27 REM build folder
28 mkdir %BUILD_DIR%\plugin_visit\build_paraview
29
30 REM copy the patched CMake file... caution, the patch is provided with the archive
31 copy %BUILD_DIR%\plugin_visit\CMakeLists.txt.para %BUILD_DIR%\plugin_visit\build_paraview\CMakeLists.txt
32 if NOT %ERRORLEVEL% == 0 (
33     echo ERROR when copying CMakeLists.txt
34     exit 2
35 )
36
37 cd %BUILD_DIR%\plugin_visit\build_paraview
38
39 REM add required symbolic links
40 cp %BUILD_DIR%\plugin_visit\src\avtlataFileFormat.h avtlataFileFormat.h
41 cp %BUILD_DIR%\plugin_visit\src\avtlataFileFormat.C avtlataFileFormat.C 
42 for /r "%LATA_SRC_DIR%/commun_triou" %%G in (*.cpp) do COPY %%~G *.C
43 for /r "%LATA_SRC_DIR%/commun_triou" %%G in (*.h) do COPY %%~G *.h
44 for /r "%LATA_SRC_DIR%/triou_compat" %%G in (*.h) do COPY %%~G *.h
45 for /r "%LATA_SRC_DIR%/triou_compat" %%G in (*.cpp) do COPY %%~G *.C
46
47 REM define the VISITLIBPATH variable
48 set VISITLIBPATH=%BUILD_DIR%\VisItLib
49
50 echo.
51 echo INFO: running cmake -DVisItBridgePlugin_SOURCE_DIR=%BUILD_DIR%\VisItLib
52
53 cd %BUILD_DIR%\build_paraview
54
55 SET CMAKE_OPTIONS=-DCMAKE_BUILD_TYPE:STRING=Release
56 SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64"
57 SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVisItBridgePlugin_SOURCE_DIR=%BUILD_DIR:\=/%/VisItLib 
58 cmake %CMAKE_OPTIONS%
59 if NOT %ERRORLEVEL% == 0 (
60     echo ERROR: failed to run command: cmake %CMAKE_OPTIONS%
61     exit 1
62 )
63
64 echo.
65 echo INFO: fix file: vtkVisItReaderlataSM.xml
66 REM copy the patched CMake file... caution, the patch is provided with the archive
67 rm -f vtkVisItReaderlataSM.xml
68
69 cp %BUILD_DIR%\plugin_visit\vtkVisItReaderlataSM.xml.para vtkVisItReaderlataSM.xml
70
71 REM create a doc folder
72 mkdir %BUILD_DIR%\doc
73
74 echo.
75 echo "INFO: running command: make..."
76 msbuild %MAKE_OPTIONS% ALL_BUILD.vcxproj /p:Configuration=Release /p:Platform=x64
77 if NOT %ERRORLEVEL% == 0 (
78     echo ERROR on msbuild ALL_BUILD.vcxproj
79     exit 2
80 )
81
82 echo.
83 echo INFO: copy the shared objects library to the installation folder.
84 copy %BUILD_DIR%\libVisItReaderlata.dll %PRODUCT_INSTALL%\lib\libVisItReaderlata.dll
85 if NOT %ERRORLEVEL% == 0 (
86     echo ERROR when copying libVisItReaderlata.dll
87     exit 2
88 )
89
90 taskkill /F /IM "mspdbsrv.exe"
91
92 echo.
93 echo ########## END