Windows.bat 5.02 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
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 "%SHARED%" == "TRUE" (
  set STRING_DLL=-DLL
) ELSE (
  set STRING_DLL=
)

IF "%BUILD_PLATFORM%" == "VS2013" (
Jan Möbius's avatar
Jan Möbius committed
20
    set LIBPATH=E:\libs\VS2013
Jan Möbius's avatar
Jan Möbius committed
21 22 23 24
    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"
    IF "%ARCHITECTURE%" == "x64" (
25 26
      set QT_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013_64
      set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013_64
Jan Möbius's avatar
Jan Möbius committed
27 28 29
    )

    IF "%ARCHITECTURE%" == "x32" (
30
      set QT_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013
Jan Möbius's avatar
Jan Möbius committed
31
      set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013
Jan Möbius's avatar
Jan Möbius committed
32 33 34 35
    )
) 

IF "%BUILD_PLATFORM%" == "VS2015" (
Jan Möbius's avatar
Jan Möbius committed
36
    set LIBPATH=E:\libs\VS2015
Jan Möbius's avatar
Jan Möbius committed
37 38 39 40 41
    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"

    IF "%ARCHITECTURE%" == "x64" (
Jan Möbius's avatar
Jan Möbius committed
42 43
      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
Jan Möbius's avatar
Jan Möbius committed
44 45 46
    )

    IF "%ARCHITECTURE%" == "x32" (
Jan Möbius's avatar
Jan Möbius committed
47 48
      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
Jan Möbius's avatar
Jan Möbius committed
49 50 51 52
    )

) 

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

    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
    )

) 

Jan Möbius's avatar
Jan Möbius committed
66 67 68 69

IF "%APPS%" == "ON" (
  set STRING_APPS=

Kersten Schuster's avatar
Kersten Schuster committed
70 71
  ECHO "Copying Platform plugins from %QT_INSTALL_PATH%\plugins\platforms to Build\plugins\platforms"
  
Kersten Schuster's avatar
Kersten Schuster committed
72 73
  dir 
  
Jan Möbius's avatar
Jan Möbius committed
74 75 76 77 78 79
  REM Create the platform plugins subdirectory for the qt plugins required to run the gui apps
  mkdir Build\plugins
  mkdir Build\plugins\platforms

  REM Copy the platform plugins subdirectory for the qt plugins required to run the gui apps
  xcopy /Y %QT_INSTALL_PATH%\plugins\platforms Build\plugins\platforms 
schultz's avatar
schultz committed
80
  set CMAKE_CONFIGURATION=%QT_BASE_CONFIG%
Jan Möbius's avatar
Jan Möbius committed
81 82 83 84 85
) ELSE (
  set STRING_APPS=-no-apps
  set CMAKE_CONFIGURATION=
)

Jan Möbius's avatar
Jan Möbius committed
86 87 88



Jan Möbius's avatar
Jan Möbius committed
89 90
ECHO "============================================================="
ECHO "============================================================="
Jan Möbius's avatar
Jan Möbius committed
91
ECHO "Building with :"
Jan Möbius's avatar
Jan Möbius committed
92
whoami
Jan Möbius's avatar
Jan Möbius committed
93 94 95 96 97 98 99 100 101 102
ECHO "ARCHITECTURE        : %ARCHITECTURE%"
ECHO "BUILD_PLATFORM      : %BUILD_PLATFORM%"
ECHO "GTESTVERSION        : %GTESTVERSION%"
ECHO "GENERATOR           : %GENERATOR%"
ECHO "VS_PATH             : %VS_PATH%"
ECHO "LIBPATH             : %LIBPATH%"
ECHO "APPS                : %APPS%"
ECHO "SHARED              : %SHARED%"
ECHO "QT_INSTALL_PATH     : %QT_INSTALL_PATH%"
ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
Jan Möbius's avatar
Jan Möbius committed
103 104
ECHO "============================================================="
ECHO "============================================================="
Jan Möbius's avatar
Jan Möbius committed
105 106 107 108 109 110 111 112 113 114
ECHO ""
ECHO "Running Build environment checks"

IF EXIST %LIBPATH%\ (
  ECHO "LIBPATH ... Ok"
) ELSE (
  ECHO "LIBPATH not found!"
  exit 10;
)

Jan Möbius's avatar
Jan Möbius committed
115

Jan Möbius's avatar
Jan Möbius committed
116 117 118
IF EXIST %QT_INSTALL_PATH%\ (
  ECHO "QT_INSTALL_PATH ... Ok"
) ELSE (
Kersten Schuster's avatar
Kersten Schuster committed
119
  ECHO "QT_INSTALL_PATH: %QT_INSTALL_PATH%\ not found!"
Jan Möbius's avatar
Jan Möbius committed
120 121
  exit 10;
)
Jan Möbius's avatar
Jan Möbius committed
122

Jan Möbius's avatar
Jan Möbius committed
123

Jan Möbius's avatar
Jan Möbius committed
124
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%"  -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=%APPS% -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DCMAKE_WINDOWS_LIBS_DIR="e:\libs" -DOPENMESH_BUILD_SHARED=%SHARED% %CMAKE_CONFIGURATION% ..
Jan Möbius's avatar
Jan Möbius committed
125 126 127 128 129 130 131 132 133

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

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

cd unittests

unittests.exe --gtest_output=xml

134 135
unittests_customvec.exe --gtest_output=xml

Jan Möbius's avatar
Jan Möbius committed
136 137 138 139 140 141 142 143
cd ..

cd ..

mkdir build-debug

cd build-debug

Jan Möbius's avatar
Jan Möbius committed
144
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DOPENMESH_BUILD_UNIT_TESTS=TRUE  -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_SHARED=%SHARED% -DBUILD_APPS=%APPS% %CMAKE_CONFIGURATION% ..
Jan Möbius's avatar
Jan Möbius committed
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161

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

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


copy Build\lib\*d.lib ..\build-release\Build\lib

IF "%SHARED%" == "TRUE" (
  copy Build\*.dll ..\build-release\Build
) 


cd unittests

unittests.exe --gtest_output=xml

162 163
unittests_customvec.exe --gtest_output=xml

Jan Möbius's avatar
Jan Möbius committed
164 165 166 167 168 169 170 171 172 173
IF %errorlevel% NEQ 0 exit /b %errorlevel%

cd ..

cd ..

cd build-release

del *.exe

Jan Möbius's avatar
Jan Möbius committed
174
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%"  -G "%GENERATOR%" -DBUILD_APPS=%APPS% -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
Jan Möbius's avatar
Jan Möbius committed
175 176 177 178 179

%VS_PATH% /Build "Release" OpenMesh.sln /Project "PACKAGE"

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

Jan Möbius's avatar
Jan Möbius committed
180
move OpenMesh-*.exe "OpenMesh-7.1-Git-Master-%CI_BUILD_REF%-%BUILD_PLATFORM%-%STRING_ARCH%%STRING_DLL%%STRING_APPS%.exe"
Jan Möbius's avatar
Jan Möbius committed
181 182 183