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

Eric Noulard eric.noulard at gmail.com
Mon Jan 21 02:46:51 EST 2013


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

> On Sun, Jan 20, 2013 at 1:03 PM, Eric Noulard <eric.noulard at gmail.com>
> wrote:
> >
> > "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.
>
> It doesn't seem to work. CMAKE_INSTALL_PREFIX during CPack/RPM time is
> apparently being set to CPACK_PACKAGING_INSTALL_PREFIX, ie a directory
> that doesn't exist since it's just for the resulting RPM. (Unless
> CPack is running inside a chroot of it's own making at that point??)
>
>
> So with something like this in the strip-all-installed-files.cmake
> script being executed via install(SCRIPT...):
> execute_process(COMMAND ls ${CMAKE_INSTALL_PREFIX} OUTPUT_VARIABLE
> lsresults)
>
> I get an error that the directory doesn't exist.
>

Right I forgot one important bit, CPack plays with CMAKE_INSTALL_PREFIX and
DESTDIR

could you try that:

execute_process(COMMAND ls $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}
OUTPUT_VARIABLE lsresults)

-- 
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/20130121/23bb1d00/attachment-0001.htm>


More information about the CMake mailing list