Opencv fix (#5040)

* Added a package for the MDAnalysis toolkit.

* Changed cmake_options to args to be consistent with the rest of the
file and fix a cmake error about undefined errors.  Additionally,
added guards for both png and zlib to not include their cmake options
when those variants are not specified.
This commit is contained in:
Brian Van Essen 2017-08-09 13:40:10 -07:00 committed by Adam J. Stewart
parent 0137f17306
commit 28b0421eb1

View File

@ -128,6 +128,7 @@ def cmake_args(self):
] ]
# Media I/O # Media I/O
if '+zlib' in spec:
zlib = spec['zlib'] zlib = spec['zlib']
args.extend([ args.extend([
'-DZLIB_LIBRARY_{0}:FILEPATH={1}'.format(( '-DZLIB_LIBRARY_{0}:FILEPATH={1}'.format((
@ -137,6 +138,7 @@ def cmake_args(self):
'-DZLIB_INCLUDE_DIR:PATH={0}'.format(zlib.prefix.include) '-DZLIB_INCLUDE_DIR:PATH={0}'.format(zlib.prefix.include)
]) ])
if '+png' in spec:
libpng = spec['libpng'] libpng = spec['libpng']
args.extend([ args.extend([
'-DPNG_LIBRARY_{0}:FILEPATH={1}'.format(( '-DPNG_LIBRARY_{0}:FILEPATH={1}'.format((
@ -148,7 +150,7 @@ def cmake_args(self):
if '+jpeg' in spec: if '+jpeg' in spec:
libjpeg = spec['libjpeg-turbo'] libjpeg = spec['libjpeg-turbo']
cmake_options.extend([ args.extend([
'-DBUILD_JPEG:BOOL=OFF', '-DBUILD_JPEG:BOOL=OFF',
'-DJPEG_LIBRARY:FILEPATH={0}'.format( '-DJPEG_LIBRARY:FILEPATH={0}'.format(
join_path(libjpeg.prefix.lib, join_path(libjpeg.prefix.lib,
@ -158,7 +160,7 @@ def cmake_args(self):
if '+tiff' in spec: if '+tiff' in spec:
libtiff = spec['libtiff'] libtiff = spec['libtiff']
cmake_options.extend([ args.extend([
'-DTIFF_LIBRARY_{0}:FILEPATH={1}'.format(( '-DTIFF_LIBRARY_{0}:FILEPATH={1}'.format((
'DEBUG' if '+debug' in spec else 'RELEASE'), 'DEBUG' if '+debug' in spec else 'RELEASE'),
join_path(libtiff.prefix.lib, join_path(libtiff.prefix.lib,
@ -168,7 +170,7 @@ def cmake_args(self):
if '+jasper' in spec: if '+jasper' in spec:
jasper = spec['jasper'] jasper = spec['jasper']
cmake_options.extend([ args.extend([
'-DJASPER_LIBRARY_{0}:FILEPATH={1}'.format(( '-DJASPER_LIBRARY_{0}:FILEPATH={1}'.format((
'DEBUG' if '+debug' in spec else 'RELEASE'), 'DEBUG' if '+debug' in spec else 'RELEASE'),
join_path(jasper.prefix.lib, join_path(jasper.prefix.lib,