Windows.bat 3.28 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
68
69
70
71
72
73
74
75
76
77
ECHO "Building with :"
ECHO "ARCHITECTURE        : %ARCHITECTURE%"
ECHO "BUILD_PLATFORM      : %BUILD_PLATFORM%"
ECHO "GTESTVERSION        : %GTESTVERSION%"
ECHO "GENERATOR           : %GENERATOR%"
ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
ECHO "VS_PATH             : %VS_PATH%"
ECHO "LIBPATH             : %LIBPATH%"



Jan Möbius's avatar
Jan Möbius committed
78
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%"  -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
79
80
81
82
83

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

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

84
85
86
cd ..

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

88
89
90
..\..\..\build-release\src\Unittests\Release\unittests.exe

cd ..\..\..\
Jan Möbius's avatar
Jan Möbius committed
91
92
93

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

94
95
96
97
98

mkdir build-debug

cd build-debug

Jan Möbius's avatar
Jan Möbius committed
99
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
100
101
102
103

%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
104

Jan Möbius's avatar
Jan Möbius committed
105
cd ..
106
107
108
109
110

cd src\Unittests\TestFiles

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

Jan Möbius's avatar
Jan Möbius committed
111
112

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