]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
NLOPT - Windows - multi Visual
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 19 May 2021 07:10:09 +0000 (09:10 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 19 May 2021 07:10:09 +0000 (09:10 +0200)
products/compil_scripts/nlopt.bat

index 927a421fd3f0fde2703dbdeb3490561898500afb..04ad47d8fb255cf712bba9d6230a4d37261e7159 100644 (file)
@@ -4,6 +4,19 @@ echo ##########################################################################
 echo nlopt %VERSION%
 echo ##########################################################################
 
+IF NOT DEFINED SAT_DEBUG (
+  SET SAT_DEBUG=0
+)
+
+SET PRODUCT_BUILD_TYPE=Release
+if %SAT_DEBUG% == 1 (
+  set PRODUCT_BUILD_TYPE=Debug
+)
+
+set PLATFORM_TARGET=x64
+if defined SALOME_APPLICATION_NAME if %SALOME_APPLICATION_NAME% == URANIE (
+  set PLATFORM_TARGET=Win32
+)
 
 if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%
 REM clean BUILD directory
@@ -11,21 +24,25 @@ if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR%
 mkdir %BUILD_DIR%
 
 cd %BUILD_DIR%
+set CMAKE_OPTIONS=
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/%
-set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=Release
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE%
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_SHARED_LIBS:BOOL=ON
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_MATLAB:BOOL=OFF
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_OCTAVE:BOOL=OFF
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_GUILE:BOOL=OFF
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSWIG_EXECUTABLE=%SWIG_ROOT_DIR:\=/%/bin/swig.exe
-set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR:STRING="Visual Studio 15 2017 Win64"
-
+if %PLATFORM_TARGET% == Win32 (
+  set CMAKE_OPTIONS=%CMAKE_OPTIONS% -A Win32 -Thost=x64 -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -g "Visual Studio 2019"
+) else (
+  set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR:STRING=%CMAKE_GENERATOR%
+)
 
 set MSBUILDDISABLENODEREUSE=1
 
 echo.
 echo *********************************************************************
-echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS%
+echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR%
 echo *********************************************************************
 echo.
 
@@ -37,11 +54,11 @@ if NOT %ERRORLEVEL% == 0 (
 
 echo.
 echo *********************************************************************
-echo *** msbuild %MAKE_OPTIONS% /p:Configuration=Release /p:Platform=x64 ALL_BUILD.vcxproj"
+echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=%PLATFORM_TARGET% ALL_BUILD.vcxproj"
 echo *********************************************************************
 echo.
 
-msbuild %MAKE_OPTIONS% /p:Configuration=Release /p:Platform=x64 ALL_BUILD.vcxproj
+msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=%PLATFORM_TARGET% ALL_BUILD.vcxproj
 if NOT %ERRORLEVEL% == 0 (
     echo ERROR on msbuild gmsh.vcxproj
     exit 2
@@ -53,12 +70,11 @@ echo *** installation...
 echo *********************************************************************
 echo.
 
-msbuild %MAKE_OPTIONS% /p:Configuration=Release /p:Platform=x64 INSTALL.vcxproj
+msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=%PLATFORM_TARGET% INSTALL.vcxproj
 if NOT %ERRORLEVEL% == 0 (
     echo ERROR on msbuild INSTALL.vcxproj
     exit 3
 )
 
-
 echo.
-echo ########## END
\ No newline at end of file
+echo ########## END