This repository has been archived by the owner on Sep 28, 2021. It is now read-only.
forked from jamesgregson/pyPolyCSG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
95 lines (83 loc) · 2.92 KB
/
CMakeLists.txt
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
cmake_minimum_required( VERSION 2.6 )
# create a basic project
project( pyPolyCSG )
set( BOOLEAN_SOURCES
source/mesh_functions.cpp
source/mesh_io.cpp
source/polyhedron_binary_op.cpp
source/polyhedron_unary_op.cpp
source/polyhedron.cpp
source/triangulate.cpp
)
set( BOOLEAN_HEADERS
include/mesh_functions.h
include/mesh_io.h
include/polyhedron_binary_op.h
include/polyhedron_unary_op.h
include/polyhedron.h
include/triangulate.h
)
IF( NOT CSG_NO_CARVE )
find_package( CARVE )
IF( CARVE_FOUND )
message( STATUS "Found system Carve installation!" )
set( INCLUDE_DIRS ${INCLUDE_DIRS} ${CARVE_INCLUDE_DIRS} )
set( LIBS ${LIBS} ${CARVE_LIBRARIES} )
add_definitions( -DCSG_USE_CARVE )
ENDIF( CARVE_FOUND )
ENDIF( NOT CSG_NO_CARVE )
if( NOT CSG_NO_CGAL )
find_package( CGAL )
IF( CGAL_FOUND )
message( STATUS "Found system CGAL installation!" )
set( INCLUDE_DIRS ${INCLUDE_DIRS} ${CGAL_INCLUDE_DIRS} )
set( LIBS ${LIBS} ${CGAL_LIBRARIES} )
include( ${CGAL_USE_FILE} )
add_definitions( -DCSG_USE_CGAL )
ENDIF( CGAL_FOUND )
ENDIF( NOT CSG_NO_CGAL )
IF( NOT CARVE_FOUND AND NOT CGAL_FOUND )
message( STATUS "No system Carve or CGAL installation found, falling back to Carve in third_party/" )
SET( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_SOURCE_DIR}/third_party )
find_package( CARVE )
IF( CARVE_FOUND )
message( STATUS "Found third_party/ Carve installation!" )
set( INCLUDE_DIRS ${INCLUDE_DIRS} ${CARVE_INCLUDE_DIRS} )
set( LIBS ${LIBS} ${CARVE_LIBRARIES} )
add_definitions( -DCSG_USE_CARVE )
ELSE(CARVE_FOUND)
message( ERROR "One of CGAL or Carve must be installed to build pyPolyCSG!" )
ENDIF(CARVE_FOUND)
ENDIF( NOT CARVE_FOUND AND NOT CGAL_FOUND )
find_package( PythonLibs REQUIRED )
IF( PYTHONLIBS_FOUND )
set( INCLUDE_DIRS ${INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} )
set( LIBS ${LIBS} ${PYTHON_LIBRARIES} )
ENDIF( PYTHONLIBS_FOUND )
find_package( Boost COMPONENTS python thread REQUIRED )
IF( Boost_FOUND )
SET( INCLUDE_DIRS ${INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} )
SET( LIBS ${LIBS} ${Boost_LIBRARIES} )
ENDIF( Boost_FOUND )
IF( PYTHONLIBS_FOUND AND Boost_FOUND )
set( BOOLEAN_SOURCES ${BOOLEAN_SOURCES} source/python_wrapper.cpp )
ENDIF( PYTHONLIBS_FOUND AND Boost_FOUND )
include_directories( include ${INCLUDE_DIRS} )
add_library( pyPolyCSG SHARED ${BOOLEAN_SOURCES} ${BOOLEAN_HEADERS} )
target_link_libraries( pyPolyCSG ${LIBS} )
IF( APPLE )
# OS-X specific library naming
#set_target_properties( pyPolyCSG PROPERTIES PREFIX "" )
#set_target_properties( pyPolyCSG PROPERTIES SUFFIX .so )
ELSEIF( UNIX )
# Unix specific library naming
ELSEIF( WIN32 )
# Windows specific library naming
ENDIF( APPLE )
set_target_properties( pyPolyCSG PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ..
LIBRARY_OUTPUT_DIRECTORY_DEBUG ..
LIBRARY_OUTPUT_DIRECTORY_RELEASE ..
)
#add_executable( pyPolyCSG_test source/boolean_test.cpp )
#target_link_libraries( pyPolyCSG_test pyPolyCSG )