[CMake] Getting empty package with CPack

Tim Gallagher tim.gallagher at gatech.edu
Wed Mar 11 16:17:52 EDT 2015


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.

Thanks,

Tim

------------------------------------------

cmake_minimum_required(VERSION 2.8.6)

project(LESLIE)

...

set(LESLIE_MAJOR_VERSION GTR2)
set(LESLIE_MINOR_VERSION 0)
set(LESLIE_PATCH_VERSION 4)

...

install(FILES ${PROJECT_BINARY_DIR}/run_leslie.py DESTINATION ${CMAKE_INSTALL_PREFIX}
        PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
        WORLD_READ WORLD_EXECUTE)
   
install(FILES ${PROJECT_BINARY_DIR}/run_leslie.sh DESTINATION
   ${CMAKE_INSTALL_PREFIX})
   
install(TARGETS leslie
   RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})

set(CPACK_GENERATOR "STGZ")
set(CPACK_INSTALL_CMAKE_PROJECTS "${PROJECT_BINARY_DIR};LESLIE;ALL;/bin")
set(CPACK_PACKAGE_VERSION_MAJOR ${LESLIE_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LESLIE_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LESLIE_PATCH_VERSION})
set(CPACK_PACKAGE_VENDOR "Computational Combustion Laboratory")
include(CPack)


More information about the CMake mailing list