本文整理汇总了Python中cmakefile_editor.CMakeFileEditor.remove_double_newlines方法的典型用法代码示例。如果您正苦于以下问题:Python CMakeFileEditor.remove_double_newlines方法的具体用法?Python CMakeFileEditor.remove_double_newlines怎么用?Python CMakeFileEditor.remove_double_newlines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmakefile_editor.CMakeFileEditor
的用法示例。
在下文中一共展示了CMakeFileEditor.remove_double_newlines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _add_qa36
# 需要导入模块: from cmakefile_editor import CMakeFileEditor [as 别名]
# 或者: from cmakefile_editor.CMakeFileEditor import remove_double_newlines [as 别名]
def _add_qa36():
" Add C++ QA files for pre-3.7 API (not autotools) "
fname_qa_cc = 'qa_%s.cc' % self._info['fullblockname']
self._write_tpl('qa_cpp36', 'lib', fname_qa_cc)
if not self.options.skip_cmakefiles:
open(self._file['cmlib'], 'a').write(
str(
Cheetah.Template.Template(
Templates['qa_cmakeentry36'],
searchList={'basename': os.path.splitext(fname_qa_cc)[0],
'filename': fname_qa_cc,
'modname': self._info['modname']
}
)
)
)
ed = CMakeFileEditor(self._file['cmlib'])
ed.remove_double_newlines()
ed.write()
示例2: _run_lib
# 需要导入模块: from cmakefile_editor import CMakeFileEditor [as 别名]
# 或者: from cmakefile_editor.CMakeFileEditor import remove_double_newlines [as 别名]
def _run_lib(self):
""" Do everything that needs doing in the subdir 'lib' and 'include'.
- add .cc and .h files
- include them into CMakeLists.txt
- check if C++ QA code is req'd
- if yes, create qa_*.{cc,h} and add them to CMakeLists.txt
"""
print "Traversing lib..."
fname_h = self._info['fullblockname'] + '.h'
fname_cc = self._info['fullblockname'] + '.cc'
if self._info['blocktype'] in ('source', 'sink', 'sync', 'decimator',
'interpolator', 'general', 'hiercpp'):
self._write_tpl('block_h', 'include', fname_h)
self._write_tpl('block_cpp', 'lib', fname_cc)
elif self._info['blocktype'] == 'impl':
self._write_tpl('impl_h', 'include', fname_h)
self._write_tpl('impl_cpp', 'lib', fname_cc)
if not self.options.skip_cmakefiles:
ed = CMakeFileEditor('lib/CMakeLists.txt')
ed.append_value('add_library', fname_cc)
ed.write()
ed = CMakeFileEditor('include/CMakeLists.txt', '\n ')
ed.append_value('install', fname_h, 'DESTINATION[^()]+')
ed.write()
if not self._add_cc_qa:
return
fname_qa_cc = 'qa_%s' % fname_cc
self._write_tpl('qa_cpp', 'lib', fname_qa_cc)
if not self.options.skip_cmakefiles:
open('lib/CMakeLists.txt', 'a').write(Template.substitute(Templates['qa_cmakeentry'],
{'basename': os.path.splitext(fname_qa_cc)[0],
'filename': fname_qa_cc,
'modname': self._info['modname']}))
ed = CMakeFileEditor('lib/CMakeLists.txt')
ed.remove_double_newlines()
ed.write()