mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 14:58:00 +08:00
[vcpkg] Add VCPKG_SUPPRESS_INSTALLED_LIBRARIES_WARNING and VCPKG_OVERRIDE_FIND_PACKAGE_NAME parameters to the vcpkg toolchain. (#9996)
VCPKG_SUPPRESS_INSTALLED_LIBRARIES_WARNING - Silences warning about lacking installed libraries for the current triplet VCPKG_OVERRIDE_FIND_PACKAGE_NAME - Enables cooperation with other tooling that may want to hook find_package
This commit is contained in:
parent
f7fb56decd
commit
039098c954
@ -122,7 +122,7 @@ if(NOT DEFINED _VCPKG_ROOT_DIR)
|
||||
endif()
|
||||
set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed)
|
||||
|
||||
if(NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" AND NOT _CMAKE_IN_TRY_COMPILE)
|
||||
if(NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" AND NOT _CMAKE_IN_TRY_COMPILE AND NOT VCPKG_SUPPRESS_INSTALLED_LIBRARIES_WARNING)
|
||||
message(WARNING "There are no libraries installed for the Vcpkg triplet ${VCPKG_TARGET_TRIPLET}.")
|
||||
endif()
|
||||
|
||||
@ -233,7 +233,10 @@ function(add_library name)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(find_package name)
|
||||
if(NOT DEFINED VCPKG_OVERRIDE_FIND_PACKAGE_NAME)
|
||||
set(VCPKG_OVERRIDE_FIND_PACKAGE_NAME find_package)
|
||||
endif()
|
||||
macro(${VCPKG_OVERRIDE_FIND_PACKAGE_NAME} name)
|
||||
string(TOLOWER "${name}" _vcpkg_lowercase_name)
|
||||
if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake")
|
||||
set(ARGS "${ARGV}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user