openmpi: add package-specific 'headers' property (#7267)

* [OpenMPI] Add the 'headers' property. This removes some redundant
headers from sub-directories, returned by the default '.headers'
handler.

* [OpenMPI] In the .headers property, add a fallback to search all of
prefix for the mpi.h header. Recommended by @junghans to support some
external configurations, see #7268.
This commit is contained in:
Veselin Dobrev 2018-03-05 11:53:36 -08:00 committed by Christoph Junghans
parent 3cf2cda4ec
commit e4597f09be

View file

@ -220,6 +220,13 @@ def url_for_version(self, version):
url = "http://www.open-mpi.org/software/ompi/v{0}/downloads/openmpi-{1}.tar.bz2"
return url.format(version.up_to(2), version)
@property
def headers(self):
hdrs = HeaderList(find(self.prefix.include, 'mpi.h', recursive=False))
if not hdrs:
hdrs = HeaderList(find(self.prefix, 'mpi.h', recursive=True))
return hdrs or None
@property
def libs(self):
query_parameters = self.spec.last_query.extra_parameters