depends: Force `CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE`

When using CMake policies 3.14 and below, the `export(PACKAGE)` command
by default populates the user package registry, which is stored outside
the build tree. Setting the `CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable
disables this side effect.

In CMake 3.15 and later, this behavior is disabled by default, and the
variable has no effect.

Github-Pull: #32943
Rebased-From: 44f3bae300
This commit is contained in:
Hennadii Stepanov 2025-07-10 17:55:34 +01:00 committed by fanquake
parent 3c56d36bec
commit 792ee20318
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
1 changed files with 1 additions and 0 deletions

View File

@ -186,6 +186,7 @@ $(1)_cmake=env CC="$$($(1)_cc)" \
-DCMAKE_INSTALL_LIBDIR=lib/ \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=$(V) \
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=TRUE \
$$($(1)_config_opts)
ifeq ($($(1)_type),build)
$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib"