[CMake] Getting empty package with CPack

Nils Gladitz nilsgladitz at gmail.com
Wed Mar 11 18:32:24 EDT 2015


On 11.03.2015 21:17, Tim Gallagher wrote:
> Hi all,
>
> I'm trying to play with CPack to build an installer for our code and I'm pretty confused. I am using the self-extracting TGZ generator on CMake 2.8.8. My CMakeLists.txt is really long, but I included what I think are the important parts under my signature.
>
> I configure the build and the package target shows up which is great. I can see in the CPackConfig.cmake file that my variables are set the same as they were in my CMakeLists.txt. When I run 'make package', it generates my .sh file. But then when I run the extractor, it just creates an empty folder. I would have expected it to create `<package name>/bin/leslie.x`, `<package name>/bin/run_leslie.py` and `<package name>/bin/run_leslie.sh`.
>
> I also tried it with the CPACK_INSTALL_CMAKE_PROJECTS set to "${PROJECT_BINARY_DIR};LESLIE;leslie;/bin" but to no avail.
>
> Does anybody have any suggestions on why my files aren't getting packaged? I know the CMakeLists.txt prior to the CPack commands work, but this is my first go at using CPack.

Try with relative install destinations e.g. "DESTINATION ." instead of 
"DESTINATION ${CMAKE_INSTALL_PREFIX}".
Relative paths are already relative to CMAKE_INSTALL_PREFIX by default 
where appropriate and many CPack generators can not handle absolute paths.

Nils


More information about the CMake mailing list