* Use libs[0] and headers.directories[0] instead of hardcoded paths in opencv dependencies * Fix library finding in libjpeg-turbo * Use build_type=Debug instead of +debug to determine build_type
This commit is contained in:
parent
54201e3c02
commit
f2eb71ca20
@ -49,6 +49,10 @@ class LibjpegTurbo(Package):
|
||||
depends_on("nasm", type='build')
|
||||
depends_on('cmake', type='build', when="@1.5.90:")
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
return find_libraries("libjpeg*", root=self.prefix, recursive=True)
|
||||
|
||||
@when('@:1.5.3')
|
||||
def install(self, spec, prefix):
|
||||
configure('--prefix=%s' % prefix)
|
||||
|
@ -219,50 +219,49 @@ def cmake_args(self):
|
||||
zlib = spec['zlib']
|
||||
args.extend([
|
||||
'-DZLIB_LIBRARY_{0}:FILEPATH={1}'.format((
|
||||
'DEBUG' if '+debug' in spec else 'RELEASE'),
|
||||
join_path(zlib.prefix.lib,
|
||||
'libz.{0}'.format(dso_suffix))),
|
||||
'-DZLIB_INCLUDE_DIR:PATH={0}'.format(zlib.prefix.include)
|
||||
'DEBUG' if 'build_type=Debug' in spec else 'RELEASE'),
|
||||
zlib.libs[0]),
|
||||
'-DZLIB_INCLUDE_DIR:PATH={0}'.format(
|
||||
zlib.headers.directories[0])
|
||||
])
|
||||
|
||||
if '+png' in spec:
|
||||
libpng = spec['libpng']
|
||||
args.extend([
|
||||
'-DPNG_LIBRARY_{0}:FILEPATH={1}'.format((
|
||||
'DEBUG' if '+debug' in spec else 'RELEASE'),
|
||||
join_path(libpng.prefix.lib,
|
||||
'libpng.{0}'.format(dso_suffix))),
|
||||
'-DPNG_INCLUDE_DIR:PATH={0}'.format(libpng.prefix.include)
|
||||
'DEBUG' if 'build_type=Debug' in spec else 'RELEASE'),
|
||||
libpng.libs[0]),
|
||||
'-DPNG_INCLUDE_DIR:PATH={0}'.format(
|
||||
libpng.headers.directories[0])
|
||||
])
|
||||
|
||||
if '+jpeg' in spec:
|
||||
libjpeg = spec['jpeg']
|
||||
args.extend([
|
||||
'-DBUILD_JPEG:BOOL=OFF',
|
||||
'-DJPEG_LIBRARY:FILEPATH={0}'.format(
|
||||
join_path(libjpeg.prefix.lib,
|
||||
'libjpeg.{0}'.format(dso_suffix))),
|
||||
'-DJPEG_INCLUDE_DIR:PATH={0}'.format(libjpeg.prefix.include)
|
||||
'-DJPEG_LIBRARY:FILEPATH={0}'.format(libjpeg.libs[0]),
|
||||
'-DJPEG_INCLUDE_DIR:PATH={0}'.format(
|
||||
libjpeg.headers.directories[0])
|
||||
])
|
||||
|
||||
if '+tiff' in spec:
|
||||
libtiff = spec['libtiff']
|
||||
args.extend([
|
||||
'-DTIFF_LIBRARY_{0}:FILEPATH={1}'.format((
|
||||
'DEBUG' if '+debug' in spec else 'RELEASE'),
|
||||
join_path(libtiff.prefix.lib,
|
||||
'libtiff.{0}'.format(dso_suffix))),
|
||||
'-DTIFF_INCLUDE_DIR:PATH={0}'.format(libtiff.prefix.include)
|
||||
'DEBUG' if 'build_type=Debug' in spec else 'RELEASE'),
|
||||
libtiff.libs[0]),
|
||||
'-DTIFF_INCLUDE_DIR:PATH={0}'.format(
|
||||
libtiff.headers.directories[0])
|
||||
])
|
||||
|
||||
if '+jasper' in spec:
|
||||
jasper = spec['jasper']
|
||||
args.extend([
|
||||
'-DJASPER_LIBRARY_{0}:FILEPATH={1}'.format((
|
||||
'DEBUG' if '+debug' in spec else 'RELEASE'),
|
||||
join_path(jasper.prefix.lib,
|
||||
'libjasper.{0}'.format(dso_suffix))),
|
||||
'-DJASPER_INCLUDE_DIR:PATH={0}'.format(jasper.prefix.include)
|
||||
'DEBUG' if 'build_type=Debug' in spec else 'RELEASE'),
|
||||
jasper.libs[0]),
|
||||
'-DJASPER_INCLUDE_DIR:PATH={0}'.format(
|
||||
jasper.headers.directories[0])
|
||||
])
|
||||
|
||||
# GUI
|
||||
|
Loading…
Reference in New Issue
Block a user