diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4aa86580ff6524c819fcf249e3b223eb107f787c..b39ba88c0cac4d3604b10410b32a8e1ef079e94a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,9 +30,17 @@ build-img: image: $CI_REGISTRY_IMAGE:latest needs: ['build-img'] script: + - conan install -if build -g cmake_find_package catch2/2.13.7@ + - | + if [ "$ENABLE_CGAL" == "ON" ]; then + conan install -if build -g cmake_find_package cgal/5.2.1@ + fi + - conan install -if build -g cmake_find_package taocpp-pegtl/3.2.1@ + - cmake -S. -Bbuild -GNinja + -DCMAKE_MODULE_PATH=$PWD/build -DCMAKE_BUILD_TYPE=Debug -DCSG_CGAL_ENABLED=${ENABLE_CGAL} -DCMAKE_CXX_FLAGS="-pedantic-errors" @@ -52,33 +60,44 @@ test:no_cgal: ENABLE_CGAL: "OFF" <<: *cmake_def -.test:spack: &spack_def - stage: test - image: $CI_REGISTRY_IMAGE:latest - needs: ['build-img'] - when: manual - script: - - /usr/local/spack/bin/spack repo add .spack/repo - - /usr/local/spack/bin/spack install csg-eb ${NO_CSG} - tags: - - docker - -spack:cgal: - variables: - NO_CSG: "" - <<: *spack_def - -spack:no_cgal: - variables: - NO_CSG: "~cgal" - <<: *spack_def +#.test:spack: &spack_def +# stage: test +# image: $CI_REGISTRY_IMAGE:latest +# needs: ['build-img'] +# when: manual +# script: +# - /usr/local/spack/bin/spack repo add .spack/repo +# - /usr/local/spack/bin/spack install csg-eb ${NO_CSG} +# tags: +# - docker +# +#spack:cgal: +# variables: +# NO_CSG: "" +# <<: *spack_def +# +#spack:no_cgal: +# variables: +# NO_CSG: "~cgal" +# <<: *spack_def .test:gnumake: &gnumake_def stage: test variables: + BUILD: ${CI_PROJECT_DIR}/build + BOOST_HOME: ${BUILD}/boost + CATCH2_HOME: ${BUILD}/catch2 + CGAL_HOME: ${BUILD}/cgal + PEGTL_HOME: ${BUILD}/taocpp-pegtl image: $CI_REGISTRY_IMAGE:latest needs: ['build-img'] script: + - conan install -if build -g deploy catch2/2.13.7@ + - | + if [ "$ENABLE_CGAL" == "ON" ]; then + conan install -if build -g deploy cgal/5.2.1@ + fi + - conan install -if build -g deploy taocpp-pegtl/3.2.1@ - make install DESTDIR=the_destination tags: - docker diff --git a/src/csg/cgal_helper_polyhedron.cpp b/src/csg/cgal_helper_polyhedron.cpp index 68e790461338d47ed8aca83c2e79af2d9e88c307..bafc6889a9e1cc390a9e25a69f0986786c8dcbee 100644 --- a/src/csg/cgal_helper_polyhedron.cpp +++ b/src/csg/cgal_helper_polyhedron.cpp @@ -2,7 +2,6 @@ #include "csg_exception.hpp" #include -#include #include #include #include @@ -11,6 +10,12 @@ #include #include +#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0) +#include +#else +#include +#endif + namespace { typedef cgal_helper::Polyhedron::HalfedgeDS HalfedgeDS; diff --git a/src/csg_cgal_helper.hpp b/src/csg_cgal_helper.hpp index 541b41cda1768ad6b1e70d9a99faba26ac9ae933..e6731db147a9b08122411a0f7c34732347950572 100644 --- a/src/csg_cgal_helper.hpp +++ b/src/csg_cgal_helper.hpp @@ -1,6 +1,7 @@ #ifndef CGAL_HELPER_H_ #define CGAL_HELPER_H_ +#include #include #include #include @@ -15,9 +16,16 @@ typedef CGAL::Polyhedron_3 Polyhedron; typedef CGAL::Polygon_2 Polygon; typedef CGAL::AABB_face_graph_triangle_primitive Primitive; -typedef CGAL::AABB_traits Traits; + +#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0) + typedef CGAL::AABB_traits_3 Traits; +#else + typedef CGAL::AABB_traits Traits; +#endif + typedef CGAL::AABB_tree AABBTree; + std::shared_ptr create_polyhedron(const std::vector> &points, const std::vector> &faces);