Skip to content

Commit

Permalink
Improved FindCGAL.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-heltai committed Apr 27, 2022
1 parent 2df09bc commit 4250ee4
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions cmake/modules/FindCGAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,27 @@
# Try to find the CGAL libraries
#
# This module exports
#
#
# CGAL_LIBRARIES
# CGAL_INCLUDE_DIRS
#

SET(CGAL_DIR "" CACHE PATH "An optional hint to a CGAL installation")
SET_IF_EMPTY(CGAL_DIR "$ENV{CGAL_DIR}")

DEAL_II_FIND_PATH(CGAL_INC CGAL/config.h
HINTS ${CGAL_DIR}
PATH_SUFFIXES include
)
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})

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

0 comments on commit 4250ee4

Please sign in to comment.