Make cgal optional

This commit is contained in:
Thomas Krijnen
2023-03-22 11:47:00 +01:00
parent 2b1b79bf1c
commit 031694af2b
10 changed files with 36 additions and 1 deletions
+6
View File
@@ -785,6 +785,8 @@ TARGET_LINK_LIBRARIES(IfcParse ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES} ${LIBXML2_
if (BUILD_IFCGEOM)
if (WITH_CGAL)
find_library(libGMP NAMES gmp mpir PATHS ${GMP_LIBRARY_DIR} NO_DEFAULT_PATH)
find_library(libMPFR NAMES mpfr PATHS ${MPFR_LIBRARY_DIR} NO_DEFAULT_PATH)
if(NOT libGMP)
@@ -797,6 +799,8 @@ endif()
list(APPEND CGAL_LIBRARIES "${libMPFR}")
list(APPEND CGAL_LIBRARIES "${libGMP}")
endif()
foreach(kernel ${GEOMETRY_KERNELS})
string(TOUPPER ${kernel} KERNEL_UPPER)
@@ -957,8 +961,10 @@ IF(NOT MINIMAL_BUILD AND BUILD_IFCMAX)
ADD_SUBDIRECTORY(../src/ifcmax ifcmax)
ENDIF()
if (NOT MINIMAL_BUILD)
if (WITH_CGAL)
ADD_SUBDIRECTORY(../src/svgfill svgfill)
endif()
endif()
# CMake installation targets
INSTALL(FILES ${IFCPARSE_H_FILES}
@@ -1,3 +1,5 @@
#ifdef IFOPSH_WITH_CGAL
#include "validation_utils.h"
using namespace ifcopenshell::geometry;
@@ -183,3 +185,5 @@ void fix_spaceboundaries(IfcParse::IfcFile& f, bool no_progress, bool quiet, boo
}
}
}
#endif
@@ -1,3 +1,5 @@
#ifdef IFOPSH_WITH_CGAL
#include "../ifcgeom/kernels/cgal/CgalKernel.h"
#include "../ifcgeom/IfcGeomFilter.h"
#include "../ifcgeom/Iterator.h"
@@ -231,3 +233,5 @@ void fix_storeycontainment(IfcParse::IfcFile& f, bool no_progress, bool quiet, b
" objects ");
}
}
#endif
@@ -1,3 +1,5 @@
#ifdef IFOPSH_WITH_CGAL
#include "validation_utils.h"
#include <CGAL/Polygon_mesh_processing/bbox.h>
@@ -196,3 +198,4 @@ void fix_wallconnectivity(IfcParse::IfcFile& f, bool no_progress, bool quiet, bo
std::wcout << "total_conversion_to_poly_time " << conversion_to_poly << std::endl;
}
#endif
+5 -1
View File
@@ -1,3 +1,5 @@
#ifdef IFOPSH_WITH_CGAL
#include "validation_utils.h"
double facet_area(const cgal_shape_t::Facet_handle& f) {
@@ -25,4 +27,6 @@ void dump_facet(const cgal_shape_t::Facet_handle& f) {
auto osss = oss.str();
std::wcout << osss.c_str() << std::endl;
}
}
#endif
+4
View File
@@ -1,3 +1,5 @@
#ifdef IFOPSH_WITH_CGAL
#include "../ifcgeom/kernels/cgal/CgalKernel.h"
#include "../ifcgeom/IfcGeomFilter.h"
#include "../ifcgeom/Iterator.h"
@@ -582,3 +584,5 @@ struct intersection_validator {
CGAL::box_self_intersection_d(boxes.begin(), boxes.end(), fn);
}
};
#endif
+4
View File
@@ -69,6 +69,10 @@
#include "../ifcgeom/abstract_mapping.h"
#include "../ifcgeom/GeometrySerializer.h"
#ifdef IFOPSH_WITH_OPENCASCADE
#include <Standard_Failure.hxx>
#endif
#include <boost/algorithm/string.hpp>
#include <map>
@@ -4,6 +4,7 @@
#include "../../ConversionResult.h"
#include <Geom_Surface.hxx>
#include <TopoDS_Shape.hxx>
#include <list>
#include <vector>
+3
View File
@@ -579,6 +579,8 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
#endif
#ifdef IFOPSH_WITH_CGAL
%ignore svgfill::svg_to_line_segments;
%ignore svgfill::line_segments_to_polygons;
@@ -617,3 +619,4 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
}
%}
#endif
@@ -27,6 +27,8 @@
#include "../ifcgeom/GeometrySerializer.h"
#include <TopoDS_Shape.hxx>
class SERIALIZERS_API OpenCascadeBasedSerializer : public WriteOnlyGeometrySerializer {
OpenCascadeBasedSerializer(const OpenCascadeBasedSerializer&); //N/A
OpenCascadeBasedSerializer& operator =(const OpenCascadeBasedSerializer&); //N/A