'Populate cmake arguments for ParaView.'

def cmake_args(self):

    spec = self.spec
    def variant_bool(feature, on='ON', off='OFF'):
        'Ternary    for    spec    variant    to    ON/OFF    string'
        if (feature in spec):
            return on
        return off
    def nvariant_bool(feature):
        'Negated    ternary    for    spec    variant    to    OFF/ON    string'
        return variant_bool(feature, on='OFF', off='ON')
    rendering = variant_bool('+opengl2', 'OpenGL2', 'OpenGL')
    includes = variant_bool('+plugins')
    cmake_args = [('-DPARAVIEW_BUILD_QT_GUI:BOOL=%s' % variant_bool('+qt')), ('-DVTK_OPENGL_HAS_OSMESA:BOOL=%s' % variant_bool('+osmesa')), ('-DVTK_USE_X:BOOL=%s' % nvariant_bool('+osmesa')), ('-DVTK_RENDERING_BACKEND:STRING=%s' % rendering), ('-DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=%s' % includes), '-DBUILD_TESTING:BOOL=OFF', '-DVTK_USE_SYSTEM_FREETYPE:BOOL=ON', '-DVTK_USE_SYSTEM_HDF5:BOOL=OFF', '-DVTK_USE_SYSTEM_JPEG:BOOL=ON', '-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON', '-DVTK_USE_SYSTEM_NETCDF:BOOL=OFF', '-DVTK_USE_SYSTEM_TIFF:BOOL=ON', '-DVTK_USE_SYSTEM_ZLIB:BOOL=ON']
    if ('+qt' in spec):
        cmake_args.extend([('-DPARAVIEW_QT_VERSION=%s' % spec['qt'].version[0])])
    if ('+python' in spec):
        cmake_args.extend(['-DPARAVIEW_ENABLE_PYTHON:BOOL=ON', ('-DPYTHON_EXECUTABLE:FILEPATH=%s' % spec['python'].command.path)])
    if ('+mpi' in spec):
        cmake_args.extend(['-DPARAVIEW_USE_MPI:BOOL=ON', ('-DMPIEXEC:FILEPATH=%s/bin/mpiexec' % spec['mpi'].prefix)])
    if ('darwin' in self.spec.architecture):
        cmake_args.extend(['-DVTK_USE_X:BOOL=OFF', '-DPARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON'])
    return cmake_args
