Eigen package: support Spack-external builds using Eigen (#10751)

Update CPATH in setup_environment for Eigen, so that the
Spack-generated module for Eigen will help builds outside of Spack
use the appropriate include prefix for Eigen headers 
(<install_prefix>/include/eigen3/ rather than <install_prefix>/include/)
Note that this only updates the run-time environment, rather than the
build-time environment, so Spack builds depending on Eigen that use
pkgconfig will not be confused by the presence of the Eigen include
directory in CPATH.
This commit is contained in:
Jeongseok Lee 2019-03-06 18:48:38 -08:00 committed by Peter Scheibel
parent 836f40e30f
commit 0e22a94f81

View File

@ -47,6 +47,10 @@ class Eigen(CMakePackage):
patch('find-ptscotch.patch', when='@3.3.4')
def setup_environment(self, spack_env, run_env):
run_env.prepend_path('CPATH',
join_path(self.prefix, 'include', 'eigen3'))
@property
def headers(self):
headers = find_all_headers(self.prefix.include)