Class: Rbind::GeneratorC::CMakeListsHelper
- Inherits:
-
HelperBase
- Object
- HelperBase
- Rbind::GeneratorC::CMakeListsHelper
- Defined in:
- lib/rbind/generator_c.rb
Instance Attribute Summary
Attributes inherited from HelperBase
Instance Method Summary collapse
- #find_packages ⇒ Object
-
#initialize(name, pkg_config = Array.new, libs = Array.new) ⇒ CMakeListsHelper
constructor
A new instance of CMakeListsHelper.
- #library_name ⇒ Object
- #libs ⇒ Object
Methods inherited from HelperBase
Constructor Details
#initialize(name, pkg_config = Array.new, libs = Array.new) ⇒ CMakeListsHelper
261 262 263 264 265 |
# File 'lib/rbind/generator_c.rb', line 261 def initialize(name,pkg_config=Array.new,libs=Array.new) super(name,pkg_config) @libs = libs @find_package = ERB.new(File.open(File.join(File.dirname(__FILE__),"templates","c","find_package.txt")).read) end |
Instance Method Details
#find_packages ⇒ Object
267 268 269 270 271 |
# File 'lib/rbind/generator_c.rb', line 267 def find_packages @root.map do |pkg| @find_package.result(pkg.instance_eval("binding")) end.join("") end |
#library_name ⇒ Object
280 281 282 |
# File 'lib/rbind/generator_c.rb', line 280 def library_name name end |
#libs ⇒ Object
273 274 275 276 277 278 |
# File 'lib/rbind/generator_c.rb', line 273 def libs str = @root.map do |pkg| "${#{pkg.upcase}_LIBS} ${#{pkg.upcase}_LDFLAGS}" end.join(" ") str += " " + @libs.join(" ") end |