[CMake] CPACK_STRIP_FILES not working for files not built by project

Eric Noulard eric.noulard at gmail.com
Sun Jan 20 16:03:01 EST 2013


2013/1/20 Ian Monroe <ian at monroe.nu>

> On Sun, Jan 20, 2013 at 10:47 AM, Ian Monroe <ian at monroe.nu> wrote:
> > Yea I guess I could do install(CODE...) and then a file(GLOB...) would
> > actually work.
>
> Actually not so sure how to do it, since if I write something like this:
> install( CODE "file(GLOB installedLibrares
> ${CMAKE_INSTALL_PREFIX}/lib/*.so)
>                execute_process(COMMAND strip ${installedLibrares})
>         ")
>
> It will only affect the files that were make installed, not the files
> used by CPack, correct? Since I don't know how to access those files,
> CMAKE_INSTALL_PREFIX doesn't change during CPack-time even though it
> installs somewhere else.
>

What do you mean by
"It will only affect the files that were make installed
  not the files used by CPack" ?

CPack does call "cmake -P cmake_install.cmake" so
**all files** packaged by CPack are somehow **installed** previously.

CMAKE_INSTALL_PREFIX has a CPack-time value which is set by CPack
when installing file on the CPack-private location so you should escape it
in order to prevent its evaluation at CMake-time, i.e.

install( CODE "file(GLOB installedLibrares
\${CMAKE_INSTALL_PREFIX}/lib/*.so)
               execute_process(COMMAND strip ${installedLibrares})
        ")

should work even if I'd rather create a script
"strip-all-installed-file.cmake"
and do
install(SCRIPT strip-all-installed-files.cmake)

then the content of "strip-all-installed-files.cmake" does not need
escaping.


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130120/83ad7f95/attachment.htm>


More information about the CMake mailing list