Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Common CMake modules
CMake C Python C++ Tcl CSS Other
Latest commit c1b4c5b @rdumusc rdumusc Merge pull request #441 from hernando/doxygen_output
Do not show NAMESPACE_API macros in Doxygen output.
Failed to load latest commit information.
cpp Complement Eyescale/Lunchbox#241
icons Update icons with PD versions
util Missing update from Eyescale:master
.gitignore Update gitignore
AppleCheckOpenGL.cmake Fix apple_check_opengl (for TUIO) New global and per project test target for nightly tests.
CMakeInstallPath.cmake Subproject: bug fixes, speedups, reduced verbosity
ChoosePython.cmake Subproject: bug fixes, speedups, reduced verbosity
Common.cmake default OSX build is only x86_64
CommonApplication.cmake More speedup (~30%)
CommonCPPCTest.cmake New global and per project test target for nightly tests.
CommonCPack.cmake Fix #421
CommonCTest.cmake New global and per project test target for nightly tests.
CommonCheckTargets.cmake Fix #410: Restore API of check targets
CommonCode.cmake Subproject: bug fixes, speedups, reduced verbosity New CommonPackageConfig.cmake replaces PackageConfig.cmake
CommonDate.cmake CR #421
CommonDocumentation.cmake Do not rerun common_documentation if nothing happened
CommonGraph.cmake Tweak output of proj-png target
CommonInstall.cmake Fix typo bug
CommonLibrary.cmake fix: install copies wrongly named pdb file
CommonPackage.cmake Make missing required dependencies not FATAL_ERROR
CommonPackageConfig.cmake Fix for inclusion of CommonCPack without having used common_library.
CommonProcess.cmake Introduce and use CommonProcess
CommonQtSupport.cmake Clean COMMON_QT_SUPPORT_SOURCES variable.
CommonTarget.cmake Bring back "Name-png" target
Compiler.cmake gcc 4.7 fix
CompilerVersion.cmake Fix compatibility with CMake < 2.8.3
Coverage.cmake Make add_coverage_targets a true function.
CppcheckTargets.cmake Fix #410: Restore API of check targets
CpplintTargets.cmake Fix #410: Restore API of check targets
Doxyfile Do not show NAMESPACE_API macros in Doxygen output.
DoxygenRule.cmake Do not show NAMESPACE_API macros in Doxygen output.
Doxygit.cmake Visual tweak for BBPDocumentation
FindAIO.cmake Missing update from Eyescale:master
FindAtlas.cmake Added find script for ATLAS (optimized lapack/blas) library
FindBlueZ.cmake Add abandoned finder from Buildyard
FindBoostConfig.cmake Remove -DBOOST_TEST_DYN_LINK from all translation units
FindCBLAS.cmake Unified solution for LAPACK/CBLAS
FindCairo.cmake Add finder for Cairo library
FindDNSSD.cmake MSVC fixes: test execution, compiler flags, DNSSD finder
FindFCGI.cmake Subproject: bug fixes, speedups, reduced verbosity
FindFFMPEG.cmake Missing update from Eyescale:master
FindFlowVR.cmake Missing update from Eyescale:master
FindGLEW_MX.cmake Missing update from Eyescale:master
FindGPFS.cmake Add GPFS API finder
FindGTS.cmake Implement QUIET for GTS finder
FindLibJpegTurbo.cmake Missing update from Eyescale:master
FindMAGELLAN.cmake Fix Magellan OS X finder
FindMKL.cmake Add FindMKL script (forked from external github repository). Not yet …
FindMaya.cmake Updating the finder to look into Maya 2013 directory.
FindNumPy.cmake More silence in CMake run and finders, remove unused BuildApplication
FindOFED.cmake Implement QUIET for FindOFED
FindOpenMesh.cmake Add author/copyright
FindPoppler.cmake Subproject: bug fixes, speedups, reduced verbosity
FindPythonCython.cmake Missing update from Eyescale:master
FindPythonModule.cmake Missing update from Eyescale:master
FindPythonh5py.cmake Missing update from Eyescale:master
FindPythonnose.cmake Missing update from Eyescale:master
FindQwt.cmake Add finder Qwt library
FindRealityGrid.cmake Add RealityGrid finder
FindSLURM.cmake Missing update from Eyescale:master
FindSpatialIndex.cmake added file for libSpatialIndex
FindTuvok.cmake Fix subproject find with COMMON_SOURCE_DIR
FindUDT.cmake Implement QUIET for UDT finder
FindVRPN.cmake Denoise some finders
FindVTune.cmake More silence in CMake run and finders, remove unused BuildApplication
FindWiiuse.cmake Tweak FindWiiuse.cmake
FindXDR.cmake Add finder foro XDR library
Findcppcheck.cmake More QUIET for internal find_packages, remove obsolete GNUModules
Findcppcheck.cpp Improve cppcheck compatibility
Findcpplint.cmake Minor speedup with check targets, fix cpplint target
Findcppnetlib.cmake Restore Findcppnetlib to fix Ubuntu 14.04 build (missing CMake config…
Findgmock.cmake Adding find package support for gmock, jsoncpp, zeromq, and zeromq c+…
Findhwloc.cmake More QUIET for internal find_packages, remove obsolete GNUModules
Findjack.cmake Add jack finder for SAGE
Findleveldb.cmake Subproject: bug fixes, speedups, reduced verbosity
Findlibzmq.cmake Adding path hints to locate ZMQ when built from source in Windows.
Findlo.cmake Add lo finder for SAGE
Findrocksdb.cmake Fix rocksdb finder for newer versions
Findv4l2.cmake v4l2 & yasm finder for SAGE
Findvncserver.cmake Add vnc finder for SAGE
Findyasm.cmake v4l2 & yasm finder for SAGE
Findzeromqcpp.cmake Missing update from Eyescale:master
GetSourceFilesFromTarget.cmake Fix #410: Restore API of check targets
GitExternal.cmake Partial revert "Fix git external update in super projects"
GitInfo.cmake GitInfo: provide list of authors
GitTargets.cmake Use common naming conventions for GitTargets and remove dangerous met…
GithubInfo.cmake GithubInfo: provide main github page Introduce common_gui_application() wrapper with OSX app bundle support
InstallFiles.cmake Common adaptations for more complex projects than Hello:
InstallSymlink.cmake Install symlinks relative, not absolute
LICENSE.txt Missing update from Eyescale:master
LSBInfo.cmake Bring LSB_CODENAME back, needed for Fivox w/ broken ITK on Ubuntu trusty
LibFindMacros.cmake More silence in CMake run and finders, remove unused BuildApplication
MPI.cmake More silence in CMake run and finders, remove unused BuildApplication
MacPorts.cmake Missing update from Eyescale:master
Maturity.cmake Foundations to transform documentation repository into directory:
OSG.cmake Missing update from Eyescale:master
OSSCPack.cmake More speedup (~30%)
Portfile Fix make Macports portfilename configurable
ProjectInfo.cmake Fix MSVC build, cleanup solution folders Modifications in setup of issues link. Release preparations
StringifyShaders.cmake Fix shader stringify for real, rename to remove eq historics
SubProject.cmake Partial revert "Fix git external update in super projects"
System.cmake Subproject: bug fixes, speedups, reduced verbosity
TestCPP11.cmake Add c++11 noexcept test
TestScriptUtils.cmake Allow absolute paths for test scripts.
Ubuntu.cmake Unify ubuntu codenames in a single place
UpdateGitExternal.cmake Deprecate useless update_file
UploadPPA.cmake Quote some problematic variables, more MSVC fixes
VersionUtils.cmake Missing update from Eyescale:master
cdash.bat CDash Win32 batch script
cdash.plist Update launchctl CDash plist
clangcheckTargets.cmake Fix #410: Restore API of check targets
github.css Let users scroll the documentation TOC when it doesn't fit on the screen Fix README.rst generation
ittnotify.h Add VTune notification API support Run ldconfig after rpm installation, second try

CMake Modules

This repository contains common CMake modules and a collection of find scripts to locate non-CMake dependencies. To use it, create a .gitexternals file in your project with the content:

# -*- mode: cmake -*-
# CMake/common master

Copy GitExternal from this repository to CMake/, and use it in your top-level CMakeLists.txt as follows:


This will clone the latest version of this repository into your project at the beginning of the CMake run, and make all its features available. Run the 'update' target (e.g. 'make update') after the first successful cmake run to pin the git external to a SHA1 tag instead of a moving master tag.


The following CMake modules can be included in your project:

  • Common does a common CMake setup, and also includes:
    • CommonLibrary common_library function to build a shared library using a standard recipe and generates header files for the library (api.h, version.h).
    • CommonApplication common_application function to build an application using a standard recipe.
    • CommonPackage common_package for more convenience over find_package and common_package_post (last after all common_package calls) to generate defines.h and options.cmake for feature checking.
    • Compiler: Default compiler flags applied via common_compiler_flags(), useful default warnings and 'safe' C++11 features.
    • GitInfo sets variables with information about the git source tree.
    • GitTargets branch, cut, tag, erase, retag, tarball targets.
  • CommonCTest should be included from a tests subfolder. Does a common CTest setup, automatically adding all .cpp files in the current folder as unit tests to a tests target. It also includes:
    • Coverage coverage target to generate a code coverage report as html, if ENABLE_COVERAGE option is also set. Additional compiler flags are set in that case, so it should be enabled only for debug builds.
    • CppcheckTargets: cppcheck target for static code analysis. Also adds all cppcheck targets to tests target.
    • clangcheckTargets: clangcheck target for clang-check code analysis. Adds all clangcheck targets to tests if ENABLE_CLANGCHECK_TESTS is set.
  • CommonPackageConfig generates cmake package information files for the project. These files let other CMake-based projects locate it through find_package (in config mode, without the need for a finder script). Must be included at the end of the CMakeLists.txt, after all targets have been added via common_library().
  • CommonCPack Configures the CPack package generator to redistribute the project as an installable package. Also includes CommonPackageConfig.
  • DoxygenRule: doxygen target to build documentation into PROJECT_BINARY_DIR/doc. Optional doxycopy target to copy the results to ../GITHUB_ORGANIZATION/Project-M.m/. Must be included after all other targets.
  • SubProject: This module is automatically included in Common.cmake to build several CMake subprojects (which may depend on each other), which are declared in a .gitsubprojects file. To be compatible with the SubProject feature, (sub)projects might need to adapt their CMake scripts. Generally, CMAKE_BINARY_DIR should be changed to PROJECT_BINARY_DIR and CMAKE_SOURCE_DIR should be changed to PROJECT_SOURCE_DIR. See SubProject documentation for more details. A simple example project can be found at, and a complex one at

Additional features:

  • Users can use "cmake -DINSTALL_PACKAGES=1" during the initial configuration to install known system packages (Ubuntu and OS X only).

Detailed Change Log

Something went wrong with that request. Please try again.