[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:28:00 EST 2014


2014-12-19 11:25 GMT+01:00 Eric Noulard <eric.noulard at gmail.com>:
>
>
>
> 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)
>

see documentations of CPACK_XXX vars:

http://www.cmake.org/cmake/help/v3.0/module/CPack.html?highlight=cpack_package_description#variable:CPACK_PACKAGE_DESCRIPTION_FILE

-- 
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/fa777adf/attachment.html>


More information about the CMake mailing list