How to split strings across multiple lines in CMake?

后端 未结 7 1598
花落未央
花落未央 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:20

    Update for CMake 3.0 and newer :

    line continuation is possible with \. see cmake-3.0-doc

    message("\
    This is the first line of a quoted argument. \
    In fact it is the only line but since it is long \
    the source code uses line continuation.\
    ")
    

    Availability of CMake versions:

    Debian Wheezy (2013): 2.8.9
    Debian Wheezy-backports: 2.8.11
    Debian Jessy (2015): 3.0.2
    Ubuntu 14.04 (LTS): 2.8.12
    Ubuntu 15.04 : 3.0.2
    Mac OSX : cmake-3 available through Homebrew, Macports and Fink
    Windows: cmake-3 available through Chocolatey

提交回复
热议问题