-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CGALConfig.cmake does not correctly handle /lib -> /usr/lib symlink #8521
Comments
Any idea why cmake looks for the file in /lib/cmake and not the equivalent and more canonical /usr/lib/cmake? On a debian system with the same /lib -> /usr/lib symlink, I do get a path starting with /usr/lib. Maybe something in your environment, or a strange cmake config in arch? |
That's an excellent question. I don't know cmake well enough to answer it for sure. OpenSCAD CMakeLists.txt does: Going down the list of environment variables here (ctrl-F "The set of installation prefixes is constructed using the following steps.")
( I did see the "Path entries ending in /bin or /sbin are automatically converted to their parent directories" bit in the cmake manual. I tried reverting my bodge and doing Happy to dig into other things if you have ideas for where to look. |
When you tried again using a PATH that has /usr/bin before (or instead of) /bin, was it with a clean directory, or did it have remnants of previous tries? |
I thought I was in a clean directory, but perhaps not. I just tried |
So, eventually, @scgtrp, do you still think that is a bug from CGAL? |
That's kind of a philosophical categorization problem, ne? I can see an argument where it's CGAL's problem (should be doing realpath before doing path manipulations), or cmake's problem (shouldn't do sketchy manipulations on $PATH to generate cmake search paths, or should at least add a hack for the common merged / + /usr case as @mglisse suggested), or even the distros' problem (should set CMAKE_PREFIX_PATHS somewhere, or should have just deleted /usr and moved its contents into / instead of setting up a situation where most, but not all, system files are accessible at two different locations). As a developer, I'd just hack it with realpath on the CGAL side and be done with it while grumbling about the other things. If I knew cmake upstream to be receptive to such changes (I've never dealt with them myself), I'd suggest it to them in parallel, but otherwise probably wouldn't bother. As an end user, I don't care, I just want the thing to work without making me debug cmake scripts. |
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)
setsCGAL_CONFIG_DIR=/lib/cmake/CGAL
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
calls setsCGAL_ROOT=/
CGAL_FOUND
is set by testing for the existence of/include/CGAL/config.h
, which does not exist because/include
isn't a thingMy CGAL installation otherwise seems fine; bodging it with
is enough to allow the build to succeed.
Environment
The text was updated successfully, but these errors were encountered: