[CMake] Simple CPack example is needed...

Dick Munroe munroe at csworks.com
Sat Oct 18 17:34:43 EDT 2008


I've gotten to the point where I need to build an installer and want to 
use CPack.  The available documentation is pretty impenetrable and I 
can't find any simple examples on the web.  I've found a bug in the 
CPack.make file shipped with CMake 2.6.2 (in the section of the file 
following the comment: Generate source file, 
CPACK_INSTALL_CMAKE_PROJECTS is clobbered by 
CPACK_SOURCE_INSTALL_CMAKE_PROJECTS which winds up generating the 
following error when I try to run make package:

Run CPack packaging tool...
CPack: Create package using PackageMaker
CPack: Install projects
CPack Error: Not enough items on list: CPACK_INSTALL_CMAKE_PROJECTS. 
CPACK_INSTALL_CMAKE_PROJECTS should hold quadruplet of install 
directory, install project name, install component, and install 
subdirectory.
CPack Error: Error when generating package:
make: *** [package] Error 1

So I "fixed" the error by using cpack_set_if_not_set to conditionally 
set CPACK_INSTALL_CMAKE_PROJECTS and I get somewhat further, but now I get:

ESPlanner Executables-cmake $ more 
_CPack_Packages/Darwin/PackageMaker/PreinstallOutput.log
# Run command: /usr/bin/make "preinstall"
# Directory: bin/ESPlanner
# Output:

So I'm got curious about what the various bits of the 
CPACK_INSTALL_CMAKE_PROJECTS are.  I've started with:

        set(
            CPACK_INSTALL_CMAKE_PROJECTS 
"bin/ESPlanner;ESPlanner-Web;WEB;/tmp/ESPlanner-install")

which got the error above, so the first argument has to be something 
like the root of the build directory.  So, I changed the directory to 
${CMAKE_HOME_DIRECTORY} and I get kits built, but I still think there is 
a bug in CPack.make.

Best,

Dick Munroe



More information about the CMake mailing list