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

Eric Noulard eric.noulard at gmail.com
Fri Dec 19 05:25:58 EST 2014


2014-12-19 11:22 GMT+01:00 Petr Bena <benapetr at gmail.com>:
>
> 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?
>

You can use CPACK_PACKAGE_DESCRIPTION_FILE instead of
CPACK_PACKAGE_DESCRIPTION
i.e.

set(CPACK_PACKAGE_DESCRIPTION_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/build/summary)



> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>


-- 
Eric
L'élection n'est pas la démocratie -- http://www.le-message.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20141219/520f818b/attachment-0001.html>


More information about the CMake mailing list