On 26. Mar, 2010, at 9:23 , Micha Renner wrote:

> Am Freitag, den 26.03.2010, 08:33 +0100 schrieb Michael Wild:
>> On 25. Mar, 2010, at 23:41 , Hai Nguyen wrote:
>> 
>>> Hi all,
>>> 
>>> Is there a way for me to rename the executable during the install? I'm using
>>> the same CMakeList.txt to build several versions and I'd like to install
>>> them to different directories but with the version number stripped off of
>>> the executable.
>>> 
>>> Thanks,
>>> - Hai
>> 
>> I don't think there is a way of doing that. But what you can do is setting 
>> the OUTPUT_NAME and RUNTIME_OUTPUT_DIRECTORY target properties using the 
>> SET_TARGET_PROPERTIES command. This way, you can already reproduce the 
>> executable names and directory structure in the build tree.
>> 
> Maybe one can use "The PROGRAMS signature" of install
> 
> install(PROGRAMS files... DESTINATION <dir>
>          [PERMISSIONS permissions...]
>          [CONFIGURATIONS [Debug|Release|...]]
>          [COMPONENT <component>]
>          [RENAME <name>] [OPTIONAL])
> See:
> www.cmake.org/cmake/help/cmake-2-8-docs.html#command:install
> 
> Micha

This is possible using the LOCATION target property. But I think the other 
approach is cleaner and less confusing.

Michael

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to