Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Honor CMAKE_DISABLE_FIND_PACKAGE_*. Fixes #18631 #18961

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,16 @@ macro("${VCPKG_OVERRIDE_FIND_PACKAGE_NAME}" z_vcpkg_find_package_package_name)
set(z_vcpkg_find_package_vcpkg_cmake_wrapper_path
"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${z_vcpkg_find_package_lowercase_package_name}/vcpkg-cmake-wrapper.cmake")

if(EXISTS "${z_vcpkg_find_package_vcpkg_cmake_wrapper_path}")
if(CMAKE_DISABLE_FIND_PACKAGE_${z_vcpkg_find_package_package_name})
list(FIND z_vcpkg_find_package_ARGN "REQUIRED" z_vcpkg_required_idx)
if(z_vcpkg_required_idx STREQUAL "-1")
# Do nothing in the case of find_package disabled and not REQUIRED
# CMake 3.20 does not set ${z_vcpkg_find_package_package_name}_FOUND in this case
else()
# If REQUIRED, let CMake handle the error reporting
_find_package("${z_vcpkg_find_package_package_name}" ${z_vcpkg_find_package_ARGN})
endif()
elseif(EXISTS "${z_vcpkg_find_package_vcpkg_cmake_wrapper_path}")
list(APPEND z_vcpkg_find_package_backup_vars "ARGS")
if(DEFINED ARGS)
set(z_vcpkg_find_package_backup_ARGS "${ARGS}")
Expand Down
1 change: 1 addition & 0 deletions scripts/ports.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rebuild: 1
cmake_minimum_required(VERSION 3.21)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still 3.20.4 for freebsd in

<tool name="cmake" os="freebsd">
<version>3.20.4</version>
<exeRelativePath>usr/local/bin/cmake</exeRelativePath>
<url>https://pkg.freebsd.org/FreeBSD:13:amd64/quarterly/All/cmake-3.20.4.txz</url>
<sha512>3e5b675d7ff924f92996d912e2365582e687375109ef99c9073fb8196bb329243a406b218cf1358d7cc518988b311ce9e5bf87de4d64f2e6377b7c2bc8894475</sha512>
<archiveName>cmake-3.20.4.txz</archiveName>
</tool>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake 3.21.4 seems to be available for freebsd now:
https://www.freebsd.org/cgi/ports.cgi?query=cmake&stype=name&sektion=all

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment is no longer relevant.
freebsd is still at 3.20.3 in vcpkg, but the requirement was bumped with another PR, and nobody (except for me) tool notice.


set(SCRIPTS "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Location to stored scripts")
Expand Down