[CMake] install() rename with version string

Hendrik Sattler post at hendrik-sattler.de
Thu Jan 19 11:02:32 EST 2017



Am 19. Januar 2017 15:26:47 MEZ schrieb "Gonzalo Garramuño" <ggarra13 at gmail.com>:
>
>
>El 19/01/17 a las 05:30, Wagner Martin escribió:
>>
>> However, CMake needs to include version.cmake at first CMake run
>time, 
>> which is not possible because it’s a generated file.
>>
>> Is there any other way to do the rename?
>>
>>
>You will need to do the install as another target/command.  For
>example:
>
>add_custom_command( TARGET version
>                                         POST_BUILD
>                                         COMMAND ${CMAKE_COMMAND} -D 
>VERSION=${version_string}
>                                         -P install_commands.cmake
>                                         USES_TERMINAL )

Or even simpler, do all of that in the install_commands.cmake by using install(CODE) AND escaping the $.
Just looking at the generated install_commands.cmake will make this much clearer.

HS

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.


More information about the CMake mailing list