vcpkg/scripts/test_ports/cmake-user/project/FindZLIBviaPkgConfig.cmake
Kai Pastor fb3190dcc5
[vcpkg script] Test pkg-config integration (#25531)
* Require cmake-user to pass CI

* Update baseline state documentation

* Test pkg-config integration

* Prefer pkgconf

* Make pkgconf required
2022-07-07 14:27:38 -07:00

12 lines
412 B
CMake

# `pkgconf` is not recognized before CMake 3.22
find_program(PKG_CONFIG_EXECUTABLE NAMES pkgconf REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_ZLIB zlib)
if(PC_ZLIB_FOUND)
if(NOT PC_ZLIB_LDFLAGS)
message(SEND_ERROR "ZLIBviaPkgConfig_LIBRARIES is empty")
endif()
set(ZLIBviaPkgConfig_LIBRARIES "${PC_ZLIB_LDFLAGS}")
set(ZLIBviaPkgConfig_FOUND "${PC_ZLIB_FOUND}")
endif()