View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006103CMakeCMakepublic2007-11-30 16:382010-12-14 18:49
ReporterBaron Roberts 
Assigned ToDavid Cole 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006103: ADD_CUSTOM_TARGET and/or INSTALL needs a POST_INSTALL attribute
DescriptionThere are commands that need to be run after an INSTALL (e.g. stripping binaries). Currently this can only be accomplished using the INSTALL(CODE... or INSTALL(SCRIPT... commands. While this can be made to work, it is very clumsy and arcane because the DESTDIR environment variable needs to be taken into account. To perform a simple stripping of an installed executable one needs to write something like:

install(CODE "EXECUTE_PROCESS(COMMAND ${ARM-STRIP} --strip-all \$ENV{DESTDIR}${INSTALL_PREFIX}/bin/${target})")

At first the POST_BUILD attribute on ADD_CUSTOM_TARGET looks promising but it is not run after an install relink. So the best solution would be to provide either a POST_INSTALL attribute on ADD_CUSTOM_TARGET and/or on INSTALL. In addition, it would be very helpful to have a variable that reflects the true installation directory (i.e. with DESTDIR factored in).
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0019002)
David Cole (manager)
2009-12-28 15:44

The install(CODE or install(SCRIPT commands are the correct way to achieve this goal.

The recommended "POST_INSTALL attribute" would have the same code as an install(CODE or install(SCRIPT command, so how would it be any less clumsy or arcane?
(0024050)
David Cole (manager)
2010-12-14 18:49

Closing bugs that have been resolved for more than 3 months without any further updates.

 Issue History
Date Modified Username Field Change
2007-11-30 16:38 Baron Roberts New Issue
2007-12-14 20:34 Bill Hoffman Status new => assigned
2007-12-14 20:34 Bill Hoffman Assigned To => David Cole
2009-12-28 15:44 David Cole Note Added: 0019002
2009-12-28 15:44 David Cole Status assigned => resolved
2009-12-28 15:44 David Cole Resolution open => no change required
2010-12-14 18:49 David Cole Note Added: 0024050
2010-12-14 18:49 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team