summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-09-18 01:42:01 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2014-09-18 01:42:01 -0700
commit4a19fa793edb524e0b77717c4eb25b4e958020bc (patch)
treed2303c28c46c56622af0ab95a21f5b07f5868031
parent250ffc28a3f94d039829cb96078a8242086e7dd5 (diff)
downloadspack-4a19fa793edb524e0b77717c4eb25b4e958020bc.tar.gz
spack-4a19fa793edb524e0b77717c4eb25b4e958020bc.tar.bz2
spack-4a19fa793edb524e0b77717c4eb25b4e958020bc.tar.xz
spack-4a19fa793edb524e0b77717c4eb25b4e958020bc.zip
Support for pkg-config.
-rw-r--r--lib/spack/spack/build_environment.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 182a5629fa..94d5b7a3be 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -144,9 +144,17 @@ def set_build_environment_variables(pkg):
os.environ[SPACK_DEBUG_LOG_DIR] = spack.spack_working_dir
# Add dependencies to CMAKE_PREFIX_PATH
- dep_prefixes = [d.package.prefix for d in pkg.spec.dependencies.values()]
path_set("CMAKE_PREFIX_PATH", dep_prefixes)
+ # Add any pkgconfig directories to PKG_CONFIG_PATH
+ pkg_config_dirs = []
+ for p in dep_prefixes:
+ for libdir in ('lib', 'lib64'):
+ pcdir = join_path(p, libdir, 'pkgconfig')
+ if os.path.isdir(pcdir):
+ pkg_config_dirs.append(pcdir)
+ path_set("PKG_CONFIG_PATH", pkg_config_dirs)
+
def set_module_variables_for_package(pkg):
"""Populate the module scope of install() with some useful functions.