Class: Rbind::GeneratorC::CMakeListsHelper
Instance Attribute Summary
Attributes inherited from HelperBase
#extern_types, #includes, #name
Instance Method Summary
collapse
Methods inherited from HelperBase
#binding, #wrap_includes
Constructor Details
#initialize(name, lib_name, pkg_config = Array.new, libs = Array.new, ruby_path) ⇒ CMakeListsHelper
Returns a new instance of CMakeListsHelper.
307
308
309
310
311
312
313
|
# File 'lib/rbind/generator_c.rb', line 307
def initialize(name,lib_name,pkg_config=Array.new,libs=Array.new,ruby_path)
super(name,pkg_config)
@libs = libs
@library_name = lib_name
@find_package = ERB.new(File.open(File.join(File.dirname(__FILE__),"templates","c","find_package.txt")).read)
@ruby_path = ruby_path
end
|
Instance Method Details
#find_packages ⇒ Object
319
320
321
322
323
|
# File 'lib/rbind/generator_c.rb', line 319
def find_packages
@root.map do |pkg|
@find_package.result(pkg.instance_eval("binding"))
end.join("")
end
|
#library_name ⇒ Object
332
333
334
|
# File 'lib/rbind/generator_c.rb', line 332
def library_name
@library_name
end
|
#libs ⇒ Object
325
326
327
328
329
330
|
# File 'lib/rbind/generator_c.rb', line 325
def libs
str = @root.map do |pkg|
"${#{pkg.upcase}_LIBS} ${#{pkg.upcase}_LDFLAGS_OTHER}"
end.join(" ")
str += " " + @libs.join(" ")
end
|
#ruby_path ⇒ Object
315
316
317
|
# File 'lib/rbind/generator_c.rb', line 315
def ruby_path
@ruby_path
end
|