Skip to content

Commit

Permalink
Make sure cgal support is enabled with cxx17.
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-heltai committed Apr 27, 2022
1 parent 80d17b5 commit 51016fc
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions cmake/modules/FindCGAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#
# This module exports
#
# CGAL_LIBRARIES
# CGAL_INCLUDE_DIRS
#

Expand All @@ -29,15 +28,18 @@ IF(NOT "${CGAL_DIR}" STREQUAL "")
SET(CGAL_DIR ${CGAL_DIR})
ENDIF()

# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
FIND_PACKAGE(CGAL)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)

SET(CGAL_VERSION ${CGAL_VERSION_STRING})
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)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
ELSE(DEAL_II_HAVE_CXX17)
SET(CGAL_FOUND FALSE)
SET(CGAL_INCLUDE_DIRS "-NOTFOUND")
MESSAGE("-- WARNING: CGAL wrappers require cxx17. Disabling CGAL Support.")
ENDIF(DEAL_II_HAVE_CXX17)

DEAL_II_PACKAGE_HANDLE(CGAL
LIBRARIES OPTIONAL CGAL_LIBRARIES
INCLUDE_DIRS REQUIRED CGAL_INCLUDE_DIRS
CLEAR CGAL_LIBRARIES CGAL_INCLUDE_DIRS
CLEAR CGAL_INCLUDE_DIRS
)

0 comments on commit 51016fc

Please sign in to comment.