--- /dev/null
+@echo off
+
+echo ##########################################################################
+echo gmsh %VERSION%
+echo ##########################################################################
+
+IF NOT DEFINED SAT_DEBUG (
+ SET SAT_DEBUG=0
+)
+
+SET PRODUCT_BUILD_TYPE=Release
+SET BUILD_SHARED=ON
+if %SAT_DEBUG% == 1 (
+ set PRODUCT_BUILD_TYPE=Debug
+ set BUILD_SHARED=OFF
+)
+
+if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%
+if NOT exist "%PRODUCT_INSTALL%\include" mkdir %PRODUCT_INSTALL%\include
+if NOT exist "%PRODUCT_INSTALL%\bin" mkdir %PRODUCT_INSTALL%\bin
+
+REM clean BUILD directory
+if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR%
+mkdir %BUILD_DIR%
+
+cd %BUILD_DIR%
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/%
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE%
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BUILD_LIB=ON
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BUILD_SHARED=%BUILD_SHARED%
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BUILD_DYNAMIC=%BUILD_SHARED%
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_ACIS=OFF
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_FLTK=OFF
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_ONELAB_METAMODEL=OFF
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PARSER=ON
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PETSC=OFF
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PRIVATE_API=ON
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_CGNS=OFF
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_TESTS=OFF
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PLUGINS=OFF
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR:STRING="Visual Studio 15 2017 Win64"
+set MSBUILDDISABLENODEREUSE=1
+
+echo.
+echo *********************************************************************
+echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS%
+echo *********************************************************************
+echo.
+
+%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR%
+if NOT %ERRORLEVEL% == 0 (
+ echo "ERROR on cmake"
+ exit 1
+)
+
+echo.
+echo *********************************************************************
+echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj
+echo *********************************************************************
+echo.
+
+msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj
+if NOT %ERRORLEVEL% == 0 (
+ echo ERROR on msbuild gmsh.vcxproj
+ exit 2
+)
+
+echo.
+echo *********************************************************************
+echo *** installation...
+echo *********************************************************************
+echo.
+
+msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj
+if NOT %ERRORLEVEL% == 0 (
+ echo ERROR on msbuild INSTALL.vcxproj
+ exit 3
+)
+
+echo.
+echo *********************************************************************
+echo *** installation Headers...
+echo *********************************************************************
+echo.
+msbuild /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 /p:BuildProjectReferences=false get_headers.vcxproj
+if NOT %ERRORLEVEL% == 0 (
+ echo ERROR on msbuild get_headers.vcxproj
+ exit 4
+)
+
+copy /Y /B %BUILD_DIR%\%PRODUCT_BUILD_TYPE%\*.lib %PRODUCT_INSTALL%\bin
+copy /Y /B %BUILD_DIR%\%PRODUCT_BUILD_TYPE%\*.exp %PRODUCT_INSTALL%\bin
+
+SETLOCAL ENABLEDELAYEDEXPANSION
+FOR %%f IN (gmsh.h gmsh.h_cwrap gmshc.h) do (
+ set X=%%f
+ copy /Y %SOURCE_DIR%\api\%%f %PRODUCT_INSTALL%\include\%X%
+)
+ENDLOCAL
+
+cd %BUILD_DIR%\Headers\gmsh
+SETLOCAL ENABLEDELAYEDEXPANSION
+FOR %%f IN (*.h) do (
+ set X=%%f
+ copy /Y %SOURCE_DIR%\api\%%f %PRODUCT_INSTALL%\include\%X%
+)
+ENDLOCAL
+
+cd %PRODUCT_INSTALL%\include\gmsh
+SETLOCAL ENABLEDELAYEDEXPANSION
+FOR %%f IN (*.h) do (
+ set X=%%f
+ copy /Y %PRODUCT_INSTALL%\include\gmsh\%%f %PRODUCT_INSTALL%\include\%X%
+)
+ENDLOCAL
+
+REM these two files need to be moved to bin, adding bin directory to PATH does not help.
+cp %PRODUCT_INSTALL%\lib\gmsh.py %PRODUCT_INSTALL%\bin\gmsh.py
+if %SAT_DEBUG% == 0 (
+ cp %PRODUCT_INSTALL%\lib\gmsh.dll %PRODUCT_INSTALL%\bin\gmsh.dll
+)
+
+echo.
+echo ########## END
--- /dev/null
+#!/bin/bash
+
+echo "##########################################################################"
+echo "gmsh" $VERSION
+echo "##########################################################################"
+
+
+
+CMAKE_OPTIONS=""
+# common settings
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE=Release"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_BUILD_SHARED=ON"
+
+# build options
+echo "*** GMSH version $VERSION >= 4."
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_ACIS=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_FLTK=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_MED=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_ONELAB_METAMODEL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_PARSER=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_PETSC=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_PRIVATE_API=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_CGNS=OFF" # default value is set to ON in release 4.1.4
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_LIBDIR=${PRODUCT_INSTALL}/lib" # strangely on Ubuntu GMSH installs the .so in lib instead of lib/lib64 - so force to lib64
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_PREFIX_PATH=${LAPACK_ROOT_DIR}" # set path of third libraries to our associated internal products
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_OPENMP=ON" # get OpenMP based parallelism working
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_PLUGINS=OFF" # needed for correct GmshFinalize() after version 4.3.0
+if [[ $DIST_NAME == "FD" && $DIST_VERSION == "32" ]]
+then
+ CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_MMG3D=OFF" # removed anyhow in GMS 4.6
+fi
+
+echo "*** cmake" $CMAKE_OPTIONS
+cmake $CMAKE_OPTIONS $SOURCE_DIR
+
+if [ $? -ne 0 ]
+then
+ echo "ERROR on CMake"
+ exit 1
+fi
+
+echo
+echo "*** make" $MAKE_OPTIONS
+make $MAKE_OPTIONS
+if [ $? -ne 0 ]
+then
+ echo "ERROR on make"
+ exit 2
+fi
+
+echo
+echo "*** make install"
+make install
+if [ $? -ne 0 ]
+then
+ echo "ERROR on make install"
+ exit 3
+fi
+
+echo
+if [ -n "$SALOME_GMSH_HEADERS_STD" ]; then
+ echo "Using standard directory structure"
+else
+ echo "*** copy all .h in sources to install"
+ cp -f --backup=numbered `find $SOURCE_DIR -name "*.h"` $PRODUCT_INSTALL/include/ && \
+ mv $PRODUCT_INSTALL/include/gmsh/* $PRODUCT_INSTALL/include/ && \
+ rmdir $PRODUCT_INSTALL/include/gmsh/
+ if [ $? -ne 0 ]
+ then
+ echo "ERROR on copy"
+ exit 4
+ fi
+fi
+
+echo
+echo "########## END"
+