This script fails to find OpenCASCADE (cad/opencascade): > cmake_minimum_required(VERSION 3.26) > #set(CMAKE_PREFIX_PATH "/usr/local/lib") > find_package(OpenCASCADE CONFIG REQUIRED) The second line needs to be un-commented as a workaround, which shouldn't be the case. cmake obviously doesn't look for config files in /usr/local/lib/cmake. I am not sure what is the correct search path in general, but it should either include /usr/local/lib/cmake by default, or all packages that install config files into /usr/local/lib/cmake should be changed to move them into the searched location. Otherwise this would cause problems for many ports. cmake-core-3.26.1_3
From what I can tell by the documentation this seems to be misused by upstream? https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html Related: https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure
It looks like cad/opencascade is installing its CMake files into the wrong location. ${PREFIX}/lib/cmake/${PROJECT_NAME} is typical, but opencascade is dumping its files directly into ${PREFIX}/lib/cmake for some reason. This isn't a CMake problem. Ports that install files outside of the expected search paths should be fixed.
Created attachment 246127 [details] Fix cmake files In this case pathfix does nothing, but the attached patch should do the trick.
Before committing my patch, I have to check that is does not break the consumers of OpenCASCADE.
(In reply to Thierry Thomas from comment #4) Not good, it breaks cad/PrusaSlicer. Let’s try another one.
Committed, the second try was OK. Thanks for the report.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3f197bbce4da6ec6f860448653f4a2d2e9b25a11 commit 3f197bbce4da6ec6f860448653f4a2d2e9b25a11 Author: Thierry Thomas <thierry@FreeBSD.org> AuthorDate: 2023-11-05 13:07:18 +0000 Commit: Thierry Thomas <thierry@FreeBSD.org> CommitDate: 2023-11-05 13:07:18 +0000 cad/opencascade: fix location of cmake files PR: 274834 Reported by: yuri cad/opencascade/Makefile | 7 ++++++- cad/opencascade/pkg-plist | 34 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 18 deletions(-)