Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Common CMake modules
CMake C Python C++ CSS Tcl Other
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
cpp Fix INTERFACE library for CMake 2, use proper replacement for CMake 3
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 New CommonPackageConfig.cmake replaces PackageConfig.cmake
CMakeInstallPath.cmake Subproject: bug fixes, speedups, reduced verbosity
ChoosePython.cmake Subproject: bug fixes, speedups, reduced verbosity
Common.cmake Partially revert 3d951fd to fix OSX bundle generation
CommonApplication.cmake More speedup (~30%)
CommonCPPCTest.cmake Show output of ctest runs
CommonCPack.cmake New CommonPackageConfig.cmake replaces PackageConfig.cmake
CommonCTest.cmake MSVC fixes: test execution, compiler flags, DNSSD finder
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
CommonDocumentation.cmake common_documentation sub project fix
CommonGraph.cmake Minor speedup with check targets, fix cpplint target
CommonInstall.cmake Fix typo bug
CommonLibrary.cmake Documentation typos
CommonPackage.cmake Bring back "Name-png" target
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 MSVC fixes: test execution, compiler flags, DNSSD finder
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 Use a sensible input variable for the doxygen brief
DoxygenRule.cmake Fix MSVC build, cleanup solution folders
Doxygit.cmake common_documentation sub project fix
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 Added a config script to auto detect the Python version to use.
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 Fix ill-formed filename (---NAME-rebase.cmake) if COMMON_SOURCE_DIR i…
GitInfo.cmake Quote some problematic variables, more MSVC fixes
GitTargets.cmake Use common naming conventions for GitTargets and remove dangerous met…
GithubInfo.cmake More silence in CMake run and finders, remove unused BuildApplication
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 Fix #410: Restore API of check targets
StringifyShaders.cmake Fix shader stringify for real, rename to remove eq historics
SubProject.cmake Bring back "Name-png" target
System.cmake Subproject: bug fixes, speedups, reduced verbosity
TestCPP11.cmake Warn users of TestCPP11 if it runs multiple times (for each subproject).
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 Foundations to transform documentation repository into directory:
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:

# -*- 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).
Something went wrong with that request. Please try again.