Class: Ritsu::SrcFiles::TargetCmakeLists::CudaIncludeDirectoriesTemplate
- Inherits:
-
Template
- Object
- Template
- Ritsu::SrcFiles::TargetCmakeLists::CudaIncludeDirectoriesTemplate
- Defined in:
- lib/ritsu/ext/cuda/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) ⇒ CudaIncludeDirectoriesTemplate
constructor
A new instance of CudaIncludeDirectoriesTemplate.
- #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) ⇒ CudaIncludeDirectoriesTemplate
Returns a new instance of CudaIncludeDirectoriesTemplate.
11 12 13 14 |
# File 'lib/ritsu/ext/cuda/src_files/target_cmake_lists.rb', line 11 def initialize(target) super("TargetCmakeLists -- #{target.name} -- CudaIncludeDirectories") @target = target end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
9 10 11 |
# File 'lib/ritsu/ext/cuda/src_files/target_cmake_lists.rb', line 9 def target @target end |
Instance Method Details
#update_block(block, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ritsu/ext/cuda/src_files/target_cmake_lists.rb', line 16 def update_block(block, = {}) external_libraries = target.dependency_libraries.to_a external_libraries.sort! {|x,y| x.name <=> y.name} dependency_targets = target.dependency_targets.to_a dependency_targets.sort! {|x,y| x.name <=> y.name} block.contents.clear external_libraries.each do |external_library| if external_library.cuda_depend_script.strip.length > 0 block.contents << external_library.cuda_depend_script end end dependency_targets.each do |dependency_target| if dependency_target.cuda_depend_script.strip.length > 0 block.contents << dependency_target.cuda_depend_script end end if target.library? if target.cuda_depend_script.strip.length > 0 block.contents << target.cuda_depend_script end end end |