occt-import-js
Version:
Javascript interface for the occt library.
352 lines (335 loc) • 10.3 kB
Plain Text
cmake_minimum_required (VERSION 3.6)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
set (CMAKE_CONFIGURATION_TYPES Debug;Release;RelWithDebInfo;MinSizeRel)
add_definitions (-DUNICODE -D_UNICODE)
project (OcctImportJS)
set (CMAKE_CXX_STANDARD 11)
# OcctImportJS
set (OcctSourceFolders)
set (OcctIncludeDirs)
function (AddOcctModule module)
list (APPEND OcctSourceFolders occt/src/${module}/*.c*)
list (APPEND OcctIncludeDirs occt/src/${module})
set (OcctSourceFolders ${OcctSourceFolders} PARENT_SCOPE)
set (OcctIncludeDirs ${OcctIncludeDirs} PARENT_SCOPE)
endfunction ()
AddOcctModule (Adaptor2d)
AddOcctModule (Adaptor3d)
AddOcctModule (AdvApp2Var)
AddOcctModule (AdvApprox)
AddOcctModule (AIS)
AddOcctModule (APIHeaderSection)
AddOcctModule (AppBlend)
AddOcctModule (AppCont)
AddOcctModule (AppDef)
AddOcctModule (AppParCurves)
AddOcctModule (Approx)
AddOcctModule (ApproxInt)
AddOcctModule (Aspect)
AddOcctModule (BinDrivers)
AddOcctModule (BinLDrivers)
AddOcctModule (BinMDataStd)
AddOcctModule (BinMDataXtd)
AddOcctModule (BinMDF)
AddOcctModule (BinMDocStd)
AddOcctModule (BinMDocXtd)
AddOcctModule (BinMNaming)
AddOcctModule (BinMFunction)
AddOcctModule (BinMXCAFDoc)
AddOcctModule (BinObjMgt)
AddOcctModule (BinTools)
AddOcctModule (BinXCAFDrivers)
AddOcctModule (Bisector)
AddOcctModule (Bnd)
AddOcctModule (BndLib)
AddOcctModule (BOPAlgo)
AddOcctModule (BOPDS)
AddOcctModule (BOPTools)
AddOcctModule (BRep)
AddOcctModule (BRepAdaptor)
AddOcctModule (BRepAlgo)
AddOcctModule (BRepAlgoAPI)
AddOcctModule (BRepApprox)
AddOcctModule (BRepBndLib)
AddOcctModule (BRepBuilderAPI)
AddOcctModule (BRepCheck)
AddOcctModule (BRepClass)
AddOcctModule (BRepClass3d)
AddOcctModule (BRepExtrema)
AddOcctModule (BRepFill)
AddOcctModule (BRepGProp)
AddOcctModule (BRepIntCurveSurface)
AddOcctModule (BRepLib)
AddOcctModule (BRepLProp)
AddOcctModule (BRepMAT2d)
AddOcctModule (BRepMesh)
AddOcctModule (BRepMeshData)
AddOcctModule (BRepPrim)
AddOcctModule (BRepPrimAPI)
AddOcctModule (BRepSweep)
AddOcctModule (BRepToIGES)
AddOcctModule (BRepToIGESBRep)
AddOcctModule (BRepTools)
AddOcctModule (BRepTopAdaptor)
AddOcctModule (BSplCLib)
AddOcctModule (BSplSLib)
AddOcctModule (BVH)
AddOcctModule (CDF)
AddOcctModule (CDM)
AddOcctModule (Contap)
AddOcctModule (Convert)
AddOcctModule (CPnts)
AddOcctModule (CSLib)
AddOcctModule (DE)
AddOcctModule (DsgPrs)
AddOcctModule (ElCLib)
AddOcctModule (ElSLib)
AddOcctModule (Extrema)
AddOcctModule (FEmTool)
AddOcctModule (FlexLexer)
AddOcctModule (Font)
AddOcctModule (FSD)
AddOcctModule (GC)
AddOcctModule (GccAna)
AddOcctModule (GccEnt)
AddOcctModule (GccInt)
AddOcctModule (gce)
AddOcctModule (GCE2d)
AddOcctModule (GCPnts)
AddOcctModule (Geom)
AddOcctModule (Geom2d)
AddOcctModule (Geom2dAdaptor)
AddOcctModule (Geom2dAPI)
AddOcctModule (Geom2dConvert)
AddOcctModule (Geom2dEvaluator)
AddOcctModule (Geom2dGcc)
AddOcctModule (Geom2dHatch)
AddOcctModule (Geom2dInt)
AddOcctModule (Geom2dLProp)
AddOcctModule (Geom2dToIGES)
AddOcctModule (GeomAbs)
AddOcctModule (GeomAdaptor)
AddOcctModule (GeomAPI)
AddOcctModule (GeomConvert)
AddOcctModule (GeomEvaluator)
AddOcctModule (GeomFill)
AddOcctModule (GeomInt)
AddOcctModule (GeomLib)
AddOcctModule (GeomLProp)
AddOcctModule (GeomPlate)
AddOcctModule (GeomProjLib)
AddOcctModule (GeomToIGES)
AddOcctModule (GeomTools)
AddOcctModule (GeomToStep)
AddOcctModule (gp)
AddOcctModule (GProp)
AddOcctModule (Graphic3d)
AddOcctModule (Hatch)
AddOcctModule (HatchGen)
AddOcctModule (HeaderSection)
AddOcctModule (Hermit)
AddOcctModule (HLRAlgo)
AddOcctModule (HLRBRep)
AddOcctModule (HLRTopoBRep)
AddOcctModule (IFGraph)
AddOcctModule (IFSelect)
AddOcctModule (IGESAppli)
AddOcctModule (IGESBasic)
AddOcctModule (IGESCAFControl)
AddOcctModule (IGESControl)
AddOcctModule (IGESConvGeom)
AddOcctModule (IGESData)
AddOcctModule (IGESDefs)
AddOcctModule (IGESDimen)
AddOcctModule (IGESDraw)
AddOcctModule (IGESFile)
AddOcctModule (IGESGeom)
AddOcctModule (IGESGraph)
AddOcctModule (IGESSelect)
AddOcctModule (IGESSolid)
AddOcctModule (IGESToBRep)
AddOcctModule (Image)
AddOcctModule (IMeshData)
AddOcctModule (IMeshTools)
AddOcctModule (IntAna)
AddOcctModule (IntAna2d)
AddOcctModule (IntCurve)
AddOcctModule (IntCurvesFace)
AddOcctModule (IntCurveSurface)
AddOcctModule (Interface)
AddOcctModule (Intf)
AddOcctModule (IntImp)
AddOcctModule (IntImpParGen)
AddOcctModule (IntPatch)
AddOcctModule (IntPolyh)
AddOcctModule (IntRes2d)
AddOcctModule (Intrv)
AddOcctModule (IntStart)
AddOcctModule (IntSurf)
AddOcctModule (IntTools)
AddOcctModule (IntWalk)
AddOcctModule (Law)
AddOcctModule (LDOM)
AddOcctModule (LDOMParser)
AddOcctModule (LibCtl)
AddOcctModule (LocalAnalysis)
AddOcctModule (LProp)
AddOcctModule (LProp3d)
AddOcctModule (MAT)
AddOcctModule (MAT2d)
AddOcctModule (math)
AddOcctModule (Media)
AddOcctModule (Message)
AddOcctModule (MoniTool)
AddOcctModule (NCollection)
AddOcctModule (OSD)
AddOcctModule (PCDM)
AddOcctModule (Plate)
AddOcctModule (PLib)
AddOcctModule (Plugin)
AddOcctModule (Poly)
AddOcctModule (Precision)
AddOcctModule (ProjLib)
AddOcctModule (Prs3d)
AddOcctModule (PrsDim)
AddOcctModule (PrsMgr)
AddOcctModule (Quantity)
AddOcctModule (Resource)
AddOcctModule (RWHeaderSection)
AddOcctModule (RWStepAP203)
AddOcctModule (RWStepAP214)
AddOcctModule (RWStepAP242)
AddOcctModule (RWStepBasic)
AddOcctModule (RWStepDimTol)
AddOcctModule (RWStepElement)
AddOcctModule (RWStepFEA)
AddOcctModule (RWStepGeom)
AddOcctModule (RWStepKinematics)
AddOcctModule (RWStepRepr)
AddOcctModule (RWStepShape)
AddOcctModule (RWStepVisual)
AddOcctModule (Select3D)
AddOcctModule (SelectBasics)
AddOcctModule (SelectMgr)
AddOcctModule (ShapeAlgo)
AddOcctModule (ShapeAnalysis)
AddOcctModule (ShapeBuild)
AddOcctModule (ShapeConstruct)
AddOcctModule (ShapeCustom)
AddOcctModule (ShapeExtend)
AddOcctModule (ShapeFix)
AddOcctModule (ShapeProcess)
AddOcctModule (ShapeUpgrade)
AddOcctModule (Standard)
AddOcctModule (StdFail)
AddOcctModule (StdPrs)
AddOcctModule (StdSelect)
AddOcctModule (StepAP203)
AddOcctModule (StepAP214)
AddOcctModule (StepAP242)
AddOcctModule (StepBasic)
AddOcctModule (STEPCAFControl)
AddOcctModule (STEPConstruct)
AddOcctModule (STEPControl)
AddOcctModule (StepData)
AddOcctModule (StepDimTol)
AddOcctModule (STEPEdit)
AddOcctModule (StepElement)
AddOcctModule (StepFEA)
AddOcctModule (StepFile)
AddOcctModule (StepGeom)
AddOcctModule (StepKinematics)
AddOcctModule (StepRepr)
AddOcctModule (StepSelect)
AddOcctModule (STEPSelections)
AddOcctModule (StepShape)
AddOcctModule (StepToGeom)
AddOcctModule (StepToTopoDS)
AddOcctModule (StepVisual)
AddOcctModule (Storage)
AddOcctModule (Sweep)
AddOcctModule (TColGeom)
AddOcctModule (TColGeom2d)
AddOcctModule (TColgp)
AddOcctModule (TCollection)
AddOcctModule (TColStd)
AddOcctModule (TDataStd)
AddOcctModule (TDataXtd)
AddOcctModule (TDF)
AddOcctModule (TDocStd)
AddOcctModule (TFunction)
AddOcctModule (TNaming)
AddOcctModule (TopAbs)
AddOcctModule (TopBas)
AddOcctModule (TopClass)
AddOcctModule (TopCnx)
AddOcctModule (TopExp)
AddOcctModule (TopLoc)
AddOcctModule (TopoDS)
AddOcctModule (TopoDSToStep)
AddOcctModule (TopOpeBRepBuild)
AddOcctModule (TopOpeBRepDS)
AddOcctModule (TopOpeBRepTool)
AddOcctModule (TopTools)
AddOcctModule (TopTrans)
AddOcctModule (TPrsStd)
AddOcctModule (Transfer)
AddOcctModule (TransferBRep)
AddOcctModule (TShort)
AddOcctModule (Units)
AddOcctModule (UnitsAPI)
AddOcctModule (UnitsMethods)
AddOcctModule (UTL)
AddOcctModule (V3d)
AddOcctModule (WNT)
AddOcctModule (XCAFDimTolObjects)
AddOcctModule (XCAFDoc)
AddOcctModule (XCAFNoteObjects)
AddOcctModule (XCAFPrs)
AddOcctModule (XCAFView)
AddOcctModule (XSAlgo)
AddOcctModule (XSControl)
file (GLOB OcctSourceFiles ${OcctSourceFolders})
set (OcctImportJSSourcesFolder occt-import-js/src)
file (GLOB
OcctImportJSSourceFiles CONFIGURE_DEPENDS
${OcctImportJSSourcesFolder}/*.hpp
${OcctImportJSSourcesFolder}/*.cpp
)
source_group ("Sources" FILES ${OcctImportJSSourceFiles})
source_group ("OCCT" FILES ${OcctSourceFiles})
if (${EMSCRIPTEN})
add_executable (OcctImportJS ${OcctImportJSSourceFiles} ${OcctSourceFiles})
target_compile_options (OcctImportJS PUBLIC "$<$<CONFIG:Debug>:-gsource-map>")
target_compile_options (OcctImportJS PUBLIC "$<$<CONFIG:Release>:-Oz>")
target_compile_options (OcctImportJS PUBLIC -fexceptions)
target_compile_options (OcctImportJS PUBLIC -fwasm-exceptions)
target_link_options (OcctImportJS PUBLIC -sMODULARIZE=1)
target_link_options (OcctImportJS PUBLIC -sEXPORT_NAME='occtimportjs')
target_link_options (OcctImportJS PUBLIC -sSTACK_SIZE=10MB)
target_link_options (OcctImportJS PUBLIC -sALLOW_MEMORY_GROWTH=1 --no-heap-copy)
target_link_options (OcctImportJS PUBLIC -fwasm-exceptions)
# to check for memory errors
# target_link_options (OcctImportJS PUBLIC -sASSERTIONS=1 -sSAFE_HEAP=1 -sWARN_UNALIGNED=1)
target_link_options (OcctImportJS PUBLIC --bind)
else ()
add_library (OcctImportJS ${OcctImportJSSourceFiles} ${OcctSourceFiles})
endif ()
target_compile_options (OcctImportJS PUBLIC -DOCCT_NO_PLUGINS)
target_include_directories (OcctImportJS PUBLIC ${OcctIncludeDirs})
set_target_properties(OcctImportJS PROPERTIES OUTPUT_NAME occt-import-js)
set_target_properties (OcctImportJS PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
# OcctImportJSExample
if (${EMSCRIPTEN})
else ()
set (OcctImportJSExampleSourcesFolder occt-import-js/example)
file (GLOB OcctImportJSExampleSourceFiles CONFIGURE_DEPENDS
${OcctImportJSExampleSourcesFolder}/*.hpp
${OcctImportJSExampleSourcesFolder}/*.cpp
)
source_group ("Sources" FILES ${OcctImportJSExampleSourceFiles})
add_executable (OcctImportJSExample ${OcctImportJSExampleSourceFiles})
target_include_directories (OcctImportJSExample PUBLIC ${OcctImportJSSourcesFolder})
target_link_libraries (OcctImportJSExample OcctImportJS)
set_target_properties (OcctImportJSExample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
endif ()