Is there any way to comment a block in CMake in notepad++ editor?
I have tried searching on Google, but couldn't find much.
Help is needed! Thanks,
As of CMake 3.0 there is a special syntax for block comments which start with #[[
and ends with ]]
at the end of block comment. See CMake documentation for further explanation.
You can also put a number of equal signs between the brackets as long as the number between the opening [[
and closing ]]
are both the same. Ex.
#[===[
hello
]] <- this is not the closing
]===]
# ^ this is the closing
Some editors and IDEs do not support it yet.
if(FALSE) # fake a block comment
endif()
Since CMake version 3.0 there are block comments.
Example from the CMake manual:
#[[This is a bracket comment.
It runs until the close bracket.]]
message("First Argument\n" #[[Bracket Comment]] "Second Argument")
There is no notion of a block comment in CMake syntax. However, to comment several lines at once, select the required lines and hit CTRL+Q.
If the file is a .txt file (e.g. CMakeLists.txt), you can either set Notepad++ to always treat .txt files as CMake files (in Settings -> Style configurator select CMakeFile and add " txt" to "User ext.") or for just that file you can set the Language to CMake.