forked from jamesgregson/pyPolyCSG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
115 lines (104 loc) · 5.58 KB
/
setup.py
File metadata and controls
115 lines (104 loc) · 5.58 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
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
104
105
106
107
108
109
110
111
112
113
114
115
from distutils.core import setup, Extension
# ==========================================================================
# INFORMATION ==============================================================
# ==========================================================================
#
# Installs Boost::python wrappers for the CSG library. See the README for
# license and install information
#
# Install information is available in the README file in this directory.
# You will need to modify the paths in the following sections for the
# appropriate Boost install directory & library name.
#
# Required dependencies are Boost and Carve. CGAL support is planned but
# not implemented. VTK is optional and allows output of *.vtp files if
# used (by default it is disabled).
#
# The third_party/ subdirectory contains a modified version of
# Carve-1.4.0 that compiles and builds under XCode 4.5 (my development
# machine), fixing some minor compile errors that occur with LLVM. GCC
# MSVC users *may* be able to use this modified version. If not, the
# official distribution for version 1.4.0 is available from:
# http://carve.googlecode.com/files/carve-1.4.0.tgz
#
# Once paths are setup correctly, install with:
#
# sudo python setup.py install
#
# Then see the examples in the scripts/ subdirectory.
# ==========================================================================
# Compiler paths and defines ===============================================
# ==========================================================================
defines = [ ]
compiler_flags = [ ]
include_dirs = [ 'include' ]
library_dirs = [ ]
libraries = [ ]
# ==========================================================================
# Setup for Boost ==========================================================
# ==========================================================================
boost_defines = [ ]
boost_compiler_flags = [ ]
boost_include_dirs = [ '/usr/local/include' ]
boost_library_dirs = [ '/usr/local/lib' ]
boost_libraries = [ 'boost_python-mt' ]
# ==========================================================================
# Setup for Carve ==========================================================
# ==========================================================================
use_carve = True
carve_defines = [ ('CSG_USE_CARVE', '1') ]
carve_compiler_flags = []
carve_include_paths = [ './third_party/carve-1.4.0/include', 'third_party/carve-1.4.0-build/include' ]
carve_library_paths = [ './third_party/carve-1.4.0-build/lib' ]
carve_libraries = [ 'carve' ]
# ==========================================================================
# Setup for CGAL ===========================================================
# ==========================================================================
use_cgal = False
cgal_defines = [ ('CSG_USE_CGAL','1') ]
cgal_compiler_flags = [ '-frounding-math' ]
cgal_include_paths = [ '/usr/local/include' ]
cgal_library_paths = [ '/usr/local/lib' ]
cgal_libraries = [ 'cgal' ]
# ==========================================================================
# Setup for VTK ============================================================
# ==========================================================================
use_vtk = False
vtk_defines = [ ('CSG_USE_VTK','1') ]
vtk_compiler_flags = []
vtk_include_paths = [ '/usr/local/include/vtk-5.8' ]
vtk_library_paths = [ '/usr/local/lib/vtk-5.8' ]
vtk_libraries = [ 'vtkalglib', 'vtkCharts', 'vtkCommon', 'vtkGraphics', 'vtkDICOMParser', 'vtkexoIIc', 'vtkexpat', 'vtkFiltering', 'vtkfreetype', 'vtkftgl', 'vtkGenericFiltering', 'vtkGeovis', 'vtkHybrid', 'vtkImaging', 'vtkInfovis', 'vtkIO', 'vtklibxml2', 'vtkNetCDF', 'vtkproj4', 'vtkRendering', 'vtksys', 'vtkverdict', 'vtkViews', 'vtkVolumeRendering', 'vtkWidgets', 'vtkzlib' ]
# ==========================================================================
# pyCSG Extension module source files ======================================
# ==========================================================================
sources = ['source/mesh_io.cpp', 'source/polyhedron.cpp', 'source/polyhedron_binary_op.cpp', 'source/polyhedron_unary_op.cpp', 'source/triangulate.cpp', 'source/python_wrapper.cpp' ]
# ==========================================================================
# Combine all paths and options into final build options ===================
# ==========================================================================
include_dirs += boost_include_dirs
library_dirs += boost_library_dirs
libraries += boost_libraries
defines += boost_defines
# add the carve options to the build, if needed
if use_carve:
include_dirs += carve_include_paths
library_dirs += carve_library_paths
libraries += carve_libraries
defines += carve_defines
# add the cgal options to the build, if needed
if use_cgal:
include_dirs += cgal_include_paths
library_dirs += cgal_library_paths
libraries += cgal_libraries
defines += cgal_defines
# add the vtk options to the build, if needed
if use_vtk:
include_dirs += vtk_include_paths
library_dirs += vtk_library_paths
libraries += vtk_libraries
defines += vtk_defines
# ==========================================================================
# Run the setup script =====================================================
# ==========================================================================
setup( name='pyPolyCSG', version='1.0', ext_modules=[Extension( 'pyPolyCSG', sources, define_macros=defines, extra_compile_args=compiler_flags, include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries )] )