From 6e60b821b7feb2532dfc0216bd9d5f8323c2923b Mon Sep 17 00:00:00 2001 From: yizeyi18 <18586016708@163.com> Date: Fri, 22 Mar 2024 16:40:29 +0800 Subject: [PATCH] Fix a bug from pkg-config. pkg-config would ignore flags like '-I/usr/include' in cflags; as ${prefix}_INCLUDE_DIRS is initialized from `pkg-config --cflags-only-I ${pkgname}`, it would be empty as only -I/usr/include in cflags. However, under this situation, cmake would still mark ${prefix}_FOUND as true, and without these global-visible includes no compilation issues arise; thus, this commit turns off detect of Libxc_INCLUDE_DIRS, and use Libxc_found instead. --- cmake/FindLibxc.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindLibxc.cmake b/cmake/FindLibxc.cmake index 2800942ca9..18a0ace4a3 100644 --- a/cmake/FindLibxc.cmake +++ b/cmake/FindLibxc.cmake @@ -11,7 +11,7 @@ endif() find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_search_module(Libxc IMPORTED_TARGET GLOBAL libxc) - find_package_handle_standard_args(Libxc DEFAULT_MSG Libxc_LINK_LIBRARIES Libxc_INCLUDE_DIRS) + find_package_handle_standard_args(Libxc DEFAULT_MSG Libxc_LINK_LIBRARIES Libxc_FOUND) endif() if(NOT Libxc_FOUND) find_package(Libxc REQUIRED HINTS