diff --git a/var/spack/repos/builtin/packages/opencv/package.py b/var/spack/repos/builtin/packages/opencv/package.py index 13d57d9163..bc04be8a31 100644 --- a/var/spack/repos/builtin/packages/opencv/package.py +++ b/var/spack/repos/builtin/packages/opencv/package.py @@ -87,7 +87,10 @@ def install(self, spec, prefix): '-DWITH_QT:BOOL=%s' % ('ON' if '+qt' in spec else 'OFF'), '-DWITH_VTK:BOOL=%s' % ('ON' if '+vtk' in spec else 'OFF')]) - if '^gtkplus@3:' in spec: + if '+gtk' not in spec: + cmake_options.extend(['-DWITH_GTK:BOOL=OFF', + '-DWITH_GTK_2_X:BOOL=OFF']) + elif '^gtkplus@3:' in spec: cmake_options.extend(['-DWITH_GTK:BOOL=ON', '-DWITH_GTK_2_X:BOOL=OFF']) elif '^gtkplus@2:3' in spec: