How to split strings across multiple lines in CMake?

后端 未结 7 1553
花落未央
花落未央 2021-01-06 19:03

I usually have a policy in my project, to never create lines in text files that exceed a line length of 80, so they are easily editable in all kinds of editors (you know the

相关标签:
7条回答
  • 2021-01-06 19:43

    To maintain good indentation in your code it's straightforward enough just to do

    message("These strings " "will all be "
            "concatenated. Don't forget "
            "your trailing spaces!")
    

    Or form a string directly with

    string(CONCAT MYSTR "This and " "that "
                        "and me too!")
    

    as in Douglas' answer who has more details. However I thought this might just summarise the essential point.

    0 讨论(0)
提交回复
热议问题