forked from Heeks/libactp-old
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
179 lines (144 loc) · 4.4 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_FLAGS "-stdlib=libc++")
project(freesteel-python)
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
#include(${V2C_HOOK_PROJECT} OPTIONAL)
set(SOURCES_files_bolts
src/bolts/bolts.h
src/bolts/debugfuncs.h
src/bolts/I1.h
src/bolts/P2.h
src/bolts/P3.h
src/bolts/S1.cpp
src/bolts/S1.h
src/bolts/Partition1.cpp
src/bolts/Partition1.h
src/bolts/smallfuncs.h
src/bolts/vo.h
)
source_group("bolts" FILES ${SOURCES_files_bolts})
set(SOURCES_bolts
${SOURCES_files_bolts}
)
set(SOURCES_files_cages
src/cages/Area2_gen.h
src/cages/cages.h
src/cages/PathX.cpp
src/cages/PathX.h
src/cages/PathXboxed.cpp
src/cages/pathxseries.h
src/cages/S1stockcircle.cpp
src/cages/S2weave.cpp
src/cages/S2weave.h
src/cages/SurfX.cpp
src/cages/SurfX.h
src/cages/SurfXboxed.cpp
src/cages/SurfXboxed.h
)
source_group("cages" FILES ${SOURCES_files_cages})
set(SOURCES_cages
${SOURCES_files_cages}
)
set(SOURCES_files_pits
src/pits/CircCrossingStructure.h
src/pits/CoreRoughGeneration.cpp
src/pits/CoreRoughGeneration.h
src/pits/NormRay_gen.cpp
src/pits/pits.h
src/pits/S2weaveCell.cpp
src/pits/S2weaveCell.h
src/pits/S2weaveCellLinearCut.cpp
src/pits/S2weaveCellLinearCut.h
src/pits/S2weaveCellLinearCutTraverse.cpp
src/pits/S2weaveCircle.cpp
src/pits/SLi_gen.cpp
src/pits/SLi_gen.h
src/pits/SurfXbuildcomponents.cpp
src/pits/SurfXSliceRay.cpp
# requires VTK
#src/pits/toolshape.cpp
#src/pits/toolshape.h
)
source_group("pits" FILES ${SOURCES_files_pits})
set(SOURCES_pits
${SOURCES_files_pits}
)
set(SOURCES_files_visuals
src/visuals/fsvtkToolpathMapper.cpp
src/visuals/fsvtkToolpathMapper.h
src/visuals/GeometryStuffTogether.cpp
src/visuals/gst.h
src/visuals/gstsurface.cpp
src/visuals/gstsurface.h
src/visuals/MakeToolpath.cpp
src/visuals/MakeToolpath.h
)
source_group("visuals" FILES ${SOURCES_files_visuals})
set(SOURCES_visuals
${SOURCES_files_visuals}
)
set(SOURCES_files_xenon
src/xenon/AnimationFrame.cpp
src/xenon/AnimationFrame.h
src/xenon/BoundingBoxDlg.cpp
src/xenon/BoundingBoxDlg.h
src/xenon/coreroughdlg.cpp
src/xenon/coreroughdlg.h
src/xenon/wxhelpers.cpp
src/xenon/wxhelpers.h
src/xenon/wxVTKRenderWindowInteractor.cxx
src/xenon/wxVTKRenderWindowInteractor.h
)
source_group("xenon" FILES ${SOURCES_files_xenon})
set(SOURCES_xenon
${SOURCES_files_xenon}
)
set(freesteel_src
${SOURCES_bolts}
${SOURCES_cages}
${SOURCES_pits}
# GUI crap
#${SOURCES_visuals}
# more GUI crap
#${SOURCES_xenon}
${SOURCES_files_}
)
set(SOURCES_python
PythonLib/PythonStuff.cpp
)
#source_group("xenon" FILES ${SOURCES_files_xenon})
# Build libactp
#add_library(
# freesteel
# STATIC
# SHARED
# ${freesteel_src}
#)
#target_include_directories(freesteel PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/src
# )
# Build python wrapper
find_package(PythonLibs)
find_package(PythonInterp)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from __future__ import print_function; from distutils.sysconfig import get_python_lib; import os;print(get_python_lib())" OUTPUT_VARIABLE python_lib OUTPUT_STRIP_TRAILING_WHITESPACE )
set(ACTP_INSTALL_DIRECTORY ${python_lib} CACHE PATH "ACTP install directory" )
set(BUILD_DIR ${CMAKE_BINARY_DIR}/${LIBRARY_OUTPUT_PATH})
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
add_library(
actp
SHARED
${SOURCES_python}
${freesteel_src}
)
# libactp -> actp
set_target_properties(actp PROPERTIES PREFIX "")
# actp.dylib -> actp.so
set_target_properties(actp PROPERTIES SUFFIX ".so")
target_include_directories(actp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${freesteel_src}
)
target_link_libraries(actp ${PYTHON_LIBRARIES})
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
install(FILES ${BUILD_DIR}/actp.so DESTINATION ${ACTP_INSTALL_DIRECTORY} )