Skip to content

Commit

Permalink
Split Graphic3d and OpenGl modules (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
trelau authored Sep 20, 2021
1 parent 383f2f2 commit 66eaf88
Show file tree
Hide file tree
Showing 4 changed files with 367 additions and 8 deletions.
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,19 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_PATH}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_PATH}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_PATH}")

# Treat each .cxx file in src/modules as a module
file(GLOB OCCT_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx)
# Include the file specifying available OCCT modules
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/OCCT_Modules.cmake)

# OCCT modules
foreach(SRC ${OCCT_SRCS})
# OCCT
foreach(MOD ${OCCT_MODULES})

# Get module name
get_filename_component(MOD ${SRC} NAME_WE)
# Get source files of module
file(GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/${MOD}*.cxx)

if(NOT SRCS)
message(STATUS "Skipping module ${MOD} since no sources were found")
continue()
endif()

# Check for platform-specific modules
if((WIN32 OR APPLE) AND ${MOD} STREQUAL "Xw")
Expand All @@ -177,7 +182,7 @@ foreach(SRC ${OCCT_SRCS})
endif()

# Add pybind11 module
pybind11_add_module(${MOD} ${SRC})
pybind11_add_module(${MOD} ${SRCS})
target_link_libraries(${MOD} PUBLIC ${OpenCASCADE_LIBRARIES}
${Python_LIBRARIES})

Expand Down
4 changes: 4 additions & 0 deletions binder/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1014,3 +1014,7 @@

# Inject trampoline
+patch AIS: py::class_<AIS_InteractiveObject, opencascade-->py::class_<AIS_InteractiveObject, AIS_PyInteractiveObject, opencascade

# Split modules
+split Graphic3d
+split OpenGl
350 changes: 350 additions & 0 deletions cmake/OCCT_Modules.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,350 @@
# List of available OCCT modules. This may need updated if the upstream modules change.
LIST(APPEND OCCT_MODULES
Adaptor2d
Adaptor3d
AdvApp2Var
AdvApprox
AIS
APIHeaderSection
AppBlend
AppCont
AppDef
AppParCurves
Approx
ApproxInt
AppStd
AppStdL
Aspect
BinDrivers
BinLDrivers
BinMDataStd
BinMDataXtd
BinMDF
BinMDocStd
BinMFunction
BinMNaming
BinMXCAFDoc
BinObjMgt
BinTObjDrivers
BinTools
BinXCAFDrivers
Bisector
BiTgte
Blend
BlendFunc
Bnd
BndLib
BOPAlgo
BOPDS
BOPTools
BRep
BRepAdaptor
BRepAlgo
BRepAlgoAPI
BRepApprox
BRepBlend
BRepBndLib
BRepBuilderAPI
BRepCheck
BRepClass
BRepClass3d
BRepExtrema
BRepFeat
BRepFill
BRepFilletAPI
BRepGProp
BRepIntCurveSurface
BRepLib
BRepLProp
BRepMAT2d
BRepMesh
BRepMeshData
BRepOffset
BRepOffsetAPI
BRepPreviewAPI
BRepPrim
BRepPrimAPI
BRepProj
BRepSweep
BRepToIGES
BRepToIGESBRep
BRepTools
BRepTopAdaptor
BSplCLib
BSplSLib
BVH
CDF
CDM
ChFi2d
ChFi3d
ChFiDS
ChFiKPart
Cocoa
Contap
Convert
CPnts
CSLib
Draft
DsgPrs
ElCLib
ElSLib
Expr
ExprIntrp
Extrema
FairCurve
FEmTool
FilletSurf
FlexLexer
Font
FSD
GC
GccAna
GccEnt
GccInt
gce
GCE2d
GCPnts
Geom
Geom2d
Geom2dAdaptor
Geom2dAPI
Geom2dConvert
Geom2dEvaluator
Geom2dGcc
Geom2dHatch
Geom2dInt
Geom2dLProp
Geom2dToIGES
GeomAbs
GeomAdaptor
GeomAPI
GeomConvert
GeomEvaluator
GeomFill
GeomInt
GeomLib
GeomLProp
GeomPlate
GeomProjLib
GeomToIGES
GeomTools
GeomToStep
glext
gp
GProp
Graphic3d
Hatch
HatchGen
HeaderSection
Hermit
HLRAlgo
HLRAppli
HLRBRep
HLRTopoBRep
IFGraph
IFSelect
IGESAppli
IGESBasic
IGESCAFControl
IGESControl
IGESConvGeom
IGESData
IGESDefs
IGESDimen
IGESDraw
IGESFile
IGESGeom
IGESGraph
igesread
IGESSelect
IGESSolid
IGESToBRep
Image
IMeshData
IMeshTools
IntAna
IntAna2d
IntCurve
IntCurvesFace
IntCurveSurface
Interface
InterfaceGraphic
Intf
IntImp
IntImpParGen
IntPatch
IntPolyh
IntRes2d
Intrv
IntStart
IntSurf
IntTools
IntWalk
IVtk
IVtkOCC
IVtkTools
IVtkVTK
Law
LDOM
LDOMBasicString
LDOMParser
LDOMString
LibCtl
LocalAnalysis
LocOpe
LProp
LProp3d
MAT
MAT2d
math
Media
MeshVS
Message
MMgt
MoniTool
NCollection
NLPlate
OpenGl
OSD
PCDM
Plate
PLib
Plugin
Poly
Precision
ProjLib
Prs3d
PrsDim
PrsMgr
Quantity
Resource
RWGltf
RWHeaderSection
RWMesh
RWObj
RWStepAP203
RWStepAP214
RWStepAP242
RWStepBasic
RWStepDimTol
RWStepElement
RWStepFEA
RWStepGeom
RWStepRepr
RWStepShape
RWStepVisual
RWStl
Select3D
SelectBasics
SelectMgr
ShapeAlgo
ShapeAnalysis
ShapeBuild
ShapeConstruct
ShapeCustom
ShapeExtend
ShapeFix
ShapePersistent
ShapeProcess
ShapeProcessAPI
ShapeUpgrade
Standard
StdDrivers
StdFail
StdLDrivers
StdLPersistent
StdObject
StdObjMgt
StdPersistent
StdPrs
StdSelect
StdStorage
step
StepAP203
StepAP209
StepAP214
StepAP242
StepBasic
STEPCAFControl
STEPConstruct
STEPControl
StepData
StepDimTol
STEPEdit
StepElement
StepFEA
StepFile
StepGeom
StepRepr
StepSelect
STEPSelections
StepShape
StepToGeom
StepToTopoDS
StepVisual
StlAPI
Storage
Sweep
TColGeom
TColGeom2d
TColgp
TCollection
TColStd
TDataStd
TDataXtd
TDF
TDocStd
TFunction
TNaming
TObj
TopAbs
TopBas
TopClass
TopCnx
TopExp
TopLoc
TopoDS
TopoDSToStep
TopOpeBRep
TopOpeBRepBuild
TopOpeBRepDS
TopOpeBRepTool
TopTools
TopTrans
TPrsStd
Transfer
TransferBRep
TShort
Units
UnitsAPI
UnitsMethods
UTL
V3d
Vrml
VrmlAPI
VrmlConverter
VrmlData
WNT
XBRepMesh
XCAFApp
XCAFDimTolObjects
XCAFDoc
XCAFNoteObjects
XCAFPrs
XCAFView
XmlDrivers
XmlLDrivers
XmlMDataStd
XmlMDataXtd
XmlMDF
XmlMDocStd
XmlMFunction
XmlMNaming
XmlMXCAFDoc
XmlObjMgt
XmlTObjDrivers
XmlXCAFDrivers
XSAlgo
XSControl
Xw
)

0 comments on commit 66eaf88

Please sign in to comment.