From 1ef1fd90ecb18d942b35014e91fffdb1f7bbfbaa Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Wed, 15 Jun 2022 00:06:52 -0700 Subject: [PATCH] libidn2: Use pkg-config for include dir PiperOrigin-RevId: 455050938 Change-Id: I73db6d3036ade8fc4638d7a3a5cfd659dd83555c --- contrib/libidn2/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/libidn2/CMakeLists.txt b/contrib/libidn2/CMakeLists.txt index 7ab23e3..60ab55d 100644 --- a/contrib/libidn2/CMakeLists.txt +++ b/contrib/libidn2/CMakeLists.txt @@ -29,9 +29,13 @@ if(NOT TARGET sapi::sapi) EXCLUDE_FROM_ALL) endif() +# Use pkg-config for the libidn2 include paths +find_package(PkgConfig REQUIRED) +pkg_check_modules(libidn2 REQUIRED IMPORTED_TARGET libidn2) + # System libidn2 needs to have the libidn2-dev and libunistring-dev packages -# installed. We cannot use pkg-config here, as libidn2's config file does not -# support static linking. +# installed. We cannot use pkg-config here, as libidn2's pkg-config file does +# not support static linking well. find_library(libidn2 NAMES libidn2.a idn2) find_library(libunistring NAMES libunistring.a unistring)