/
CMakeLists.txt
477 lines (447 loc) · 12.2 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
if(MSVC)
add_definitions(-DFCAppPart -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH)
else(MSVC)
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
endif(MSVC)
if(FREETYPE_FOUND)
add_definitions(-DFCUseFreeType)
endif(FREETYPE_FOUND)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/src
${CMAKE_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${Boost_INCLUDE_DIRS}
${OCC_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
${XercesC_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}
${FREETYPE_INCLUDE_DIRS}
)
link_directories(${OCC_LIBRARY_DIR})
set(Part_LIBS
${OCC_LIBRARIES}
${OCC_DEBUG_LIBRARIES}
FreeCADApp
)
if(FREETYPE_FOUND)
set(Part_LIBS
${Part_LIBS}
${FREETYPE_LIBRARIES}
)
endif(FREETYPE_FOUND)
generate_from_xml(ArcPy)
generate_from_xml(ArcOfConicPy)
generate_from_xml(ArcOfCirclePy)
generate_from_xml(ArcOfParabolaPy)
generate_from_xml(BodyBasePy)
generate_from_xml(ConicPy)
generate_from_xml(CirclePy)
generate_from_xml(ArcOfEllipsePy)
generate_from_xml(EllipsePy)
generate_from_xml(HyperbolaPy)
generate_from_xml(ArcOfHyperbolaPy)
generate_from_xml(ParabolaPy)
generate_from_xml(OffsetCurvePy)
generate_from_xml(GeometryPy)
generate_from_xml(GeometryExtensionPy)
generate_from_xml(GeometryIntExtensionPy)
generate_from_xml(GeometryStringExtensionPy)
generate_from_xml(GeometryBoolExtensionPy)
generate_from_xml(GeometryDoubleExtensionPy)
generate_from_xml(GeometryCurvePy)
generate_from_xml(BoundedCurvePy)
generate_from_xml(TrimmedCurvePy)
generate_from_xml(GeometrySurfacePy)
generate_from_xml(LinePy)
generate_from_xml(LineSegmentPy)
generate_from_xml(PointPy)
generate_from_xml(BezierCurvePy)
generate_from_xml(BSplineCurvePy)
generate_from_xml(PlanePy)
generate_from_xml(ConePy)
generate_from_xml(CylinderPy)
generate_from_xml(SpherePy)
generate_from_xml(ToroidPy)
generate_from_xml(BezierSurfacePy)
generate_from_xml(BSplineSurfacePy)
generate_from_xml(OffsetSurfacePy)
generate_from_xml(PlateSurfacePy)
generate_from_xml(RectangularTrimmedSurfacePy)
generate_from_xml(SurfaceOfExtrusionPy)
generate_from_xml(SurfaceOfRevolutionPy)
generate_from_xml(PartFeaturePy)
generate_from_xml(AttachExtensionPy)
generate_from_xml(Part2DObjectPy)
generate_from_xml(AttachEnginePy)
generate_from_xml(TopoShapePy)
generate_from_xml(TopoShapeCompoundPy)
generate_from_xml(TopoShapeCompSolidPy)
generate_from_xml(TopoShapeEdgePy)
generate_from_xml(TopoShapeFacePy)
generate_from_xml(TopoShapeShellPy)
generate_from_xml(TopoShapeSolidPy)
generate_from_xml(TopoShapeVertexPy)
generate_from_xml(TopoShapeWirePy)
generate_from_xml(BRepOffsetAPI_MakePipeShellPy)
generate_from_xml(BRepOffsetAPI_MakeFillingPy)
# make sure to create the directory at configure time
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/BRepFeat)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Geom2d)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GeomPlate)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/HLRBRep)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ShapeUpgrade)
generate_from_xml(BRepFeat/MakePrismPy)
generate_from_xml(Geom2d/ArcOfCircle2dPy)
generate_from_xml(Geom2d/ArcOfConic2dPy)
generate_from_xml(Geom2d/ArcOfEllipse2dPy)
generate_from_xml(Geom2d/ArcOfHyperbola2dPy)
generate_from_xml(Geom2d/ArcOfParabola2dPy)
generate_from_xml(Geom2d/BezierCurve2dPy)
generate_from_xml(Geom2d/BSplineCurve2dPy)
generate_from_xml(Geom2d/Circle2dPy)
generate_from_xml(Geom2d/Conic2dPy)
generate_from_xml(Geom2d/Ellipse2dPy)
generate_from_xml(Geom2d/Geometry2dPy)
generate_from_xml(Geom2d/Hyperbola2dPy)
generate_from_xml(Geom2d/Curve2dPy)
generate_from_xml(Geom2d/Line2dSegmentPy)
generate_from_xml(Geom2d/Line2dPy)
generate_from_xml(Geom2d/OffsetCurve2dPy)
generate_from_xml(Geom2d/Parabola2dPy)
generate_from_xml(GeomPlate/BuildPlateSurfacePy)
generate_from_xml(GeomPlate/CurveConstraintPy)
generate_from_xml(GeomPlate/PointConstraintPy)
generate_from_xml(HLRBRep/HLRBRep_AlgoPy)
generate_from_xml(HLRBRep/HLRToShapePy)
generate_from_xml(ShapeUpgrade/UnifySameDomainPy)
SET(Features_SRCS
FeaturePartBoolean.cpp
FeaturePartBoolean.h
FeaturePartBox.cpp
FeaturePartBox.h
FeaturePartCircle.cpp
FeaturePartCircle.h
FeaturePartCommon.cpp
FeaturePartCommon.h
FeaturePartCurveNet.cpp
FeaturePartCurveNet.h
FeaturePartCut.cpp
FeaturePartCut.h
FeaturePartFuse.cpp
FeaturePartFuse.h
FeaturePartImportBrep.cpp
FeaturePartImportBrep.h
FeaturePartImportIges.cpp
FeaturePartImportIges.h
FeaturePartImportStep.cpp
FeaturePartImportStep.h
FeaturePartPolygon.cpp
FeaturePartPolygon.h
FeaturePartSection.cpp
FeaturePartSection.h
FeaturePartSpline.cpp
FeaturePartSpline.h
FeatureChamfer.cpp
FeatureChamfer.h
FeatureCompound.cpp
FeatureCompound.h
FeatureExtrusion.cpp
FeatureExtrusion.h
FeatureFace.cpp
FeatureFace.h
FeatureFillet.cpp
FeatureFillet.h
FeatureMirroring.cpp
FeatureMirroring.h
FeatureRevolution.cpp
FeatureRevolution.h
FeatureOffset.cpp
FeatureOffset.h
PartFeatures.cpp
PartFeatures.h
PartFeature.cpp
PartFeature.h
PartFeatureReference.cpp
PartFeatureReference.h
Part2DObject.cpp
Part2DObject.h
PrimitiveFeature.cpp
PrimitiveFeature.h
FeatureGeometrySet.h
FeatureGeometrySet.cpp
CustomFeature.cpp
CustomFeature.h
BodyBase.h
BodyBase.cpp
DatumFeature.cpp
DatumFeature.h
AttachExtension.h
AttachExtension.cpp
PrismExtension.cpp
PrismExtension.h
)
SOURCE_GROUP("Features" FILES ${Features_SRCS})
SET(Properties_SRCS
PropertyTopoShape.cpp
PropertyTopoShape.h
PropertyGeometryList.cpp
PropertyGeometryList.h
)
SOURCE_GROUP("Properties" FILES ${Properties_SRCS})
SET(Python_SRCS
ArcPy.xml
ArcPyImp.cpp
ArcOfConicPy.xml
ArcOfConicPyImp.cpp
ArcOfCirclePy.xml
ArcOfCirclePyImp.cpp
ArcOfParabolaPy.xml
ArcOfParabolaPyImp.cpp
BodyBasePy.xml
BodyBasePyImp.cpp
ConicPy.xml
ConicPyImp.cpp
CirclePy.xml
CirclePyImp.cpp
ArcOfEllipsePy.xml
ArcOfEllipsePyImp.cpp
EllipsePy.xml
EllipsePyImp.cpp
HyperbolaPy.xml
HyperbolaPyImp.cpp
ArcOfHyperbolaPy.xml
ArcOfHyperbolaPyImp.cpp
ParabolaPy.xml
ParabolaPyImp.cpp
OffsetCurvePy.xml
OffsetCurvePyImp.cpp
GeometryPy.xml
GeometryPyImp.cpp
GeometryExtensionPy.xml
GeometryExtensionPyImp.cpp
GeometryIntExtensionPy.xml
GeometryIntExtensionPyImp.cpp
GeometryStringExtensionPy.xml
GeometryStringExtensionPyImp.cpp
GeometryBoolExtensionPy.xml
GeometryBoolExtensionPyImp.cpp
GeometryDoubleExtensionPy.xml
GeometryDoubleExtensionPyImp.cpp
GeometryCurvePy.xml
GeometryCurvePyImp.cpp
BoundedCurvePy.xml
BoundedCurvePyImp.cpp
TrimmedCurvePy.xml
TrimmedCurvePyImp.cpp
GeometrySurfacePy.xml
GeometrySurfacePyImp.cpp
LinePy.xml
LinePyImp.cpp
LineSegmentPy.xml
LineSegmentPyImp.cpp
PointPy.xml
PointPyImp.cpp
BezierCurvePy.xml
BezierCurvePyImp.cpp
BSplineCurvePy.xml
BSplineCurvePyImp.cpp
PlanePy.xml
PlanePyImp.cpp
ConePy.xml
ConePyImp.cpp
CylinderPy.xml
CylinderPyImp.cpp
SpherePy.xml
SpherePyImp.cpp
ToroidPy.xml
ToroidPyImp.cpp
BezierSurfacePy.xml
BezierSurfacePyImp.cpp
BSplineSurfacePy.xml
BSplineSurfacePyImp.cpp
OffsetSurfacePy.xml
OffsetSurfacePyImp.cpp
PlateSurfacePy.xml
PlateSurfacePyImp.cpp
RectangularTrimmedSurfacePy.xml
RectangularTrimmedSurfacePyImp.cpp
SurfaceOfExtrusionPy.xml
SurfaceOfExtrusionPyImp.cpp
SurfaceOfRevolutionPy.xml
SurfaceOfRevolutionPyImp.cpp
PartFeaturePy.xml
PartFeaturePyImp.cpp
AttachExtensionPy.xml
AttachExtensionPyImp.cpp
Part2DObjectPy.xml
Part2DObjectPyImp.cpp
AttachEnginePy.xml
AttachEnginePyImp.cpp
TopoShapePy.xml
TopoShapePyImp.cpp
TopoShapeCompSolidPy.xml
TopoShapeCompSolidPyImp.cpp
TopoShapeCompoundPy.xml
TopoShapeCompoundPyImp.cpp
TopoShapeEdgePy.xml
TopoShapeEdgePyImp.cpp
TopoShapeFacePy.xml
TopoShapeFacePyImp.cpp
TopoShapeShellPy.xml
TopoShapeShellPyImp.cpp
TopoShapeSolidPy.xml
TopoShapeSolidPyImp.cpp
TopoShapeVertexPy.xml
TopoShapeVertexPyImp.cpp
TopoShapeWirePy.xml
TopoShapeWirePyImp.cpp
BRepOffsetAPI_MakePipeShellPy.xml
BRepOffsetAPI_MakePipeShellPyImp.cpp
BRepOffsetAPI_MakeFillingPy.xml
BRepOffsetAPI_MakeFillingPyImp.cpp
PartPyCXX.cpp
PartPyCXX.h
)
SOURCE_GROUP("Python" FILES ${Python_SRCS})
# BRepFeat wrappers
SET(BRepFeatPy_SRCS
BRepFeat/MakePrismPy.xml
BRepFeat/MakePrismPyImp.cpp
)
SOURCE_GROUP("BRepFeat" FILES ${BRepFeatPy_SRCS})
# Geom2d wrappers
SET(Geom2dPy_SRCS
Geom2d/ArcOfCircle2dPy.xml
Geom2d/ArcOfCircle2dPyImp.cpp
Geom2d/ArcOfConic2dPy.xml
Geom2d/ArcOfConic2dPyImp.cpp
Geom2d/ArcOfEllipse2dPy.xml
Geom2d/ArcOfEllipse2dPyImp.cpp
Geom2d/ArcOfHyperbola2dPy.xml
Geom2d/ArcOfHyperbola2dPyImp.cpp
Geom2d/ArcOfParabola2dPy.xml
Geom2d/ArcOfParabola2dPyImp.cpp
Geom2d/BezierCurve2dPy.xml
Geom2d/BezierCurve2dPyImp.cpp
Geom2d/BSplineCurve2dPy.xml
Geom2d/BSplineCurve2dPyImp.cpp
Geom2d/Circle2dPy.xml
Geom2d/Circle2dPyImp.cpp
Geom2d/Conic2dPy.xml
Geom2d/Conic2dPyImp.cpp
Geom2d/Ellipse2dPy.xml
Geom2d/Ellipse2dPyImp.cpp
Geom2d/Geometry2dPy.xml
Geom2d/Geometry2dPyImp.cpp
Geom2d/Curve2dPy.xml
Geom2d/Curve2dPyImp.cpp
Geom2d/Hyperbola2dPy.xml
Geom2d/Hyperbola2dPyImp.cpp
Geom2d/Line2dPy.xml
Geom2d/Line2dPyImp.cpp
Geom2d/Line2dSegmentPy.xml
Geom2d/Line2dSegmentPyImp.cpp
Geom2d/OffsetCurve2dPy.xml
Geom2d/OffsetCurve2dPyImp.cpp
Geom2d/Parabola2dPy.xml
Geom2d/Parabola2dPyImp.cpp
)
SOURCE_GROUP("Geom2d" FILES ${Geom2dPy_SRCS})
# GeomPlate wrappers
SET(GeomPlatePy_SRCS
GeomPlate/BuildPlateSurfacePy.xml
GeomPlate/BuildPlateSurfacePyImp.cpp
GeomPlate/CurveConstraintPy.xml
GeomPlate/CurveConstraintPyImp.cpp
GeomPlate/PointConstraintPy.xml
GeomPlate/PointConstraintPyImp.cpp
)
SOURCE_GROUP("GeomPlate" FILES ${GeomPlatePy_SRCS})
# HLRBRep wrappers
SET(HLRBRepPy_SRCS
HLRBRep/HLRBRep_AlgoPy.xml
HLRBRep/HLRBRep_AlgoPyImp.cpp
HLRBRep/HLRToShapePy.xml
HLRBRep/HLRToShapePyImp.cpp
)
SOURCE_GROUP("HLRBRep" FILES ${HLRBRepPy_SRCS})
# ShapeUpgrade wrappers
SET(ShapeUpgradePy_SRCS
ShapeUpgrade/UnifySameDomainPy.xml
ShapeUpgrade/UnifySameDomainPyImp.cpp
)
SOURCE_GROUP("ShapeUpgrade" FILES ${ShapeUpgradePy_SRCS})
SET(Part_SRCS
${Features_SRCS}
${Properties_SRCS}
${Python_SRCS}
${BRepFeatPy_SRCS}
${Geom2dPy_SRCS}
${GeomPlatePy_SRCS}
${HLRBRepPy_SRCS}
${ShapeUpgradePy_SRCS}
Attacher.cpp
Attacher.h
AppPart.cpp
AppPartPy.cpp
BRepOffsetAPI_MakeOffsetFix.cpp
BRepOffsetAPI_MakeOffsetFix.h
BSplineCurveBiArcs.cpp
CrossSection.cpp
CrossSection.h
GeometryExtension.cpp
GeometryExtension.h
GeometryDefaultExtension.cpp
GeometryDefaultExtension.h
GeometryMigrationExtension.h
GeometryMigrationExtension.cpp
Geometry.cpp
Geometry.h
Geometry2d.cpp
Geometry2d.h
ImportIges.cpp
ImportIges.h
ImportStep.cpp
ImportStep.h
PreCompiled.cpp
PreCompiled.h
ProgressIndicator.cpp
ProgressIndicator.h
TopoShape.cpp
TopoShape.h
edgecluster.cpp
edgecluster.h
modelRefine.cpp
modelRefine.h
Tools.cpp
Tools.h
encodeFilename.h
OCCError.h
FT2FC.cpp
FT2FC.h
FaceMaker.cpp
FaceMaker.h
FaceMakerCheese.cpp
FaceMakerCheese.h
FaceMakerBullseye.cpp
FaceMakerBullseye.h
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${Part_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(Part PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
# Suppress some very long Eigen3 warnings of older versions
if (EIGEN3_NO_DEPRECATED_COPY)
set_source_files_properties(
GeometryCurvePyImp.cpp
GeometrySurfacePyImp.cpp
PROPERTIES COMPILE_FLAGS ${EIGEN3_NO_DEPRECATED_COPY})
endif ()
add_library(Part SHARED ${Part_SRCS})
target_link_libraries(Part ${Part_LIBS})
SET_BIN_DIR(Part Part /Mod/Part)
SET_PYTHON_PREFIX_SUFFIX(Part)
INSTALL(TARGETS Part DESTINATION ${CMAKE_INSTALL_LIBDIR})