Skip to content

CGALConfig.cmake does not correctly handle /lib -> /usr/lib symlink #8521

Open
@scgtrp

Description

@scgtrp

Issue Details

I'm on Arch, which does not use a separate /usr partition and replaces /lib with a symlink to /usr/lib.

I'm trying to compile OpenSCAD. It finds CGAL's cmake configuration at /lib/cmake/CGAL/CGALConfig.cmake. Then:

  • get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) sets CGAL_CONFIG_DIR=/lib/cmake/CGAL
  • the chain of get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) calls sets CGAL_ROOT=/
  • CGAL_FOUND is set by testing for the existence of /include/CGAL/config.h, which does not exist because /include isn't a thing
  • and OpenSCAD's build incorrectly complains that I don't have CGAL installed.

My CGAL installation otherwise seems fine; bodging it with

get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(CGAL_CONFIG_DIR "/usr${CGAL_CONFIG_DIR}")

is enough to allow the build to succeed.

Environment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions