Class: Rbind::GeneratorC::CMakeListsHelper

Inherits:
HelperBase
  • Object
show all
Defined in:
lib/rbind/generator_c.rb

Instance Attribute Summary

Attributes inherited from HelperBase

#includes, #name

Instance Method Summary collapse

Methods inherited from HelperBase

#binding, #wrap_includes

Constructor Details

#initialize(name, pkg_config = Array.new) ⇒ CMakeListsHelper

Returns a new instance of CMakeListsHelper.



268
269
270
271
# File 'lib/rbind/generator_c.rb', line 268

def initialize(name,pkg_config=Array.new)
    super
    @find_package = ERB.new(File.open(File.join(File.dirname(__FILE__),"templates","c","find_package.txt")).read)
end

Instance Method Details

#find_packagesObject



273
274
275
276
277
# File 'lib/rbind/generator_c.rb', line 273

def find_packages
    @root.map do |pkg|
         @find_package.result(pkg.instance_eval("binding"))
    end.join("")
end

#library_nameObject



285
286
287
# File 'lib/rbind/generator_c.rb', line 285

def library_name
    name
end

#libsObject



279
280
281
282
283
# File 'lib/rbind/generator_c.rb', line 279

def libs
    @root.map do |pkg|
        "${#{pkg.upcase}_LIBS} ${#{pkg.upcase}_LDFLAGS}"
    end.join(" ")
end