forked from alicevision/geogram
-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.bat
99 lines (76 loc) · 2.34 KB
/
configure.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
:: This file is for Windows users,
:: it launches CMake and creates configuration for Visual Studio
:: for Release and Debug modes.
@echo off
setlocal ENABLEDELAYEDEXPANSION
:: Check for options: [ --build_name_suffix suffix ]
set buildNameSuffix=""
if "%1" == "--build_name_suffix" (
set buildNameSuffix=%2
SHIFT & SHIFT
)
:: Read platform
set opsys=%1
:: Checking for CMake
echo.
echo ============= Checking for CMake ============
echo.
cmake --version
if %errorlevel% == 0 (
echo Found CMake
) else (
echo Error: CMake not found, please install it - see http://www.cmake.org/
exit /B 1
)
:: Checking the current OS
if "%opsys%" == "" (
if "%PROCESSOR_ARCHITECTURE%" == "x86" (
set opsys=Win32-vs2012
) else if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
set opsys=Win64-vs2012
) else (
echo Error: OS not supported
exit /B 1
)
)
if not exist "cmake\platforms\%opsys%" (
echo Error: unsupported platform: %opsys%
exit /B 1
)
:: Import the platform specific configuration
echo.
echo ============= Checking for Visual Studio ============
echo.
call "cmake\platforms\%opsys%\setvars.bat" || exit /B 1
:: Generate build tree
echo.
echo ============= Creating build system for %opsys% ============
echo.
if not exist build\%opsys%%buildNameSuffix% (
mkdir build\%opsys%%buildNameSuffix%
)
echo Using cmake generator %CMAKE_VS_GENERATOR%
set cmake_generator_options=-G "%CMAKE_VS_GENERATOR%"
if "%CMAKE_VS_GENERATOR_TOOLSET%" neq "" (
echo Using cmake generator toolset %CMAKE_VS_GENERATOR_TOOLSET%
set cmake_generator_options=%cmake_generator_options% -T "%CMAKE_VS_GENERATOR_TOOLSET%"
)
::set cmake_debug_options=--trace --debug-output
pushd build\%opsys%%buildNameSuffix%
cmake ..\.. %cmake_debug_options% %cmake_generator_options% -DVORPALINE_PLATFORM:STRING=%opsys% || exit /B 1
popd
echo.
echo ============== Vorpaline build configured ==================
echo.
echo To build vorpaline:
echo - go to build/%opsys%%buildNameSuffix%
echo - run 'cmake --build . --config=Release(or Debug) [--target=target_to_build]'
echo.
echo Note: local configuration can be specified in CMakeOptions.txt
echo See CMakeOptions.txt.sample for an example
echo You'll need to re-run configure.bat if you create or modify CMakeOptions.txt
echo.
:: Clear globals
set buildNameSuffix=
set opsys=
exit /B 0