Differences between revisions 2 and 4 (spanning 2 versions)
Revision 2 as of 2009-07-27 09:18:37
Size: 933
Editor: SamatJain
Comment:
Revision 4 as of 2010-10-22 18:50:32
Size: 965
Editor: SamatJain
Comment: Add table of contents
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
<<TableOfContents>>
Line 3: Line 5:
CMake can automatically create distribution packages (e.g. Redhat/Fedora .rpm, Debian/Ubuntu .deb, etc), though the created packages will any information on dependencies. To create these packages, add at the end of CMakeLists.txt: CMake can automatically create packages for several distributions (e.g. Redhat/Fedora .rpm, Debian/Ubuntu .deb, etc), though the created packages will lack dependency information. To create these packages, add at the end of CMakeLists.txt:

Creating distribution packages with CMake

CMake can automatically create packages for several distributions (e.g. Redhat/Fedora .rpm, Debian/Ubuntu .deb, etc), though the created packages will lack dependency information. To create these packages, add at the end of CMakeLists.txt:

   1 SET(CPACK_GENERATOR "DEB")
   2 SET(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
   3 SET(CPACK_SET_DESTDIR TRUE)
   4 SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "me")
   5 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
   6 SET(CPACK_PACKAGE_VERSION_MINOR "0")
   7 SET(CPACK_PACKAGE_VERSION_PATCH "1~alpha1")
   8 include(CPack)

Modify the variables to create an package with the appropriate name and metadata fields. After building the package, run:

   1 make package

Source: Harold Sitter's Checkinstall DEBs done the CMake way...


CategoryCheatSheet

SamatsWiki: CheatSheet/CMake (last edited 2017-08-17 00:55:15 by SamatJain)