【问题标题】:How to uncomment multiple lines of a Cmake file in notepad++? [duplicate]如何在记事本++中取消注释Cmake文件的多行? [复制]
【发布时间】:2020-12-15 08:53:59
【问题描述】:

我的 cmake 文件看起来像这样。我想用一个快捷方式取消注释第 1 到 100 行

#line1
#line2
#line3
.
.
.
#line100

build(a_library
USING
b
c)

【问题讨论】:

  • 这能回答你的问题吗? Commenting code in Notepad++ 注释和取消注释 CMake 代码与 Notepad++ 中的其他语言没有什么不同。只需使用 CTRL + SHIFT + K 键盘快捷键。

标签: cmake compilation notepad++ editor


【解决方案1】:
if(FALSE) # fake a block comment

endif()

请注意,这适用于注释掉一段有效的 CMake 代码,它不允许您在 if 块中编写纯文本

从 CMake 3.0 开始,块 cmets 有一种特殊语法,以 #[[ 开头,在块注释的末尾以 ]] 结尾。

【讨论】:

  • 这对我有用,我所做的是评论if(FALSE) # fake a block comment endif()。并取消注释if(TRUE) # fake a block comment endif()
猜你喜欢
  • 2014-03-24
  • 1970-01-01
  • 2012-04-07
  • 2014-01-15
  • 1970-01-01
  • 1970-01-01
  • 2015-12-19
  • 2023-02-11
  • 2019-08-25
相关资源
最近更新 更多