Windows.bat 2.95 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
mkdir build-release

cd build-release

IF "%ARCHITECTURE%" == "x64" (
  set ARCH_VS= Win64
  set STRING_ARCH=64-Bit
) else (
  set ARCH_VS=
  set STRING_ARCH=32-Bit
)

IF "%BUILD_PLATFORM%" == "VS2013" (
Jan Möbius's avatar
Jan Möbius committed
14
    set LIBPATH=E:\libs\VS2013
15 16 17 18 19
    set GTESTVERSION=gtest-1.6.0
    set GENERATOR=Visual Studio 12%ARCH_VS%
    set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com"
    set QT_VERSION=
    IF "%ARCHITECTURE%" == "x64" (
Jan Möbius's avatar
Jan Möbius committed
20 21
      set QT_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_64_opengl
      set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_64_opengl
22 23 24
    )

    IF "%ARCHITECTURE%" == "x32" (
Jan Möbius's avatar
Jan Möbius committed
25 26
      set QT_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_opengl
      set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_opengl
27 28 29 30
    )
) 

IF "%BUILD_PLATFORM%" == "VS2015" (
Jan Möbius's avatar
Jan Möbius committed
31
    set LIBPATH=E:\libs\VS2015
32 33 34 35 36 37
    set GTESTVERSION=gtest-1.7.0
    set GENERATOR=Visual Studio 14%ARCH_VS%
    set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com"

    set QT_VERSION=
    IF "%ARCHITECTURE%" == "x64" (
Jan Möbius's avatar
Jan Möbius committed
38 39
      set QT_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015_64
      set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015_64
40 41 42
    )

    IF "%ARCHITECTURE%" == "x32" (
Jan Möbius's avatar
Jan Möbius committed
43 44
      set QT_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015
      set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015
45 46 47 48
    )

) 

49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
IF "%BUILD_PLATFORM%" == "VS2017" (
    set LIBPATH=E:\libs\VS2017
    set GTESTVERSION=gtest-1.7.0
    set GENERATOR=Visual Studio 15%ARCH_VS%
    set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com"

    set QT_VERSION=
    IF "%ARCHITECTURE%" == "x64" (
      set QT_INSTALL_PATH=E:\Qt\Qt5.10.1\5.10.1\msvc2017_64
      set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.10.1\5.10.1\msvc2017_64
    )

    IF "%ARCHITECTURE%" == "x32" (
      echo "No Qt Binaries for VS2017 i386 available! i can not set any Qt Install Path"
    )

)
66

Jan Möbius's avatar
Jan Möbius committed
67
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%"  -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
68 69 70 71 72

%VS_PATH% /Build "Release" OpenVolumeMesh.sln /Project "ALL_BUILD"

IF %errorlevel% NEQ 0 exit /b %errorlevel%

73 74 75
cd ..

cd src\Unittests\TestFiles
Jan Möbius's avatar
Jan Möbius committed
76

77 78 79
..\..\..\build-release\src\Unittests\Release\unittests.exe

cd ..\..\..\
Jan Möbius's avatar
Jan Möbius committed
80 81 82

IF %errorlevel% NEQ 0 exit /b %errorlevel%

83 84 85 86 87

mkdir build-debug

cd build-debug

Jan Möbius's avatar
Jan Möbius committed
88
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
89 90 91 92

%VS_PATH% /Build "Debug" OpenVolumeMesh.sln /Project "ALL_BUILD"

IF %errorlevel% NEQ 0 exit /b %errorlevel%
Jan Möbius's avatar
Jan Möbius committed
93

Jan Möbius's avatar
Jan Möbius committed
94
cd ..
95 96 97 98 99

cd src\Unittests\TestFiles

..\..\..\build-debug\src\Unittests\Debug\unittests.exe

Jan Möbius's avatar
Jan Möbius committed
100 101

IF %errorlevel% NEQ 0 exit /b %errorlevel%