| 142 | end |
| 143 | |
| 144 | def register_file(sources_cmake, filename) |
| 145 | contentsArray = File.readlines(sources_cmake) |
| 146 | |
| 147 | block = false |
| 148 | insert_idx = -1 |
| 149 | contentsArray.each_with_index {|val, index| |
| 150 | if block |
| 151 | if val.chop().strip == ")" |
| 152 | insert_idx = index |
| 153 | break |
| 154 | end |
| 155 | else |
| 156 | if val.chop().strip == "set(sources_list" or val.chop().strip == "set(sources_list_h" |
| 157 | block = true |
| 158 | end |
| 159 | end |
| 160 | } |
| 161 | |
| 162 | contentsArray.insert(insert_idx, filename) |
| 163 | File.open(sources_cmake, 'w') do |file| |
| 164 | file.puts contentsArray |
| 165 | end |
| 166 | end |
| 167 | |
| 168 | def register(openms_path, lib_name, path, clazz) |
| 169 | include_cmake = "#{openms_path}/src/#{lib_name}/include/OpenMS/#{path}/sources.cmake" |