mirror of
https://github.com/curl/curl.git
synced 2026-04-28 17:22:13 +03:00
cmake: expand CURL_USE_PKGCONFIG to non-cross MINGW
Enable `CURL_USE_PKGCONFIG` by default for more environments:
- for `MINGW` targets when not using cross-compilation.
- stop restricting vcpkg to MSVC. (this currently unlocks mingw,
also unlocked by the update above.)
Also:
- cache `CURL_USE_PKGCONFIG` in `CURLConfig.cmake`.
Suggested-by: Kai Pastor
Follow-up to c555ab469d #14575
Closes #14658
This commit is contained in:
parent
c5e3d8ba94
commit
e1ab01d1bd
2 changed files with 6 additions and 7 deletions
|
|
@ -23,13 +23,12 @@
|
|||
###########################################################################
|
||||
@PACKAGE_INIT@
|
||||
|
||||
if(NOT DEFINED CURL_USE_PKGCONFIG)
|
||||
if(UNIX OR (MSVC AND VCPKG_TOOLCHAIN)) # Keep in sync with root CMakeLists.txt
|
||||
set(CURL_USE_PKGCONFIG ON)
|
||||
else()
|
||||
set(CURL_USE_PKGCONFIG OFF)
|
||||
endif()
|
||||
if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING)) # Keep in sync with root CMakeLists.txt
|
||||
set(_curl_use_pkgconfig_default ON)
|
||||
else()
|
||||
set(_curl_use_pkgconfig_default OFF)
|
||||
endif()
|
||||
option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies" ${_curl_use_pkgconfig_default})
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
if(@USE_OPENSSL@)
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ else()
|
|||
endif()
|
||||
|
||||
# Override to force-disable or force-enable the use of pkg-config.
|
||||
if(UNIX OR (MSVC AND VCPKG_TOOLCHAIN)) # Keep in sync with CMake/curl-config.cmake.in
|
||||
if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING)) # Keep in sync with CMake/curl-config.cmake.in
|
||||
set(_curl_use_pkgconfig_default ON)
|
||||
else()
|
||||
set(_curl_use_pkgconfig_default OFF)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue