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

Ian Monroe ian at monroe.nu
Sun Jan 20 18:44:02 EST 2013


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.

Ian


More information about the CMake mailing list