parameters: (self)
docstring: Installs libpng dependency.
docstring_summary: Installs libpng dependency.
docstring_tokens: Installs libpng dependency .
function: def install(self):
      """Installs libpng dependency."""
      url = 'https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz'
      path = os.path.join(cfg.src_dir, 'png.zip')
      force = self.forced()
      dl_dir = download_archive(url, path, force)
      zlib_dir = os.path.normpath(os.path.join(cfg.src_dir, 'zlib-1.2.11'))
      extra_args = [
          '-DCMAKE_POSITION_INDEPENDENT_CODE=1', '-DPNG_BUILD_ZLIB=yesplease',
          '-DZLIB_INCLUDE_DIR=' + zlib_dir
      ]
      if platform.system() == 'Windows':
        zlib_release_dir = os.path.join(zlib_dir, 'Release')
        extra_args.append('-DCMAKE_PREFIX_PATH=' + zlib_release_dir)
        extra_args.append('-DZLIB_LIBRARY=' +
                          os.path.join(zlib_release_dir, 'zlib.lib'))
      else:
        extra_args.append('-DCMAKE_PREFIX_PATH=' + zlib_dir)
        if platform.system() == 'Darwin':
          extra_args.append('-DZLIB_LIBRARY=' +
                            os.path.join(zlib_dir, 'libz.dylib'))
        else:
          extra_args.append('-DZLIB_LIBRARY=' + os.path.join(zlib_dir, 'libz.so'))
      with cwd(dl_dir):
        run_cmake(force, extra_args)
function_tokens: def install ( self ) : url = 'https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz' path = os . path . join ( cfg . src_dir , 'png.zip' ) force = self . forced ( ) dl_dir = download_archive ( url , path , force ) zlib_dir = os . path . normpath ( os . path . join ( cfg . src_dir , 'zlib-1.2.11' ) ) extra_args = [ '-DCMAKE_POSITION_INDEPENDENT_CODE=1' , '-DPNG_BUILD_ZLIB=yesplease' , '-DZLIB_INCLUDE_DIR=' + zlib_dir ] if platform . system ( ) == 'Windows' : zlib_release_dir = os . path . join ( zlib_dir , 'Release' ) extra_args . append ( '-DCMAKE_PREFIX_PATH=' + zlib_release_dir ) extra_args . append ( '-DZLIB_LIBRARY=' + os . path . join ( zlib_release_dir , 'zlib.lib' ) ) else : extra_args . append ( '-DCMAKE_PREFIX_PATH=' + zlib_dir ) if platform . system ( ) == 'Darwin' : extra_args . append ( '-DZLIB_LIBRARY=' + os . path . join ( zlib_dir , 'libz.dylib' ) ) else : extra_args . append ( '-DZLIB_LIBRARY=' + os . path . join ( zlib_dir , 'libz.so' ) ) with cwd ( dl_dir ) : run_cmake ( force , extra_args )