Differences between revisions 5 and 7 (spanning 2 versions)
Revision 5 as of 2016-08-23 22:06:49
Size: 1240
Editor: SamatJain
Comment:
Revision 7 as of 2016-10-19 06:33:40
Size: 1398
Editor: SamatJain
Comment:
Deletions are marked like this. Additions are marked like this.
Line 26: Line 26:
== Good examples ==

https://github.com/videolan/x265
Line 30: Line 34:
[[http://stackoverflow.com/a/26038443/14878|Difference between PRIVATE, PUBLIC, and INTERFACE]]

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...

Good examples

https://github.com/videolan/x265

Create dlls on Windows without declspec() using new CMake export all feature: have CMake already export symbols for DLLs.

Difference between PRIVATE, PUBLIC, and INTERFACE


CategoryCheatSheet

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