Skip to content
Common CMake modules
CMake C Python C++ Tcl CSS Other
Find file
Latest commit 22181df @rdumusc rdumusc Merge pull request #437 from mgeplf/subproject_dirlist
Have SubProject return a list of directories
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)
CHANGES.md Add OPTIONAL argument to git_external
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 Fix warning
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
CommonConfig.cmake.in 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 Coverage.cmake fixes
CommonPackage.cmake Tweak CMake output
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 Bluegene settings
CompilerIdentification.cmake update XLC compiler defines
CompilerVersion.cmake Fix compatibility with CMake < 2.8.3
Coverage.cmake Ignore moc and qrc files in coverage report
CoverageGcovr.cmake added Gcovr coverage tool support
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 Allow usage of lists for DOXYGEN_EXTRA_INPUT
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 Bluegene settings
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+…
Findhttpxx.cmake httpxx finder
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 Add OPTIONAL argument to git_external
GitInfo.cmake Tweak CMake output
GitTargets.cmake Fix [project]-make-branch target
GithubInfo.cmake GithubInfo: provide main github page
Info.plist.in 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
ProjectInfo.in.cmake Modifications in setup of issues link.
README.md Release preparations
Sanitizer.cmake remove 'option' declaration in Sanitizer.cmake
StringifyShaders.cmake Fix shader stringify for real, rename to remove eq historics
SubProject.cmake Keep SUBPROJECT_PATHS as a list
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
html2rst.py Fix README.rst generation
ittnotify.h Add VTune notification API support
rpmPostInstall.sh Run ldconfig after rpm installation, second try

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