Path to this page:
Subject: CVS commit: pkgsrc/devel/cmake
From: Taylor R Campbell
Date: 2025-01-24 22:23:07
Message id: 20250124212308.0D680FBE0@cvs.NetBSD.org
Log Message:
devel/cmake/build.mk: Limit cmake's perspective to buildlink3.
Hide LOCALBASE from cmake functions like find_package, find_path, &c.
But don't hide COMPILER_INCLUDE_DIRS and COMPILER_LIB_DIRS -- we only
want to hide undeclared pkgsrc packages, not system libraries.
Pass pkgsrc-defined CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH through
to cmake as environment variables rather than as cmake variables, and
do the same with CMAKE_PREFIX_PATH. This way, the project can define
its own paths -- as cmake intends -- without overriding pkgsrc's
BUILDLINK_DIR paths.
As a next step, we should set CMAKE_IGNORE_PREFIX_PATH to ignore
${LOCALBASE} in order to conceal it harder. It won't stop cmake from
finding things it shouldn't through paths exposed by pkg-config but
it might stop cmake from finding things it shouldn't by other paths
like projects putting ${PREFIX} or /usr/pkg in CMAKE_PREFIX_PATH
explicitly. However, that step will have more fallout, so I'll do it
separately.
Almost all the fallout has been resolved for this revision of the
change, either by tweaking the mechanism (like setting CMAKE_*
environemnt variables instead of cmake variables) or by tweaking
buildlink3 files. Let me know if anything else pops up -- usually in
the form of `CMake Error' at configure time failing to find
dependencies.
XXX Need mass revbump of all packages that use devel/cmake/build.mk
just in case this changed anything about the build.
Proposed on tech-pkg:
https://mail-index.netbsd.org/tech-pkg/2024/12/25/msg030256.html
Files: