Differences between revisions 1 and 16 (spanning 15 versions)
Revision 1 as of 2009-07-12 04:48:55
Size: 907
Editor: SamatJain
Comment:
Revision 16 as of 2017-08-17 00:55:15
Size: 2759
Editor: SamatJain
Comment:
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:
Line 23: Line 25:

== Good examples ==

https://github.com/videolan/x265

https://github.com/Qartar/qflags/blob/master/CMakeLists.txt

== CMake, CPack, and Windows ==

Example of using WIX and CPack: https://cmaketools.codeplex.com/SourceControl/latest#CMakeLists.txt

Uses: https://cmake.org/cmake/help/latest/command/include_external_msproject.html

Installing the MS Visual Studio runtime dependencies w/ WiX:http://stackoverflow.com/questions/34592378/redistributables-for-deploying-c-exe-developed-with-visual-studio-2015-on-wind

== Tutorials ==

[[https://www.youtube.com/watch?v=bsXLMQ6WgIk|C++Now 2017: Daniel Pfeifer “Effective CMake"]]

[[https://docs.google.com/presentation/d/18fY0zDtJCMUW5WdY2ZOfKtvb7lXEbBPFe_I6MNJC0Qw/edit#slide=id.g15c79ae86d_0_55|Modern CMake]]: presentation.

== External links ==

[[https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/|Create dlls on Windows without declspec() using new CMake export all feature | The Kitware Blog]]: have CMake already export symbols for DLLs. https://gcc.gnu.org/wiki/Visibility provides an alternative.

[[http://stackoverflow.com/a/26038443/14878|Difference between PRIVATE, PUBLIC, and INTERFACE]]

[[https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/|CMake: dependencies between targets and files and custom commands | Sam Thursfield's Blog]]

[[https://svn.boost.org/trac/boost/wiki/CMakeModularizationStatus|CMakeModularizationStatus – Boost C++ Libraries]]: Building Boost w/ CMake

[[https://github.com/nerdvegas/vfxcmake|nerdvegas/vfxcmake: Cmake Find modules for common vfx software, and general Cmake utility code]]: Modules for finding Nuke's SDK, Arnold, Houdini, OpenEXR, etc.

----
CategoryCheatSheet

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

https://github.com/Qartar/qflags/blob/master/CMakeLists.txt

CMake, CPack, and Windows

Example of using WIX and CPack: https://cmaketools.codeplex.com/SourceControl/latest#CMakeLists.txt

Uses: https://cmake.org/cmake/help/latest/command/include_external_msproject.html

Installing the MS Visual Studio runtime dependencies w/ WiX:http://stackoverflow.com/questions/34592378/redistributables-for-deploying-c-exe-developed-with-visual-studio-2015-on-wind

Tutorials

C++Now 2017: Daniel Pfeifer “Effective CMake"

Modern CMake: presentation.

Create dlls on Windows without declspec() using new CMake export all feature: have CMake already export symbols for DLLs. https://gcc.gnu.org/wiki/Visibility provides an alternative.

Difference between PRIVATE, PUBLIC, and INTERFACE

CMake: dependencies between targets and files and custom commands

CMakeModularizationStatus – Boost C++ Libraries: Building Boost w/ CMake

nerdvegas/vfxcmake: Cmake Find modules for common vfx software, and general Cmake utility code: Modules for finding Nuke's SDK, Arnold, Houdini, OpenEXR, etc.


CategoryCheatSheet

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