-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcmake-mtools.py
More file actions
executable file
·52 lines (43 loc) · 1.49 KB
/
cmake-mtools.py
File metadata and controls
executable file
·52 lines (43 loc) · 1.49 KB
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
#!/usr/bin/env python
#
# Invoque cmake to build the library
# usage: ./cmake-mtools [CMAKE_OPTIONS...]
#
import sys
import os
import subprocess
carg = sys.argv
del carg[0]
if (len(carg) > 0) and (carg[0][0:2] != '-D'):
str = """
******************************************
* CMake script for library vindar/mtools *
******************************************
Usage: ./cmake_tools.py [OPTIONS...]
List of possible options:
-DUSE_COTIRE=X use precompiled headers (default X=0)
-DCONSOLE_ONLY=X disable graphics (default X=0)
-DUSE_CAIRO=X use cairo if present (default X=0)
-DUSE_SSE=X use SSE specific instructions (default X=0)
-DUSE_OPENMP=X use OpenMP if present (default X=0)
-DUSE_OPENCL=X use OpenCL if present (default X=0)
-DUSE_OPENGL=X use OpenGL if present (default X=1)
-DLOCAL_INSTALL=X use library directly from install path.
-DCMAKE_INSTALL_PREFIX=install/path/ set path if LOCAL_INSTALL=1
-DCMAKE_CXX_COMPILER=/path/to/compiler set the c++ compiler to use
"""
print(str);
else:
carg.insert(0,'cmake');
carg.append('..');
# on windows, we build x64 binaries
if sys.platform.startswith('win32'):
carg.insert(1,'-A');
carg.insert(2,'x64');
# invoque cmake with the correct arguments
if (not os.path.exists('build')):
os.makedirs('build')
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname + "/build")
subprocess.call(carg)