cmake_minimum_required (VERSION 3.6) set_property (GLOBAL PROPERTY USE_FOLDERS ON) set (CMAKE_SUPPRESS_REGENERATION 1) set (CMAKE_CONFIGURATION_TYPES Debug;Release;RelWithDebInfo;MinSizeRel) add_definitions (-DUNICODE -D_UNICODE) project (OcctImportJS) # 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 (Bnd) AddOcctModule (BndLib) AddOcctModule (BRep) AddOcctModule (BRepAdaptor) AddOcctModule (BRepApprox) AddOcctModule (BRepBndLib) AddOcctModule (BRepBuilderAPI) AddOcctModule (BRepCheck) AddOcctModule (BRepClass) AddOcctModule (BRepClass3d) AddOcctModule (BRepExtrema) AddOcctModule (BRepGProp) AddOcctModule (BRepLib) AddOcctModule (BRepMesh) AddOcctModule (BRepMeshData) AddOcctModule (BRepTools) AddOcctModule (BRepTopAdaptor) AddOcctModule (BSplCLib) AddOcctModule (BSplSLib) AddOcctModule (BSplSLib) AddOcctModule (BVH) AddOcctModule (CDF) AddOcctModule (CDM) AddOcctModule (Contap) AddOcctModule (Convert) AddOcctModule (CPnts) AddOcctModule (CSLib) AddOcctModule (DsgPrs) AddOcctModule (ElCLib) AddOcctModule (ElSLib) AddOcctModule (Extrema) AddOcctModule (FEmTool) AddOcctModule (Font) AddOcctModule (FSD) AddOcctModule (GC) AddOcctModule (GccEnt) AddOcctModule (gce) AddOcctModule (GCE2d) AddOcctModule (GCPnts) AddOcctModule (Geom) AddOcctModule (Geom2d) AddOcctModule (Geom2dAdaptor) AddOcctModule (Geom2dAPI) AddOcctModule (Geom2dConvert) AddOcctModule (Geom2dEvaluator) AddOcctModule (Geom2dHatch) AddOcctModule (Geom2dInt) AddOcctModule (Geom2dLProp) AddOcctModule (GeomAbs) AddOcctModule (GeomAdaptor) AddOcctModule (GeomAPI) AddOcctModule (GeomConvert) AddOcctModule (GeomEvaluator) AddOcctModule (GeomFill) AddOcctModule (GeomInt) AddOcctModule (GeomLib) AddOcctModule (GeomLProp) AddOcctModule (GeomProjLib) 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 (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 (LProp) AddOcctModule (LProp3d) AddOcctModule (math) AddOcctModule (Media) AddOcctModule (Message) AddOcctModule (MoniTool) AddOcctModule (NCollection) AddOcctModule (OSD) AddOcctModule (PCDM) 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 (StepToGeom) AddOcctModule (StepToTopoDS) AddOcctModule (StepVisual) AddOcctModule (Storage) AddOcctModule (TColGeom) AddOcctModule (TColGeom2d) AddOcctModule (TColgp) AddOcctModule (TCollection) AddOcctModule (TColStd) AddOcctModule (TDataStd) AddOcctModule (TDataXtd) AddOcctModule (TDF) AddOcctModule (TDocStd) AddOcctModule (TNaming) AddOcctModule (TopAbs) AddOcctModule (TopBas) AddOcctModule (TopClass) AddOcctModule (TopCnx) AddOcctModule (TopExp) AddOcctModule (TopLoc) AddOcctModule (TopoDS) AddOcctModule (TopoDSToStep) 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 ${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 "$<$:-gsource-map>") target_compile_options (OcctImportJS PUBLIC -fexceptions) target_link_options (OcctImportJS PUBLIC -sMODULARIZE=1) target_link_options (OcctImportJS PUBLIC -sEXPORT_NAME='occtimportjs') target_link_options (OcctImportJS PUBLIC -sALLOW_MEMORY_GROWTH=1 --no-heap-copy) target_link_options (OcctImportJS PUBLIC -sNO_DISABLE_EXCEPTION_CATCHING) # 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_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 ${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 ()