The problem shows because we are customizing the install path of cmake files by redefining the variable INSTALL_DIR_CMAKE (this is needed to install cmake config files in the right location where they can be easily found). This is an upstream bug but, due to downstream customization of cmake installation path, we have problems with gentoo packages (which should be patched) depending on opencascade and using cmake find_package(OpenCASCADE Config) for configuration. I have already opened a bug report upstream: https://tracker.dev.opencascade.org/view.php?id=32035 I have written a simple CMakeLists.txt to show the problem. Here is also attached a simple patch to solve the problem on Gentoo until upstream fixes it. IMHO it's better to have a fix in a single place instead of patching all the packages using find_package(OpenCASCADE Config)
current situation: found config file in: /usr/lib64/cmake/opencascade-7.4.0/OpenCASCADEConfig.cmake opencascade root defined via env var CASROOT: /usr/lib64/opencascade-7.4.0/ros opencascade vars defined in cmake config: - root: /usr - binary in /usr/bin - includes in /usr/include/opencascade - libs in /usr/lib64 - resources in /usr/share/opencascade/resources - scripts in /usr/bin with the proposed patch: found config file in: /usr/lib64/cmake/opencascade-7.4.0/OpenCASCADEConfig.cmake opencascade root defined via env var CASROOT: /usr/lib64/opencascade-7.4.0/ros opencascade vars defined in cmake config: - root: /usr/lib64/opencascade-7.4.0/ros - binary in /usr/lib64/opencascade-7.4.0/ros/bin - includes in /usr/lib64/opencascade-7.4.0/ros/include/opencascade - libs in /usr/lib64/opencascade-7.4.0/ros/lib64 - resources in /usr/lib64/opencascade-7.4.0/ros/share/opencascade/resources - scripts in /usr/lib64/opencascade-7.4.0/ros/bin
Created attachment 680725 [details, diff] opencascade-7.4.0-fix-cmake.patch
Created attachment 680728 [details] CMakeLists.txt
Thanks for the hint. I never noticed it, as the package I'm using which require opencascade found the files from occ. But it's an important point. I'm preparing a PR for this.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a529685c95f6c74ed4b46d4c7501373b0a55769 commit 3a529685c95f6c74ed4b46d4c7501373b0a55769 Author: Bernd Waibel <waebbl-gentoo@posteo.net> AuthorDate: 2021-02-09 21:20:39 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2021-02-18 09:36:11 +0000 sci-libs/opencascade: fix paths in cmake config Thanks to Fabio Rossi for reporting the issue. See also upstream bug at https://tracker.dev.opencascade.org/view.php?id=32035 Closes: https://bugs.gentoo.org/763162 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net> Signed-off-by: Joonas Niilola <juippis@gentoo.org> ...7.4.0-fix-issue-with-cmake-path-variables.patch | 41 ++++++ sci-libs/opencascade/opencascade-7.4.0-r4.ebuild | 148 +++++++++++++++++++++ 2 files changed, 189 insertions(+)