Skip to content
Common CMake modules
CMake C Python C++ Tcl CSS Other
Find file
Latest commit c685ea0 Apr 29, 2016 @rdumusc rdumusc Merge pull request #488 from rdumusc/master
Fix usage of VERSION -> PROJECT_VERSION after CMake3 change
Failed to load latest commit information.
cpp CMake3 port and various cleanups Apr 13, 2016
icons Update icons with PD versions Mar 6, 2014
util Missing update from Eyescale:master Nov 21, 2014
.gitignore Update gitignore Aug 9, 2012
AppleCheckOpenGL.cmake Fix apple_check_opengl (for TUIO) Jul 31, 2015
CHANGES.md Fix coverage report generation for the top-level project Apr 26, 2016
ChoosePython.cmake Consider other naming conventions for Boost.Python in ChoosePython.cm… Feb 23, 2016
Common.cmake CMake3 port and various cleanups Apr 13, 2016
CommonApplication.cmake Fix usage of VERSION -> PROJECT_VERSION after CMake3 change Apr 29, 2016
CommonCPPCTest.cmake CMake3 port and various cleanups Apr 13, 2016
CommonCPPCheck.cmake Rename cpp check targets to fix warning with ITK caused by global nam… Apr 13, 2016
CommonCPPLint.cmake Rename cpp check targets to fix warning with ITK caused by global nam… Apr 13, 2016
CommonCPack.cmake Fix usage of VERSION -> PROJECT_VERSION after CMake3 change Apr 29, 2016
CommonCTest.cmake New global and per project test target for nightly tests. Nov 24, 2015
CommonCheckTargets.cmake Exclude Objective-C files from cppcheck Apr 20, 2016
CommonClangCheck.cmake CMake3 port and various cleanups Apr 13, 2016
CommonCompiler.cmake Fix missing Darwin compile defintion Apr 19, 2016
CommonConfig.cmake.in New CommonPackageConfig.cmake replaces PackageConfig.cmake Aug 17, 2015
CommonCoverage.cmake Fix coverage report generation for the top-level project Apr 26, 2016
CommonDate.cmake CR #421 Oct 15, 2015
CommonFindPackage.cmake CMake3 port and various cleanups Apr 13, 2016
CommonGraph.cmake Fix MSVC warning aabout already existing target Apr 19, 2016
CommonInstall.cmake Fix typo bug Apr 17, 2015
CommonLibrary.cmake Fix coverage report generation for the top-level project Apr 26, 2016
CommonPackageConfig.cmake Fix usage of VERSION -> PROJECT_VERSION after CMake3 change Apr 29, 2016
CommonProcess.cmake Introduce and use CommonProcess Feb 20, 2014
CommonTarget.cmake Fix MSVC warning aabout already existing target Apr 18, 2016
CoverageGcovr.cmake added Gcovr coverage tool support Dec 17, 2015
Doxyfile Fix Doxygen's project version after CMake3 port Apr 22, 2016
DoxygenRule.cmake Fix Doxygen's project version after CMake3 port Apr 22, 2016
Doxygit.cmake More coverage tweaks Mar 7, 2016
FindAIO.cmake Missing update from Eyescale:master Nov 21, 2014
FindAtlas.cmake Added find script for ATLAS (optimized lapack/blas) library Jan 10, 2014
FindBlueZ.cmake Add abandoned finder from Buildyard May 16, 2014
FindBoostConfig.cmake Bluegene settings Jan 28, 2016
FindCBLAS.cmake Unified solution for LAPACK/CBLAS Feb 18, 2014
FindCairo.cmake Add finder for Cairo library Aug 9, 2012
FindDNSSD.cmake MSVC fixes: test execution, compiler flags, DNSSD finder Jul 27, 2015
FindFCGI.cmake Subproject: bug fixes, speedups, reduced verbosity Jul 14, 2015
FindFFMPEG.cmake Missing update from Eyescale:master Nov 21, 2014
FindFlowVR.cmake Missing update from Eyescale:master Nov 21, 2014
FindGLEW_MX.cmake Improve FindGLEW_MX.cmake to find glew module Feb 26, 2016
FindGPFS.cmake Add GPFS API finder Mar 22, 2013
FindGTS.cmake Implement QUIET for GTS finder Jul 25, 2013
FindLibJpegTurbo.cmake Missing update from Eyescale:master Nov 21, 2014
FindMAGELLAN.cmake Fix Magellan OS X finder May 21, 2013
FindMKL.cmake Add FindMKL script (forked from external github repository). Not yet … Mar 25, 2013
FindMUSIC.cmake Simply finder for MUSIC Feb 18, 2016
FindMaya.cmake Updating the finder to look into Maya 2013 directory. Jul 11, 2013
FindNumPy.cmake More silence in CMake run and finders, remove unused BuildApplication Jun 22, 2015
FindOFED.cmake Implement QUIET for FindOFED Aug 8, 2012
FindOpenMesh.cmake Add author/copyright Feb 28, 2014
FindPoppler.cmake Subproject: bug fixes, speedups, reduced verbosity Jul 14, 2015
FindPythonCython.cmake Missing update from Eyescale:master Nov 21, 2014
FindPythonModule.cmake Missing update from Eyescale:master Nov 21, 2014
FindPythonh5py.cmake Missing update from Eyescale:master Nov 21, 2014
FindPythonnose.cmake Missing update from Eyescale:master Nov 21, 2014
FindQwt.cmake Add finder Qwt library Jul 18, 2012
FindRealityGrid.cmake Add RealityGrid finder Jun 18, 2012
FindSLURM.cmake Missing update from Eyescale:master Nov 21, 2014
FindSpatialIndex.cmake added file for libSpatialIndex Apr 16, 2014
FindTuvok.cmake Fix subproject find with COMMON_SOURCE_DIR Jul 16, 2015
FindUDT.cmake Implement QUIET for UDT finder Jul 25, 2013
FindVRPN.cmake Denoise some finders Jul 19, 2013
FindVTune.cmake CMake3 port and various cleanups Apr 13, 2016
FindWiiuse.cmake Tweak FindWiiuse.cmake Jul 24, 2015
FindXDR.cmake Add finder foro XDR library Jun 24, 2012
Findcppcheck.cmake More QUIET for internal find_packages, remove obsolete GNUModules May 27, 2015
Findcppcheck.cpp Improve cppcheck compatibility Jan 27, 2014
Findcpplint.cmake Minor speedup with check targets, fix cpplint target Aug 21, 2015
Findcppnetlib.cmake Restore Findcppnetlib to fix Ubuntu 14.04 build (missing CMake config… Jul 28, 2015
Findgmock.cmake Adding find package support for gmock, jsoncpp, zeromq, and zeromq c+… Oct 22, 2013
Findhttpxx.cmake httpxx finder Jan 20, 2016
Findhwloc.cmake More QUIET for internal find_packages, remove obsolete GNUModules May 27, 2015
Findjack.cmake Add jack finder for SAGE Feb 1, 2013
Findleveldb.cmake Subproject: bug fixes, speedups, reduced verbosity Jul 14, 2015
Findlibzmq.cmake Remove obsolete Finder Feb 18, 2016
Findlo.cmake Add lo finder for SAGE Feb 1, 2013
Findrocksdb.cmake Fix rocksdb finder for newer versions Nov 26, 2014
Findv4l2.cmake v4l2 & yasm finder for SAGE Feb 1, 2013
Findvncserver.cmake Add vnc finder for SAGE Feb 1, 2013
Findyasm.cmake v4l2 & yasm finder for SAGE Feb 1, 2013
GetSourceFilesFromTarget.cmake Fix #410: Restore API of check targets Aug 25, 2015
GitExternal.cmake CMake3 port and various cleanups Apr 13, 2016
GitInfo.cmake Tweak CMake output Jan 20, 2016
GitTargets.cmake Fix usage of VERSION -> PROJECT_VERSION after CMake3 change Apr 29, 2016
GithubInfo.cmake GithubInfo: provide main github page Oct 15, 2015
Info.plist.in Introduce common_gui_application() wrapper with OSX app bundle support Jun 9, 2015
InstallFiles.cmake Fix install in common_library() with subfolders Apr 8, 2016
LICENSE.txt Missing update from Eyescale:master Nov 21, 2014
LSBInfo.cmake Bring LSB_CODENAME back, needed for Fivox w/ broken ITK on Ubuntu trusty Jul 15, 2015
LibFindMacros.cmake CMake3 port and various cleanups Apr 13, 2016
MPI.cmake More silence in CMake run and finders, remove unused BuildApplication Jun 22, 2015
MacPorts.cmake Fix usage of VERSION -> PROJECT_VERSION after CMake3 change Apr 29, 2016
Maturity.cmake Foundations to transform documentation repository into directory: Mar 5, 2014
OSG.cmake Missing update from Eyescale:master Nov 21, 2014
OSSCPack.cmake More speedup (~30%) Aug 11, 2015
Portfile Fix make Macports portfilename configurable Nov 20, 2012
ProjectInfo.cmake Fix MSVC build, cleanup solution folders Jul 16, 2015
ProjectInfo.in.cmake Modifications in setup of issues link. Mar 31, 2014
README.md CMake3 port and various cleanups Apr 13, 2016
Sanitizer.cmake remove 'option' declaration in Sanitizer.cmake Jan 5, 2016
StringifyShaders.cmake Fix shader stringify for real, rename to remove eq historics Jan 13, 2014
SubProject.cmake CMake3 port and various cleanups Apr 13, 2016
TestScriptUtils.cmake Allow absolute paths for test scripts. Feb 9, 2015
Ubuntu.cmake Unify ubuntu codenames in a single place May 9, 2014
UpdateGitExternal.cmake Deprecate useless update_file Feb 28, 2014
UploadPPA.cmake Quote some problematic variables, more MSVC fixes Jul 19, 2015
VersionUtils.cmake Missing update from Eyescale:master Nov 21, 2014
cdash.bat CDash Win32 batch script Jul 24, 2011
cdash.plist Update launchctl CDash plist Mar 30, 2011
github.css Let users scroll the documentation TOC when it doesn't fit on the screen Nov 10, 2015
html2rst.py Fix README.rst generation Dec 15, 2010
ittnotify.h Add VTune notification API support Mar 20, 2013
rpmPostInstall.sh Run ldconfig after rpm installation, second try Jul 18, 2012

README.md

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 https://github.com/Eyescale/CMake.git master

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

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake
                              ${CMAKE_SOURCE_DIR}/CMake/common)
include(GitExternal)
include(Common)

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.

Documentation

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.
    • CommonFindPackage common_find_package for more convenience over find_package and common_find_package_post (must be last after all common_find_package calls) to generate defines.h and options.cmake for feature checking.
    • CommonCompiler: Default compiler flags can be set on given target to common_compile_options(), 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:
    • CommonCoverage coverage target to generate a code coverage report as html, if COMMON_ENABLE_COVERAGE option is set. Additional compiler flags are set in that case, so it should be enabled only for debug builds.
    • CommonCPPCheck: cppcheck target for static code analysis. Also adds all cppcheck targets to tests target.
    • CommonClangCheck: clangcheck target for clang-check code analysis. Adds all clangcheck targets to tests if COMMON_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() and common_application().
  • 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 https://github.com/Eyescale/Collage.git, and a complex one at https://github.com/BlueBrain/Livre.git.

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.