]> https://gitweb.dealii.org/ - dealii.git/commitdiff
First try at detecting CGAL more robustly. 13669/head
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 4 May 2022 11:14:04 +0000 (14:14 +0300)
committerLuca Heltai <luca.heltai@sissa.it>
Wed, 4 May 2022 11:14:04 +0000 (14:14 +0300)
.github/workflows/linux.yml
cmake/modules/FindCGAL.cmake

index 1921887c90f89b6570a93cb252b0f812ef905ebc..986bed1d35ed088ceab34a376a44130727271883 100644 (file)
@@ -51,21 +51,22 @@ jobs:
     # simple parallel debug build using g++ with simplex configuration enabled
 
     name: linux debug parallel simplex
-    runs-on: [ubuntu-18.04]
+    runs-on: [ubuntu-20.04]
 
     steps:
     - uses: actions/checkout@v2
     - name: modules
       run: |
         sudo apt-get install -y software-properties-common
-        sudo add-apt-repository ppa:ginggs/deal.ii-9.2.0-backports
+        sudo add-apt-repository -y ppa:ginggs/deal.ii-9.3.0-backports
         sudo apt-get update
         sudo apt-get install -yq --no-install-recommends \
             numdiff \
+            libboost-all-dev \
+            libcgal-dev \
             libp4est-dev \
             trilinos-all-dev \
             petsc-dev \
-            libcgal-dev \
             libmetis-dev \
             libhdf5-mpi-dev
     - name: info
@@ -79,6 +80,7 @@ jobs:
         cmake -D CMAKE_BUILD_TYPE=Debug \
               -D DEAL_II_CXX_FLAGS='-Werror -std=c++17' \
               -D DEAL_II_EARLY_DEPRECATIONS=ON \
+              -D DEAL_II_WITH_CGAL="ON" \
               -D DEAL_II_WITH_MPI="ON" \
               -D DEAL_II_WITH_TRILINOS="ON" \
               -D DEAL_II_WITH_PETSC="ON" \
index 494bd72d13c16d80fc314b2e834210466721a711..34af36d89a16c210c615433a5951932dd8b09008 100644 (file)
@@ -31,29 +31,36 @@ ENDIF()
 IF(DEAL_II_HAVE_CXX17)
   # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
   LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
-  FIND_PACKAGE(CGAL 5.0)
+  SET(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE ON)
+  FIND_PACKAGE(CGAL)
+  # Check version manually. Older binary distros don't do this properly.
+  IF(CGAL_MAJOR_VERSION LESS 5)
+    SET(CGAL_FOUND FALSE)
+    SET(CGAL_INCLUDE_DIRS "-NOTFOUND")
+    SET(CGAL_LIBRARIES "-NOTFOUND")
+    MESSAGE(STATUS "CGAL wrappers require CGAL version 5 and above.")
+  ENDIF()
   LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
-  IF(NOT CGAL_HEADER_ONLY)
-    SET(CGAL_LIBS "-NOTFOUND")
-    MESSAGE(STATUS "CGAL wrappers require header only version of CGAL.")
-  ELSE()
-    SET(CGAL_LIBS CGAL::CGAL)
-  ENDIF(CGAL_HEADER_ONLY)
-ELSE(DEAL_II_HAVE_CXX17)
+  IF(CGAL_FOUND)
+    GET_TARGET_PROPERTY(CGAL_LIBRARIES CGAL::CGAL INTERFACE_LINK_LIBRARIES)
+    # Make sure we dont' pass Boost::Boost over to deal.II.
+    LIST(FILTER CGAL_LIBRARIES EXCLUDE REGEX "::")
+  ENDIF()
+ELSE()
   SET(CGAL_FOUND FALSE)
   SET(CGAL_INCLUDE_DIRS "-NOTFOUND")
-  SET(CGAL_LIBS "-NOTFOUND")
+  SET(CGAL_LIBRARIES "-NOTFOUND")
   MESSAGE(STATUS "CGAL wrappers require C++17. Disabling CGAL Support.")
-ENDIF(DEAL_II_HAVE_CXX17)
+ENDIF()
 
 DEAL_II_PACKAGE_HANDLE(CGAL
   INCLUDE_DIRS
     REQUIRED CGAL_INCLUDE_DIRS
   LIBRARIES
-    OPTIONAL CGAL_LIBS
+    OPTIONAL CGAL_LIBRARIES
   USER_INCLUDE_DIRS
     REQUIRED CGAL_INCLUDE_DIRS
   CLEAR 
     CGAL_INCLUDE_DIRS
-    CGAL_LIBS
+    CGAL_LIBRARIES
   )

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.