Skip to content

Commit f52d81b

Browse files
authored
GH-47005: [C++] Disable exporting CMake packages (#47006)
### Rationale for this change azure-sdk-for-cpp uses `export(PACKAGE)` https://cmake.org/cmake/help/latest/command/export.html#package . It changes user package registry (`~/.cmake/packages/`) https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#user-package-registry . It's outside of a build directory. If user package registry is changed, other build may be failed. ### What changes are included in this PR? Disable `export(PACKAGE)`. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: #47005 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent bd24668 commit f52d81b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

cpp/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ cmake_policy(SET CMP0074 NEW)
6161
# option() honors normal variables.
6262
cmake_policy(SET CMP0077 NEW)
6363

64+
# https://cmake.org/cmake/help/latest/policy/CMP0090.html
65+
#
66+
# export(PACKAGE) does nothing by default.
67+
cmake_policy(SET CMP0090 NEW)
68+
6469
# https://cmake.org/cmake/help/latest/policy/CMP0091.html
6570
#
6671
# MSVC runtime library flags are selected by an abstraction.

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,8 @@ macro(prepare_fetchcontent)
10161016
set(BUILD_TESTING OFF)
10171017
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "")
10181018
set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)
1019-
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY OFF)
1019+
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON)
1020+
set(CMAKE_EXPORT_PACKAGE_REGISTRY OFF)
10201021
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "")
10211022
set(CMAKE_MACOSX_RPATH ${ARROW_INSTALL_NAME_RPATH})
10221023
# We set CMAKE_POLICY_VERSION_MINIMUM temporarily due to failures with CMake 4

0 commit comments

Comments
 (0)