[CMake] How to use a multiline long string as a variable for CPACK_PACKAGE_DESCRIPTION_SUMMARY

Petr Bena benapetr at gmail.com
Fri Dec 19 05:22:26 EST 2014


There is this variable that cpack uses for description of package.
This description has many lines and uses special symbols, like quotes.

Putting it into a variable is extremely complex, so I would prefer to
load it from external resource. I did this:

FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/build/summary" CPACK_PACKAGE_DESCRIPTION)

following http://www.cmake.org/cmake/help/v3.0/command/file.html

the only thing that happened was that this variable expanded in
CPackConfig.cmake to a long unescaped text, that caused a syntax error
in that cmake file.

What is a correct way to do that?


More information about the CMake mailing list