Sha256: 03778193124412cb82c93aca9a0fff6519769d6820c64066594ed99fab465e64

Contents?: true

Size: 989 Bytes

Versions: 74

Compression:

Stored size: 989 Bytes

Contents

require 'mini_portile2/mini_portile'

class MiniPortileCMake < MiniPortile
  def configure_prefix
    "-DCMAKE_INSTALL_PREFIX=#{File.expand_path(port_path)}"
  end

  def configure_defaults
    if MiniPortile.windows?
      ['-G "NMake Makefiles"']
    else
      []
    end
  end

  def configure
    return if configured?

    cache_file = File.join(tmp_path, 'configure.options_cache')
    File.open(cache_file, "w") { |f| f.write computed_options.to_s }

    execute('configure', %w(cmake) + computed_options + ["."])
  end

  def configured?
    configure = File.join(work_path, 'configure')
    makefile  = File.join(work_path, 'CMakefile')
    cache_file  = File.join(tmp_path, 'configure.options_cache')

    stored_options  = File.exist?(cache_file) ? File.read(cache_file) : ""
    current_options = computed_options.to_s

    (current_options == stored_options) && newer?(makefile, configure)
  end

  def make_cmd
    return "nmake" if MiniPortile.windows?
    super
  end
end

Version data entries

74 entries across 61 versions & 14 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.9 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.6 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
tdiary-5.1.3 vendor/bundle/ruby/2.6.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.5 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.4 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.3 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.2 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.1 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb
video_chat_get-0.1.0 vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile_cmake.rb