opencv : Fix python extensions issues
This commit is contained in:
parent
9e1d26e973
commit
cf0f5756f5
1 changed files with 15 additions and 0 deletions
|
@ -58,6 +58,8 @@ class Opencv(Package):
|
|||
depends_on('eigen', when='+eigen')
|
||||
depends_on('cuda', when='+cuda')
|
||||
|
||||
extends('python')
|
||||
|
||||
# FIXME : GUI extensions missing
|
||||
|
||||
def install(self, spec, prefix):
|
||||
|
@ -70,6 +72,19 @@ def install(self, spec, prefix):
|
|||
'-DWITH_IPP:BOOL=%s' % ('ON' if '+ipp' in spec else 'OFF'),
|
||||
'-DWITH_CUDA:BOOL=%s' % ('ON' if '+cuda' in spec else 'OFF')])
|
||||
|
||||
python_prefix = spec['python'].prefix
|
||||
python_lib = python_prefix.lib
|
||||
if spec.satisfies('^python@3:'):
|
||||
python = join_path(python_prefix.bin, 'python3')
|
||||
cmake_options.extend(['-DBUILD_opencv_python3=ON',
|
||||
'-DPYTHON_EXECUTABLE={0}'.format(python),
|
||||
'-DPYTHON_LIBRARIES={0}'.format(python_lib)])
|
||||
elif spec.satisfies('^python@2:3'):
|
||||
python = join_path(python_prefix.bin, 'python2')
|
||||
cmake_options.extend(['-DBUILD_opencv_python2=ON',
|
||||
'-DPYTHON_EXECUTABLE={0}'.format(python),
|
||||
'-DPYTHON_LIBRARIES={0}'.format(python_lib)])
|
||||
|
||||
with working_dir('spack_build', create=True):
|
||||
cmake('..', *cmake_options)
|
||||
make('VERBOSE=1')
|
||||
|
|
Loading…
Reference in a new issue