diff options
| author | ruki <[email protected]> | 2023-09-04 23:29:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-09-04 23:29:38 +0800 |
| commit | 40e70336ebbb4a6deb7c8277b7371d712cc2d621 (patch) | |
| tree | b41590a8e7f5b4935a1aa0281f00110fcde46a7d /xmake/modules/package/tools/cmake.lua | |
| parent | a509cad6889c33ff1bffb9c4a2719dca35788e08 (diff) | |
add pkg config path for cmake
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 6fd8ce855..2174508e2 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -742,6 +742,7 @@ function buildenvs(package, opt) local CMAKE_LIBRARY_PATH = {} local CMAKE_INCLUDE_PATH = {} local CMAKE_PREFIX_PATH = {} + local PKG_CONFIG_PATH = {} for _, dep in ipairs(package:librarydeps()) do if dep:is_system() then local fetchinfo = dep:fetch() @@ -752,11 +753,20 @@ function buildenvs(package, opt) end else table.join2(CMAKE_PREFIX_PATH, dep:installdir()) + local pkgconfig = path.join(dep:installdir(), "lib", "pkgconfig") + if os.isdir(pkgconfig) then + table.insert(PKG_CONFIG_PATH, pkgconfig) + end + pkgconfig = path.join(dep:installdir(), "share", "pkgconfig") + if os.isdir(pkgconfig) then + table.insert(PKG_CONFIG_PATH, pkgconfig) + end end end envs.CMAKE_LIBRARY_PATH = path.joinenv(CMAKE_LIBRARY_PATH) envs.CMAKE_INCLUDE_PATH = path.joinenv(CMAKE_INCLUDE_PATH) envs.CMAKE_PREFIX_PATH = path.joinenv(CMAKE_PREFIX_PATH) + envs.PKG_CONFIG_PATH = path.joinenv(PKG_CONFIG_PATH) return envs end |
