From e638ea09f936fcde2cd42bfdb9c154e202c270c6 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 22 Jul 2021 11:53:07 -0500 Subject: [PATCH] CMake: defer to PKG_CONFIG_PATH if it exists #1933 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ad09e9e0..bccbbfe92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,11 @@ endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") elseif(APPLE) +# surely there's a better way to do this? alas, seems necessary to pull the +# pkg-config files out of Homebrew. +if(NOT DEFINED ENV{PKG_CONFIG_PATH}) set(ENV{PKG_CONFIG_PATH} "/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig") +endif() set(PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") else() set(PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig")