Class: Ritsu::SrcFiles::TargetCmakeLists::InstallTemplate
- Defined in:
- lib/ritsu/src_files/target_cmake_lists.rb
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Attributes included from BlockMixin
#contents, #id, #indent_length, #indent_level, #local_indentation
Instance Method Summary collapse
-
#initialize(target) ⇒ InstallTemplate
constructor
A new instance of InstallTemplate.
- #update_block(block, options = {}) ⇒ Object
Methods inherited from Template
#add_content, #add_template, #child_template_with_id, #child_template_with_id_position, #child_templates, #create_block
Methods included from BlockMixin
#add_line, #add_new_line, #block_structure?, #clear_contents, #indent, #initialize_block_mixin, #outdent
Constructor Details
#initialize(target) ⇒ InstallTemplate
Returns a new instance of InstallTemplate.
122 123 124 125 126 |
# File 'lib/ritsu/src_files/target_cmake_lists.rb', line 122 def initialize(target) super("TargetCmakeLists -- #{target.name} -- Install") @target = target end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
120 121 122 |
# File 'lib/ritsu/src_files/target_cmake_lists.rb', line 120 def target @target end |
Instance Method Details
#update_block(block, options = {}) ⇒ Object
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/ritsu/src_files/target_cmake_lists.rb', line 128 def update_block(block, = {}) block.contents.clear if target.install? block.add_line "INSTALL(TARGETS #{target.name}" block.add_line " RUNTIME DESTINATION bin" block.add_line " LIBRARY DESTINATION lib" block.add_line ")" end end |