Fix CGAL library linking on windows, conditional IfcTriangulatedFaceSet based on schema

This commit is contained in:
Thomas Krijnen
2017-03-09 12:14:00 +01:00
parent deea0f6558
commit 619b4fbed5
3 changed files with 19 additions and 7 deletions
+15 -7
View File
@@ -220,15 +220,23 @@ ENDIF()
FIND_LIBRARY(libCGAL NAMES CGAL PATHS ${CGAL_LIBRARY_DIR} NO_DEFAULT_PATH)
IF(libCGAL)
MESSAGE(STATUS "CGAL library files found")
foreach(lib ${CGAL_LIBRARY_NAMES})
string(REPLACE libCGAL "${lib}" lib_path "${libCGAL}")
list(APPEND CGAL_LIBRARIES "${lib_path}")
endforeach()
ELSE()
MESSAGE(FATAL_ERROR "Unable to find CGAL library files, aborting")
FILE(GLOB CGAL_LIBRARIES ${CGAL_LIBRARY_DIR}/CGAL*.lib)
LIST(LENGTH CGAL_LIBRARY_NAMES num_cgal_library_names)
LIST(LENGTH CGAL_LIBRARIES num_cgal_libraries)
LINK_DIRECTORIES("${CGAL_LIBRARY_DIR}")
if(NOT "${num_cgal_library_names}" STREQUAL "${num_cgal_library_names}")
MESSAGE(FATAL_ERROR "Unable to find CGAL library files, aborting")
endif()
MESSAGE(STATUS "CGAL library files found")
ENDIF()
foreach(lib ${CGAL_LIBRARY_NAMES})
string(REPLACE libCGAL "${lib}" lib_path "${libCGAL}")
list(APPEND CGAL_LIBRARIES "${lib_path}")
endforeach()
FIND_LIBRARY(libGMP NAMES gmp PATHS ${GMP_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(libMPFR NAMES mpfr PATHS ${MPFR_LIBRARY_DIR} NO_DEFAULT_PATH)
# TODO: Remove hardcoded version numbers for windows
FIND_LIBRARY(libGMP NAMES gmp "libgmp-10" PATHS ${GMP_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(libMPFR NAMES mpfr "libmpfr-4" PATHS ${MPFR_LIBRARY_DIR} NO_DEFAULT_PATH)
IF(NOT libGMP)
MESSAGE(FATAL_ERROR "Unable to find GMP library files, aborting")
ENDIF()
@@ -46,7 +46,9 @@ SHAPE(IfcSphere);
SHAPE(IfcRectangularPyramid);
SHAPE(IfcRightCircularCylinder);
SHAPE(IfcRightCircularCone);
#ifdef USE_IFC4
SHAPE(IfcTriangulatedFaceSet);
#endif
SHAPE(IfcHalfSpaceSolid);
FACE(IfcArbitraryClosedProfileDef);
@@ -876,6 +876,7 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcRightCircularCone* l, cgal
return true;
}
#ifdef USE_IFC4
bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcTriangulatedFaceSet* l, cgal_shape_t& shape) {
IfcSchema::IfcCartesianPointList3D* point_list = l->Coordinates();
const std::vector< std::vector<double> > coordinates = point_list->CoordList();
@@ -937,6 +938,7 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcTriangulatedFaceSet* l, cg
shape = CGAL::Nef_polyhedron_3<Kernel>(polyhedron);
return true;
}
#endif
bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcHalfSpaceSolid* l, cgal_shape_t& shape) {
IfcSchema::IfcSurface* surface = l->BaseSurface();