2016-02-01 12:43:26 +00:00
|
|
|
# frozen_string_literal: true
|
2013-10-16 22:37:39 +00:00
|
|
|
require 'rubygems/command'
|
|
|
|
|
2012-12-10 00:40:39 +00:00
|
|
|
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
|
2013-11-19 00:34:13 +00:00
|
|
|
def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil)
|
2012-12-10 00:40:39 +00:00
|
|
|
unless File.exist?('Makefile') then
|
|
|
|
cmd = "cmake . -DCMAKE_INSTALL_PREFIX=#{dest_path}"
|
|
|
|
cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty?
|
|
|
|
|
|
|
|
run cmd, results
|
|
|
|
end
|
|
|
|
|
|
|
|
make dest_path, results
|
|
|
|
|
|
|
|
results
|
|
|
|
end
|
|
|
|
end
|