-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathconfigure.bat
103 lines (78 loc) · 3.25 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
100
101
102
103
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
REM ----------------------------------------------------------------
REM Check for options: [ --build_name_suffix suffix ]
REM ----------------------------------------------------------------
set buildNameSuffix=""
if "%1" == "--build_name_suffix" (
set buildNameSuffix=%2
SHIFT & SHIFT
)
ECHO Configuring Graphite build
ECHO ----------------------------------------------------------------
ECHO Detecting Python (Python is optional)
SET WHERE_IS_PYTHON=NOIDEA
REM Try Python distribution first
FOR /D %%A IN (C:\Python3*) DO (
SET WHERE_IS_PYTHON=%%A
)
REM Then Anaconda (preferred). If both are found, then
REM Anaconda is selected.
FOR /D %%A IN (C:\anaconda* %HOMEDRIVE%%HOMEPATH%\Anaconda* C:\ProgramData\Anaconda*) DO (
SET WHERE_IS_PYTHON=%%A
)
SET WHERE_ARE_PYTHON_INCLUDES=NOIDEA
if exist %WHERE_IS_PYTHON%\include (
SET WHERE_ARE_PYTHON_INCLUDES=%WHERE_IS_PYTHON%\include
)
SET WHERE_IS_PYTHON_LIB=NOIDEA
FOR %%A IN (%WHERE_IS_PYTHON%\Libs\python*.lib) DO (
SET WHERE_IS_PYTHON_LIB=%%A
)
ECHO WHERE_ARE_PYTHON_INCLUDES=%WHERE_ARE_PYTHON_INCLUDES%
ECHO WHERE_IS_PYTHON_LIB=%WHERE_IS_PYTHON_LIB%
ECHO ----------------------------------------------------------------
if exist "geogram\CMakeOptions.txt" (
ECHO "Using user-supplied CMakeOptions.txt in geogram"
) else (
ECHO "Using Graphite default CMakeOptions.txt in geogram"
copy "geogram\cmake\options\CMakeOptions.txt.graphite" "geogram\CMakeOptions.txt"
)
ECHO ----------------------------------------------------------------
REM ----------------------------------------------------------------
REM Create build directory and run cmake
REM ----------------------------------------------------------------
ECHO Starting CMake...
ECHO (NOTE: it may complain about missing VULKAN, you can safely ignore)
if not exist "build\Windows%buildNameSuffix%" (
mkdir "build\Windows%buildNameSuffix%"
)
cd build\Windows%buildNameSuffix%
REM ----------------------------------------------------------------
REM If cmake.exe is in path, use it.
REM Otherwise, use fallback location.
REM ----------------------------------------------------------------
WHERE cmake.exe >nul 2>nul
IF %ERRORLEVEL% NEQ 0 (
set "cMakeCommand=%ProgramFiles%\cmake\bin\cmake.exe"
) else (
set "cMakeCommand=cmake"
)
"%cmakeCommand%" ..\.. ^
-DVORPALINE_PLATFORM:STRING=Win-vs-dynamic-generic ^
-DWHERE_ARE_PYTHON_INCLUDES="%WHERE_ARE_PYTHON_INCLUDES%" ^
-DWHERE_IS_PYTHON_LIB="%WHERE_IS_PYTHON_LIB%"
REM -----------------------------------------------------------------
REM Wait for user keypress to keep DOS box open
REM -----------------------------------------------------------------
ECHO ----------------------------------------------------------------
if exist "Graphite.sln" (
ECHO Graphite build is configured
ECHO Visual Studio solution is in GraphiteThree\build\Windows%buildNameSuffix%\Graphite.sln
) else (
ECHO ERROR: could not generate Visual Studio solution
ECHO Maybe you have an old CMake / Visual Studio ...
echo ... Try old_configure.bat
)
ECHO ----------------------------------------------------------------
REM set /p DUMMY=Hit ENTER to continue...