Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Community
Community
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • CMake
  • CommunityCommunity
  • Wiki
  • Home

Home

Last edited by Jamie Smith Sep 03, 2018
Page history

CMake Community Wiki

Welcome to the CMake community wiki! Anyone is welcome to sign in, request access to this wiki using the button on this page, and contribute new pages or updates to existing pages. Please follow the Editing Guidelines.

Please note that not all pages are maintained. Material on some pages may be deprecated or considered bad practice. Other pages may cover long-outdated material but are kept for historical reference. Updates are welcome on all pages, even if just to identify their status.

See the official CMake Documentation for authoritative reference material maintained by CMake developers and contribuors.

This wiki contains pages on all CMake-related tools including:

  • CMake
  • CTest
  • CPack

CMake

Primary Resources - Look here first!

  • Where can I download CMake?
  • CMake Documentation
  • CMake Variables
  • Structure of a CMake Build System
  • FAQ (Frequently asked questions)
  • CMake Mailing List (for searchable archives see CMake FAQ)
  • Release Notes

Reference Material

  • CMake Variables
  • List of CMake Properties

The CMake Language

  • A quick introduction to CMake syntax
  • On variables, lists, strings, maps, regexps, etc.
  • Language syntax

Guides

General

  • Cross compiling
  • How to write platform checks with CMake
  • How to find libraries
  • How to install things

Specific

  • RPATH handling
  • Editors/IDEs with CMake syntax support
  • How to export symbols from a Windows DLL for the non-Windows Developer
  • Appending the SO version to DLLs
  • Advanced Usage of CMake Build Rules
  • How to Check the Current Platform

Development Topics

  • Assembler Support
  • Docs for Specific Project Generators (Eclipse, KDevelop3, CodeBlocks, Makefile)
  • Contributed macros
  • Module Maintainers
  • Platform Dependent Information
  • Documentation for previous releases
  • CMake Life Cycle Considerations
  • Matrix for checking backwards-compatibility of current features
  • CMake builtin documentation handling
  • The architecture of Open Source Applications - CMake

Tutorials

Basic Introductions

  • A Simple CMake Example
  • Cross-Platform Software Development Using CMake
  • CMake: The Cross Platform Build System
  • "Learning CMake"
    • Slides of a CMake workshop, including CPack, CTest and CDash
  • CMake tutorial - Slides (with LaTeX bearmer source) of a CMake tutorial including CPack, CTest.
  • "CMake: Behind the Scenes of Code Development"
    • Slides of an introductory talk/tutorial about CMake and its benefits
  • The Hacker Within: Build Systems Explains why and how to use build systems with a CMake example.
  • How CMake simplifies the build process by Bruno Abinader
    • Part 1 - Basic build system
    • Part 2 - Advanced build system
  • Empirical approach to CMAKE by Rachid Koucha
  • Minimal examples (wiki page)

Finding stuff and platform checking

  • How to package your project for use by others, create FooConfig.cmake files, and exporting and importing targets.
  • How to find and use existing frameworks on OS X A quick example to help OS X users find frameworks automatically.

How to use CMake with specific Libraries

  • How to build Qt4 software with CMake
  • Qt with CMake Explains how to use CMake to build software with Qt4, Qt3 and KDE3.
  • Deploying Qt4 applications with CMake Explains how to use the DeployQt4.cmake module coming with CMake 2.8.7.
  • How to build KDE4 software with CMake
  • How to use CMake to create Matlab MEX files Describes how to use CMake when developing Matlab Executable (MEX) files for use with The Mathworks Matlab scripting language.
  • How to use CMake for building software with wxWidgets
  • Building eCos applications with CMake
  • Building Sms applications with CMake
  • Cross compiling from Windows to ARM Linux
  • Using CMake to build an FLTK application

Recipes

  • How to process lots of input files with a processor built by CMake
  • Configuration Specific Settings for Visual Studio Generated Project Files
  • How to use the 'BundleUtilities' to deploy your OS X Application. Example uses Qt 4.
  • How to write a simple CMakeLists.txt for Fortran code
  • How to emulate GNU Autotools 'make check'
  • A toy model for add_custom_command and add_custom_target
  • Working with OS X Interface Builder Files
  • Append the Version Number to the Install path
  • Install to a local folder in the build dir for testing
  • Adding an uninstall target to your project

Converters from other buildsystems to CMake

All converters listed here are not "complete", i.e. the generated CMake files are not 100% finished, in all cases some work is left for the developer.

automake/autotools/autoconf

  • am2cmake (requires Ruby) Converts automake/autotools/libtool based projects to CMake, specialized in converting from KDE 3 to KDE 4, should also work for others. This one has been used for converting the KDE buildsystem to CMake.
  • Alternative Automake2CMake (requires PHP) Converts KDevelop projects that use automake to CMake.
  • Converting autoconf tests

qmake

  • qmake converter (requires Ruby) Converts projects that use Qt's qmake.

Visual Studio

  • vcproj2cmake.rb (requires Ruby) SourceForge project Creates and maintains CMakeLists.txt files by extracting info from Visual Studio project files (.vcproj/.vcxproj). Elaborate script for development side-by-side the updated original static .vc[x]proj files, supports script hooks and powerful definition mappings. Patches and new project members very welcome. Older script versions below:
    • Original vcproj2cmake.rb version (requires Ruby)
    • Slightly newer version here vcproj2cmake.rb.
  • vcproj2cmake.ps1(PowerShell version) Creates CMakeLists.txt. it supports vcproj configuration and detect 'exclude from build' option
  • folders4cmake (requires Java) Use Visual Studio project files to generate corresponding "source_group" information that you can use inside your own CMake scripts. Supports Visual Studio 9/10 project files (full round-trip possible).

Basic CMakeLists.txt from-scratch-generator

  • gencmake (requires Ruby) Creates basic CMakeLists.txt files from looking at the existing files.
  • CMakeListGenerator (Win32) Creates complete CMakeLists.txt files as described in the README using a combination of file and directory structure analysis. Supports resolving dependencies between multiple archives.

Success Stories

  • What are some projects using CMake?
  • Articles about CMake
  • Really Cool CMake Features

More Topics

  • Fortran Issues
  • Generating dependency graphs with CMake
  • Experiments With Lua
  • Performance Tips
  • GNU style directory layout with CMake
  • CMake TODO
  • Creating Qt Assistant Docs
  • Writing FindXXX.cmake modules that work with static libraries
  • Writing FindXXX.cmake modules that work when multiple versions of packages are installed
  • CMake:Improving_Find*_Modules
  • CMake/C_Plugins_for_Loadable_Commands For anyone who wonders what the load_command command is for.
  • PC-Lint support for CMake

CTest

Tutorials

  • Testing With CTest Introduces to testing with CTest, submitting dashboards, and using CMake to add tests to the test system.
  • CTest Scripting Describes the scripting with CTest which can significantly simplify and automate testing and submitting dashboards.
  • Generating Input Files For CTest Describe more in details the concepts behind testing with CTest and also explans how to use CTest without using CMake.
  • Buildmanagement With CTest Describes how to setup a central configuration for all CTest scripts.

More Information

  • Configuring CTest Submission Methods
  • CTest Nightly, Experimental, Continuous, ...
  • CTest/Coverage
  • CTest_Running_Modes.pdf
  • CTest Frequently asked questions

More Topics

  • CTest TODO
  • Run tests on machines without building first

CDash

  • CDash Wiki.
  • CDash FAQ.

CPack

Tutorials

  • Packaging with CPack Introduction to CPack, installing and packaging of software.
  • CMake tutorial - Slides from a CMake tutorial (including LaTeX beamer source) including CPack.
  • CPack Variables
  • Supported package formats
  • CPack Win32 Newbie Checklist
  • Component Install With CPack
  • List of CPack Generators

Recipes

  • Add an application shortcut to the Start Menu

Old(deprecated) kept for reference only

  • CMake 2.6 Notes
  • Useful CMake Variables

This page was initially populated by conversion from its original location in another wiki.

Clone repository
  • Contrib
  • Editing Guidelines
  • FAQ
  • Home
  • contrib/macros
    • AddCxxTest
    • CompareVersionStrings
    • CopyIfDifferent
    • CreateFinalFile
    • FilterOut
    • ForceAddFlags
    • GatherProjectFiles
    • GenerateProject
    • LibtoolFile
    • ListOperations
    • Merge
More Pages

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.