├── .gitignore ├── AppleCheckOpenGL.cmake ├── CHANGES.md ├── ChoosePython.cmake ├── Common.cmake ├── CommonApplication.cmake ├── CommonCPPCTest.cmake ├── CommonCPPCheck.cmake ├── CommonCPPLint.cmake ├── CommonCPack.cmake ├── CommonCPackUtils.cmake ├── CommonCTest.cmake ├── CommonCUDA.cmake ├── CommonCheckTargets.cmake ├── CommonClangCheck.cmake ├── CommonCompiler.cmake ├── CommonConfig.cmake.in ├── CommonCoverage.cmake ├── CommonDate.cmake ├── CommonFindPackage.cmake ├── CommonGraph.cmake ├── CommonHelp.cmake ├── CommonInstall.cmake ├── CommonInstallProject.cmake ├── CommonLibrary.cmake ├── CommonPackageConfig.cmake ├── CommonPythonCTest.cmake ├── CommonSmokeTest.cmake ├── CommonTarget.cmake ├── CoverageGcovr.cmake ├── Doxyfile ├── DoxygenRule.cmake ├── FindAIO.cmake ├── FindAtlas.cmake ├── FindBlueZ.cmake ├── FindBoostConfig.cmake ├── FindCBLAS.cmake ├── FindDNSSD.cmake ├── FindFCGI.cmake ├── FindFFMPEG.cmake ├── FindFlowVR.cmake ├── FindGLEW_MX.cmake ├── FindGPFS.cmake ├── FindGTS.cmake ├── FindLibJpegTurbo.cmake ├── FindMAGELLAN.cmake ├── FindMKL.cmake ├── FindMUSIC.cmake ├── FindMaya.cmake ├── FindNumPy.cmake ├── FindOFED.cmake ├── FindOpenMesh.cmake ├── FindPythonCython.cmake ├── FindPythonModule.cmake ├── FindPythonh5py.cmake ├── FindPythonnose.cmake ├── FindQwt.cmake ├── FindRealityGrid.cmake ├── FindSLURM.cmake ├── FindSpatialIndex.cmake ├── FindUDT.cmake ├── FindVRPN.cmake ├── FindVTune.cmake ├── FindWiiuse.cmake ├── FindXDR.cmake ├── Findcppcheck.cmake ├── Findcppcheck.cpp ├── Findcpplint.cmake ├── Findcppnetlib.cmake ├── Findgmock.cmake ├── Findhttpxx.cmake ├── Findhwloc.cmake ├── Findjack.cmake ├── Findleveldb.cmake ├── Findlo.cmake ├── Findquatlib.cmake ├── Findrados.cmake ├── Findrocksdb.cmake ├── Findv4l2.cmake ├── Findvncserver.cmake ├── Findyasm.cmake ├── GetSourceFilesFromTarget.cmake ├── GitExternal.cmake ├── GitHooks.cmake ├── GitInfo.cmake ├── GitTargets.cmake ├── GithubInfo.cmake ├── Info.plist.in ├── InstallDependencies.cmake ├── InstallFiles.cmake ├── LICENSE.txt ├── LSBInfo.cmake ├── LibFindMacros.cmake ├── MPI.cmake ├── MacPorts.cmake ├── OSG.cmake ├── OSSCPack.cmake ├── Portfile ├── ProjectInfo.cmake ├── ProjectInfo.in.cmake ├── README.md ├── Sanitizer.cmake ├── StringifyShaders.cmake ├── SubProject.cmake ├── TestScriptUtils.cmake ├── Ubuntu.cmake ├── UploadPPA.cmake ├── cdash.bat ├── cdash.plist ├── cpp ├── api.h ├── defines.h ├── version.cpp └── version.h ├── doc └── modules.md ├── html2rst.py ├── ittnotify.h ├── postinst ├── rpmPostInstall.sh └── util ├── cpplint.py └── git_pre-commit.in /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | GNUmakefile 3 | -------------------------------------------------------------------------------- /AppleCheckOpenGL.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Provides the following function: 3 | # * apple_check_opengl(): Adds a test to ${PROJECT_NAME}-tests to check 4 | # that only one OpenGL (X11 lib or OpenGL framework) is linked to the given 5 | # on OS X 6 | 7 | function(apple_check_opengl Target) 8 | if(NOT APPLE) 9 | return() 10 | endif() 11 | 12 | add_test(NAME ${Target}-AppleCheckOpenGL 13 | COMMAND ${CMAKE_COMMAND} -DAPPLE_CHECK_OPENGL_FILE="$" 14 | -P ${CMAKE_SOURCE_DIR}/CMake/common/AppleCheckOpenGL.cmake) 15 | add_custom_target(${Target}-AppleCheckOpenGL 16 | COMMAND ${CMAKE_COMMAND} -DAPPLE_CHECK_OPENGL_FILE="$" 17 | -P ${CMAKE_SOURCE_DIR}/CMake/common/AppleCheckOpenGL.cmake 18 | COMMENT "Verifying OpenGL link libraries of ${Target}") 19 | 20 | if(NOT TARGET ${PROJECT_NAME}-tests) 21 | add_custom_target(${PROJECT_NAME}-tests) 22 | set_target_properties(${PROJECT_NAME}-tests PROPERTIES 23 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests) 24 | endif() 25 | add_dependencies(${PROJECT_NAME}-tests ${Target}-AppleCheckOpenGL) 26 | endfunction() 27 | 28 | if(APPLE_CHECK_OPENGL_FILE) 29 | find_program(OTOOL otool) 30 | set(OPENGL_X11 libGL...dylib) 31 | set(OPENGL_FRAMEWORK OpenGL.framework) 32 | 33 | execute_process(COMMAND ${OTOOL} -L ${APPLE_CHECK_OPENGL_FILE} 34 | OUTPUT_VARIABLE LINKLIBS ERROR_VARIABLE ERROR) 35 | if(ERROR) 36 | message(FATAL_ERROR "Can't determine link libraries of ${APPLE_CHECK_OPENGL_FILE}: ${ERROR}") 37 | endif() 38 | if(LINKLIBS MATCHES ${OPENGL_X11} AND LINKLIBS MATCHES ${OPENGL_FRAMEWORK}) 39 | message(FATAL_ERROR "Both ${OPENGL_X11} and ${OPENGL_FRAMEWORK} linked to ${APPLE_CHECK_OPENGL_FILE}") 40 | endif() 41 | string(REGEX MATCHALL "[^ \)]+${OPENGL_X11}" OPENGL_X11_LIBS ${LINKLIBS}) 42 | if(OPENGL_X11_LIBS) 43 | list(LENGTH OPENGL_X11_LIBS NUM_OPENGL_X11_LIBS) 44 | if(NUM_OPENGL_X11_LIBS GREATER 1) 45 | message(FATAL_ERROR "Found ${NUM_OPENGL_X11_LIBS} different X11 OpenGL libraries in ${APPLE_CHECK_OPENGL_FILE}: ${OPENGL_X11_LIBS}") 46 | endif() 47 | endif() 48 | endif() 49 | -------------------------------------------------------------------------------- /ChoosePython.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright (c) 2012-2015 Cajal Blue Brain, BBP/EPFL 3 | ## All rights reserved. Do not distribute without permission. 4 | ## 5 | ## Responsible Author: Juan Hernando Vieites (JHV) 6 | ## contact: jhernando@fi.upm.es 7 | 8 | # This script provides an option to choose which Python version should be 9 | # requested to FindPythonInterp and FindPythonLibs. The user can choose 10 | # between version 2, 3 or autodetection (the default). If 11 | # CHOOSE_PYTHON_IGNORE_BOOST is set, autodetection will choose the Python 12 | # version without checking if Boost.Python is available and which version it 13 | # supports. 14 | # 15 | # Input Variables: 16 | # * CHOOSE_PYTHON_IGNORE_BOOST 17 | # 18 | # Output Variables: 19 | # * USE_PYTHON3: Set to 1 if and only if Python 3 is chosen. 20 | # * USE_BOOST_PYTHON_VERSION: Equals 3 if Python 3 is chosen, empty string 21 | # otherwise 22 | # * PYTHON_LIBRARY_SUFFIX: The suffix path where Python site packages are 23 | # to be installed for the chosen Python version. 24 | # * PythonLibs_FIND_VERSION 25 | # PythonInter_FIND_VERSION: Variables used by Python find scripts as input. 26 | # Set to 2 or 3 depending on the version chosen. 27 | # 28 | # Input/output varaibles: 29 | # * USE_PYTHON_VERSION: (input/output), the Python version chosen. At return it 30 | # can only be 2 or 3. 31 | # 32 | # Defines: 33 | # * -DUSE_PYTHON3=1: If Python 3 is chosen. 34 | 35 | if(CHOOSE_PYTHON_DONE) 36 | return() 37 | endif() 38 | set(CHOOSE_PYTHON_DONE ON) 39 | 40 | include(FindBoostConfig) # Including the workarounds for boost finders. 41 | 42 | set(USE_PYTHON_VERSION "auto" CACHE STRING 43 | "Choose the required Python version (2, 3 or auto).") 44 | 45 | set_property(CACHE USE_PYTHON_VERSION PROPERTY STRINGS 2 3 auto) 46 | 47 | if(PYTHONINTERP_FOUND) 48 | message(WARNING "This script must be included before trying to find Python.") 49 | return() 50 | endif() 51 | 52 | if(${USE_PYTHON_VERSION} STREQUAL auto) 53 | # Finding Boost first if needed because if the Python3 interpreter is found 54 | # first there's no way back. 55 | if(NOT CHOOSE_PYTHON_IGNORE_BOOST) 56 | foreach(__suffix 3 38 -py38 37 -py37 36 -py36 -py35 -py34 ) 57 | find_package(Boost COMPONENTS python${__suffix} QUIET) 58 | if(Boost_FOUND) 59 | string(TOUPPER ${__suffix} __boost_python_library_suffix) 60 | break() 61 | endif() 62 | endforeach() 63 | endif() 64 | if(Boost_FOUND OR CHOOSE_PYTHON_IGNORE_BOOST) 65 | find_package(PythonInterp 3 QUIET) 66 | endif() 67 | 68 | if(PYTHONINTERP_FOUND AND (CHOOSE_PYTHON_IGNORE_BOOST OR Boost_FOUND)) 69 | set(USE_PYTHON_VERSION 3) 70 | else() 71 | set(USE_PYTHON_VERSION 2) 72 | endif() 73 | endif() 74 | 75 | if(${USE_PYTHON_VERSION} STREQUAL 3) 76 | set(USE_PYTHON3 ON) 77 | # Enforcing a Python version to be searched by scripts included by 78 | # Common.cmake that search for Python (e.g. cpplint) 79 | set(PYTHON_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2) 80 | set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2) 81 | set(PythonLibs_FIND_VERSION 3) 82 | add_definitions(-DUSE_PYTHON3=1) 83 | set(USE_BOOST_PYTHON_VERSION ${__boost_python_library_suffix}) 84 | # This shouldn't be necessary but helps detecting the Python libs 85 | # provided by the module python/3.2-rhel6-x86_64 86 | if(DEFINED ENV{PYTHON_LIBRARY}) 87 | # find_path is called twice using these variables as input and output. 88 | # If the variables are not set as CACHE variables the second call to 89 | # file_path fails for no apparent reason except that the variables have 90 | # been marked as advanced by FindPythonLibs.cmake 91 | set(PYTHON_LIBRARY $ENV{PYTHON_LIBRARY} CACHE FILEPATH "") 92 | set(PYTHON_INCLUDE_DIR $ENV{PYTHON_INCLUDE_DIR} CACHE PATH "") 93 | endif() 94 | else() 95 | set(PythonLibs_FIND_VERSION 2) 96 | endif() 97 | 98 | if(NOT PYTHON_EXECUTABLE) 99 | # Regardless of auto-detection, now we need to find the interpreter to 100 | # query the library suffix. 101 | find_package(PythonInterp ${USE_PYTHON_VERSION} QUIET) 102 | endif() 103 | execute_process(COMMAND 104 | ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1,0,prefix=''))" 105 | OUTPUT_VARIABLE PYTHON_LIBRARY_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) 106 | -------------------------------------------------------------------------------- /CommonCPPCheck.cmake: -------------------------------------------------------------------------------- 1 | # - Run cppcheck on c++ source files as a custom target and a test 2 | # 3 | # include(CppcheckTargets) 4 | # common_cppcheck( [FILES] [UNUSED_FUNCTIONS] [STYLE] 5 | # [POSSIBLE_ERROR] [FAIL_ON_WARNINGS] 6 | # [EXCLUDE_PATTERN]) - 7 | # Create a target to check a target's sources with cppcheck and the 8 | # indicated options 9 | # 10 | # Requires these CMake modules: 11 | # Findcppcheck 12 | # 13 | # Accepts the following input variables: 14 | # * CPPCHECK_EXTRA_ARGS for additional command line parameters to cppcheck 15 | # 16 | # Original Author: 17 | # 2009-2010 Ryan Pavlik 18 | # http://academic.cleardefinition.com 19 | # Iowa State University HCI Graduate Program/VRAC 20 | # 21 | # Copyright Iowa State University 2009-2010. 22 | # Distributed under the Boost Software License, Version 1.0. 23 | # (See accompanying file LICENSE_1_0.txt or copy at 24 | # http://www.boost.org/LICENSE_1_0.txt) 25 | 26 | if(TARGET ${PROJECT_NAME}-cppcheck) 27 | return() 28 | endif() 29 | 30 | include(CMakeParseArguments) 31 | include(GetSourceFilesFromTarget) 32 | 33 | if(NOT CPPCHECK_FOUND) 34 | find_package(cppcheck 1.66 QUIET) 35 | endif() 36 | 37 | if(NOT CPPCHECK_FOUND) 38 | add_custom_target(${PROJECT_NAME}-cppcheck 39 | COMMENT "cppcheck executable not found") 40 | set_target_properties(${PROJECT_NAME}-cppcheck PROPERTIES 41 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cppcheck) 42 | endif() 43 | 44 | if(NOT TARGET cppcheck) 45 | add_custom_target(cppcheck) 46 | set_target_properties(cppcheck PROPERTIES 47 | EXCLUDE_FROM_DEFAULT_BUILD ON) 48 | endif() 49 | 50 | function(common_cppcheck _name) 51 | if(NOT CPPCHECK_FOUND) 52 | return() 53 | endif() 54 | 55 | if(CPPCHECK_IGNORED_PATHS) 56 | string(REPLACE " " " -i" _ignored_paths ${CPPCHECK_IGNORED_PATHS}) 57 | set(CPPCHECK_IGNORED_PATHS -i${_ignored_paths}) 58 | endif() 59 | 60 | set(_cppcheck_args ${CPPCHECK_IGNORED_PATHS} --error-exitcode=2 61 | --inline-suppr --suppress=unusedFunction --suppress=unmatchedSuppression 62 | --suppress=missingInclude --suppress=preprocessorErrorDirective 63 | ${CPPCHECK_EXTRA_ARGS}) 64 | 65 | set(oneValueArgs UNUSED_FUNCTIONS STYLE POSSIBLE_ERROR FAIL_ON_WARNINGS EXCLUDE_PATTERN) 66 | set(multiValueArgs FILES) 67 | cmake_parse_arguments(common_cppcheck "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) 68 | if(NOT common_cppcheck_EXCLUDE_PATTERN) 69 | set(common_cppcheck_EXCLUDE_PATTERN "^$") # Empty string regex 70 | endif() 71 | 72 | if(common_cppcheck_UNUSED_FUNCTIONS) 73 | list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG}) 74 | endif() 75 | 76 | if(common_cppcheck_STYLE) 77 | list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG}) 78 | endif() 79 | 80 | if(common_cppcheck_POSSIBLE_ERROR) 81 | list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG}) 82 | endif() 83 | 84 | if(common_cppcheck_FAIL_ON_WARNINGS) 85 | list(APPEND CPPCHECK_FAIL_REGULAR_EXPRESSION 86 | ${CPPCHECK_WARN_REGULAR_EXPRESSION}) 87 | endif() 88 | 89 | set(_files ${common_cppcheck_FILES}) 90 | if(NOT _files) 91 | get_source_files(${_name} ${common_cppcheck_EXCLUDE_PATTERN}) 92 | if(NOT ${_name}_FILES) # nothing to check 93 | return() 94 | endif() 95 | set(_files ${${_name}_FILES}) 96 | endif() 97 | 98 | add_test(NAME ${_name}-cppcheck 99 | COMMAND ${CPPCHECK_EXECUTABLE} ${CPPCHECK_QUIET_ARG} 100 | ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} ${_files} 101 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") 102 | set_tests_properties(${_name}-cppcheck PROPERTIES LABELS ${PROJECT_NAME}-unit) 103 | 104 | add_custom_target(${_name}-runcppcheck 105 | COMMAND ${CPPCHECK_EXECUTABLE} ${CPPCHECK_QUIET_ARG} 106 | ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} ${_files} 107 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") 108 | set_target_properties(${_name}-runcppcheck PROPERTIES 109 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cppcheck) 110 | 111 | if(NOT TARGET ${PROJECT_NAME}-cppcheck) 112 | add_custom_target(${PROJECT_NAME}-cppcheck) 113 | set_target_properties(${PROJECT_NAME}-cppcheck PROPERTIES 114 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cppcheck) 115 | endif() 116 | add_dependencies(${PROJECT_NAME}-cppcheck ${_name}-runcppcheck) 117 | add_dependencies(cppcheck ${PROJECT_NAME}-cppcheck) 118 | endfunction() 119 | -------------------------------------------------------------------------------- /CommonCPPLint.cmake: -------------------------------------------------------------------------------- 1 | # - Run cpplint on c++ source files as a custom target and a test 2 | # 3 | # include(CpplintTargets) 4 | # common_cpplint( [FILES files] [CATEGORY_FILTER_OUT category ...] 5 | # [EXTENSIONS extension ...] [VERBOSE level] 6 | # [COUNTING level_of_detail] [ROOT subdir] [LINELENGTH digits] 7 | # [EXCLUDE_PATTERN pattern ...]) 8 | # Create a target to check a target's sources with cpplint and the indicated 9 | # options 10 | # 11 | # Input variables: 12 | # * CPPLINT_ADD_TESTS: When set to ON, add cpplint targets to tests 13 | 14 | if(TARGET ${PROJECT_NAME}-cpplint) 15 | return() 16 | endif() 17 | 18 | include(CMakeParseArguments) 19 | include(GetSourceFilesFromTarget) 20 | 21 | if(NOT CPPLINT_FOUND) 22 | find_package(cpplint QUIET) 23 | endif() 24 | 25 | if(NOT CPPLINT_FOUND) 26 | add_custom_target(${PROJECT_NAME}-cpplint COMMENT "${CPPLINT_NOT_FOUND_MSG}") 27 | set_target_properties(${PROJECT_NAME}-cpplint PROPERTIES 28 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cpplint) 29 | endif(NOT CPPLINT_FOUND) 30 | 31 | if(NOT TARGET cpplint) 32 | add_custom_target(cpplint) 33 | set_target_properties(cpplint PROPERTIES 34 | EXCLUDE_FROM_DEFAULT_BUILD ON) 35 | endif() 36 | 37 | function(common_cpplint _name) 38 | if(NOT CPPLINT_FOUND) 39 | return() 40 | endif() 41 | 42 | set(oneValueArgs VERBOSE COUNTING ROOT LINELENGTH EXCLUDE_PATTERN) 43 | set(multiValueArgs FILES CATEGORY_FILTER_OUT EXTENSIONS) 44 | cmake_parse_arguments(common_cpplint "${options}" "${oneValueArgs}" 45 | "${multiValueArgs}" ${ARGN}) 46 | if(NOT TARGET ${_name}) 47 | message(FATAL_ERROR 48 | "common_cpplint is given a target name that does not exist: '${_name}' !") 49 | endif() 50 | 51 | set(_cpplint_args) 52 | 53 | # handles category filters 54 | set(_category_filter) 55 | set(_category_filter_in "+build,+legal,+readability,+runtime,+whitespace") 56 | if (common_cpplint_CATEGORY_FILTER_OUT) 57 | string(REPLACE ";" ",-" common_cpplint_CATEGORY_FILTER_OUT "${common_cpplint_CATEGORY_FILTER_OUT}") 58 | set(_category_filter "--filter=${_category_filter_in},-${common_cpplint_CATEGORY_FILTER_OUT}") 59 | endif() 60 | list(APPEND _cpplint_args ${_category_filter}) 61 | 62 | # handles allowed extensions 63 | if (common_cpplint_EXTENSIONS) 64 | string(REPLACE ";" "," common_cpplint_EXTENSIONS "${common_cpplint_EXTENSIONS}") 65 | set(common_cpplint_EXTENSIONS "--extensions=${common_cpplint_EXTENSIONS}") 66 | list(APPEND _cpplint_args ${common_cpplint_EXTENSIONS}) 67 | endif() 68 | 69 | # handles verbosity level ([0-5]) 70 | if (common_cpplint_VERBOSE) 71 | list(APPEND _cpplint_args "--verbose=${common_cpplint_VERBOSE}") 72 | endif() 73 | 74 | # handles counting level of detail (total|toplevel|detailed) 75 | if (common_cpplint_COUNTING) 76 | list(APPEND _cpplint_args "--counting=${common_cpplint_COUNTING}") 77 | endif() 78 | 79 | # handles root directory used for deriving header guard CPP variable 80 | if(common_cpplint_ROOT) 81 | list(APPEND _cpplint_args "--root=${common_cpplint_ROOT}") 82 | endif() 83 | 84 | # handles line length 85 | if (common_cpplint_LINELENGTH) 86 | list(APPEND _cpplint_args "--linelength=${common_cpplint_LINELENGTH}") 87 | endif() 88 | 89 | set(_files ${common_cpplint_FILES}) 90 | if(NOT _files) 91 | # handles exclude pattern 92 | if(NOT common_cpplint_EXCLUDE_PATTERN) 93 | set(common_cpplint_EXCLUDE_PATTERN "^$") # Empty string regex 94 | endif() 95 | 96 | get_source_files(${_name} ${common_cpplint_EXCLUDE_PATTERN}) 97 | if(NOT ${_name}_FILES) # nothing to check 98 | return() 99 | endif() 100 | set(_files ${${_name}_FILES}) 101 | endif() 102 | 103 | if(CPPLINT_ADD_TESTS) 104 | if(NOT TARGET ${PROJECT_NAME}-tests) 105 | add_custom_target(${PROJECT_NAME}-tests) 106 | set_target_properties(${PROJECT_NAME}-tests PROPERTIES 107 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests) 108 | endif() 109 | add_dependencies(${PROJECT_NAME}-tests cpplint_run_${_name}) 110 | endif() 111 | 112 | add_custom_target(cpplint_run_${_name} 113 | COMMAND ${CPPLINT_SCRIPT} ${_cpplint_args} ${_files} 114 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}") 115 | set_target_properties(cpplint_run_${_name} PROPERTIES 116 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cpplint) 117 | 118 | if(NOT TARGET ${PROJECT_NAME}-cpplint) 119 | add_custom_target(${PROJECT_NAME}-cpplint) 120 | set_target_properties(${PROJECT_NAME}-cpplint PROPERTIES 121 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests/cpplint) 122 | endif() 123 | add_dependencies(${PROJECT_NAME}-cpplint cpplint_run_${_name}) 124 | add_dependencies(cpplint ${PROJECT_NAME}-cpplint) 125 | endfunction() 126 | -------------------------------------------------------------------------------- /CommonCPackUtils.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Raphael.Dumusc@epfl.ch 2 | # 3 | # Helper function for packaging subprojects using CommonCPack. 4 | # 5 | # Add subproject dependencies to the current project's package: 6 | # add_deb_depends( 7 | # [PACKAGE_NAME ] 8 | # [MIN_VERSION ] []) 9 | # 10 | # Arguments: 11 | # * Subproject: name of the subproject 12 | # * PACKAGE_NAME: if subproject package name differs from lower_case(Subproject) 13 | # * MIN_VERSION: minimum version of the subproject's package 14 | # * ARGN: list of dependencies of the subproject 15 | # 16 | # Output (list append): 17 | # * NAME_PACKAGE_REPLACES: Subproject package name if it is being built 18 | # * NAME_PACKAGE_DEB_DEPENDS: the list of Subproject's dependencies if it is 19 | # being built; otherwise its package name. 20 | 21 | macro(add_deb_depends Subproject) 22 | set(_opts) 23 | set(_singleArgs PACKAGE_NAME MIN_VERSION) 24 | set(_multiArgs) 25 | cmake_parse_arguments(THIS "${_opts}" "${_singleArgs}" "${_multiArgs}" 26 | ${ARGN}) 27 | set(_packages ${THIS_UNPARSED_ARGUMENTS}) 28 | 29 | if(THIS_PACKAGE_NAME) 30 | set(_subproject_pkg ${THIS_PACKAGE_NAME}) 31 | else() 32 | string(TOLOWER ${Subproject} _subproject_pkg) 33 | endif() 34 | 35 | if(${Subproject}_IS_SUBPROJECT) 36 | list(APPEND ${UPPER_PROJECT_NAME}_PACKAGE_REPLACES ${_subproject_pkg}) 37 | list(APPEND ${UPPER_PROJECT_NAME}_PACKAGE_DEB_DEPENDS ${_packages}) 38 | else() 39 | if(THIS_MIN_VERSION) 40 | set(_subproject_pkg "${_subproject_pkg} (>= ${THIS_MIN_VERSION})") 41 | endif() 42 | list(APPEND ${UPPER_PROJECT_NAME}_PACKAGE_DEB_DEPENDS "${_subproject_pkg}") 43 | endif() 44 | endmacro() 45 | -------------------------------------------------------------------------------- /CommonCTest.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010 Daniel Pfeifer 2 | # 2010-2015, Stefan Eilemann 3 | # 2014, Juan Hernando 4 | 5 | if(NOT TARGET tests) 6 | add_custom_target(tests) 7 | set_target_properties(tests PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) 8 | endif() 9 | if(NOT TARGET cpptests) 10 | add_custom_target(cpptests) 11 | set_target_properties(cpptests PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) 12 | endif() 13 | if(NOT TARGET perftests) 14 | add_custom_target(perftests) 15 | set_target_properties(perftests PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) 16 | endif() 17 | if(NOT TARGET nightlytests) 18 | add_custom_target(nightlytests) 19 | set_target_properties(nightlytests PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) 20 | endif() 21 | if(NOT TARGET ${PROJECT_NAME}-tests) 22 | add_custom_target(${PROJECT_NAME}-tests) 23 | set_target_properties(${PROJECT_NAME}-tests PROPERTIES 24 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests) 25 | endif() 26 | 27 | include(CommonCPPCTest) 28 | -------------------------------------------------------------------------------- /CommonCUDA.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Juan.Hernando@epfl.ch 2 | # 2016 Jafet.VillafrancaDiaz@epfl.ch 3 | # 4 | # Provides three functions for common configuration checks and setup for 5 | # projects using CUDA. 6 | # In particular: 7 | # * find_cuda_compatible_host_compiler() tries to set CUDA_HOST_COMPILER to a 8 | # version compatible with the CUDA version detected. 9 | # * common_cuda_compile_options() sets the default architecture to a minimum 10 | # value that does not cause deprecation warnings with newer version of nvcc. 11 | # * find_cuda_device() tries to compile and run a simple CUDA application to 12 | # detect the number of CUDA-capable devices, and sets CUDA_DEVICE_FOUND if 13 | # at least one is present. 14 | 15 | function(find_cuda_compatible_host_compiler) 16 | if(NOT CMAKE_COMPILER_IS_GNUCXX) 17 | # Only implemented for gcc 18 | return() 19 | endif() 20 | 21 | # With later CUDA versions host_config.h path is different 22 | set(_host_config "${CUDA_INCLUDE_DIRS}/crt/host_config.h") 23 | if(NOT EXISTS "${_host_config}") 24 | set(_host_config "${CUDA_INCLUDE_DIRS}/host_config.h") 25 | endif() 26 | 27 | if(NOT EXISTS "${_host_config}") 28 | message(SEND_ERROR "host_config.h CUDA header not found") 29 | return() 30 | endif() 31 | 32 | # Finding the maximum version of gcc supported by the CUDA installation 33 | # detected 34 | 35 | file(STRINGS "${_host_config}" _host_config_content REGEX "#if __GNUC__") 36 | # Different versions of host_config.h differ in how they check if the 37 | # version of gcc is supported. 38 | string(REGEX REPLACE "#if __GNUC__ > ([0-9]) \\|\\| \\(__GNUC__ == ([0-9]) && __GNUC_MINOR__ > ([0-9]*)\\)" 39 | "\\2.\\3" _max_gcc_version_supported ${_host_config_content}) 40 | string(REGEX REPLACE "#if __GNUC__ == ([0-9]) && __GNUC_MINOR__ > ([0-9]+)" 41 | "\\1.\\2" _max_gcc_version_supported ${_max_gcc_version_supported}) 42 | string(REGEX REPLACE "#if __GNUC__ > ([0-9])" 43 | "\\1" _max_gcc_version_supported ${_max_gcc_version_supported}) 44 | string(REPLACE "." "" _maxgccversionsupported ${_max_gcc_version_supported}) 45 | 46 | if(# Rejecting ccache as the host compiler as this causes errors later on. 47 | CMAKE_C_COMPILER MATCHES ".*/ccache/.*" OR 48 | # Then comparing the highest version supported by the CUDA SDK with the 49 | # version of the default compiler. 50 | ${_max_gcc_version_supported} VERSION_LESS ${GCC_COMPILER_VERSION}) 51 | 52 | if(${GCC_COMPILER_VERSION} VERSION_LESS ${_max_gcc_version_supported}) 53 | set(_max_gcc_version_supported ${GCC_COMPILER_VERSION}) 54 | endif() 55 | 56 | # Finding a suitable compiler 57 | find_program(_gcc_binary gcc-${_max_gcc_version_supported}) 58 | if(NOT _gcc_binary) 59 | # RHEL package mantainers use this naming convention for symbolic links 60 | find_program(_gcc_binary gcc${_maxgccversionsupported}) 61 | endif() 62 | 63 | macro(CHECK_GCC_VERSION) 64 | execute_process(COMMAND ${_gcc_binary} -dumpversion 65 | OUTPUT_VARIABLE _gcc_version OUTPUT_STRIP_TRAILING_WHITESPACE) 66 | # Reducing the version number to 1 or 2 digits depending on how 67 | # host_config.h checks the version. 68 | if (${_max_gcc_version_supported} MATCHES "[0-9]+\\.[0-9]+") 69 | string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1.\\2" 70 | _gcc_version "${_gcc_version}") 71 | else() 72 | string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1" 73 | _gcc_version "${_gcc_version}") 74 | endif() 75 | if(${_gcc_version} VERSION_GREATER ${_max_gcc_version_supported}) 76 | unset(_gcc_binary CACHE) 77 | endif() 78 | endmacro() 79 | 80 | if(NOT _gcc_binary) 81 | # Try with the default compiler on the path. 82 | # This is needed for example when not using a system level binary. 83 | find_program(_gcc_binary gcc) 84 | check_gcc_version() 85 | 86 | if(NOT _gcc_binary) 87 | # Finally try with the default system compiler. 88 | find_program(_gcc_binary gcc PATHS /usr/bin NO_DEFAULT_PATH) 89 | check_gcc_version() 90 | endif() 91 | endif() 92 | 93 | if(NOT _gcc_binary) 94 | message(WARNING "A version of gcc compatible with CUDA ${CUDA_VERSION} was not found.") 95 | else() 96 | set(CUDA_HOST_COMPILER ${_gcc_binary} PARENT_SCOPE) 97 | endif() 98 | unset(_gcc_binary CACHE) 99 | endif() 100 | 101 | endfunction() 102 | 103 | # CUDA compile flags 104 | function(common_cuda_compile_options) 105 | if(CUDA_VERSION VERSION_LESS 6.0) 106 | set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -arch=sm_11" PARENT_SCOPE) 107 | else() 108 | set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -arch=sm_20" PARENT_SCOPE) 109 | endif() 110 | endfunction() 111 | 112 | # find CUDA capable device 113 | function(find_cuda_device) 114 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hasCudaDevice.cpp 115 | "#include 116 | int main() 117 | { 118 | int deviceCount = 0; 119 | if( cudaGetDeviceCount( &deviceCount ) != cudaSuccess ) 120 | deviceCount = 0; 121 | return deviceCount > 0 ? 0 : 1; 122 | }") 123 | 124 | try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR 125 | ${CMAKE_CURRENT_BINARY_DIR}/hasCudaDevice 126 | SOURCES ${CMAKE_CURRENT_BINARY_DIR}/hasCudaDevice.cpp 127 | CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS} 128 | -DLINK_LIBRARIES=${CUDA_LIBRARIES} 129 | COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT_VAR 130 | RUN_OUTPUT_VARIABLE RUN_OUTPUT_VAR) 131 | if(COMPILE_RESULT_VAR AND NOT RUN_RESULT_VAR) 132 | set(CUDA_DEVICE_FOUND TRUE PARENT_SCOPE) 133 | endif() 134 | endfunction() 135 | -------------------------------------------------------------------------------- /CommonCheckTargets.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 Daniel.Nachbaur@epfl.ch 2 | # 3 | # Provide the function common_check_targets to add check targets (clangcheck, 4 | # cppcheck, cpplint) to the given target. 5 | # 6 | # CMake options: 7 | # - COMMON_ENABLE_STATIC_TESTS to enable the checks 8 | 9 | option(COMMON_ENABLE_STATIC_TESTS "Enable static code analysis test targets" OFF) 10 | 11 | include(GetSourceFilesFromTarget) 12 | include(CommonClangCheck) 13 | include(CommonCPPCheck) 14 | include(CommonCPPLint) 15 | 16 | function(common_check_targets _name) 17 | if(NOT COMMON_ENABLE_STATIC_TESTS) 18 | return() 19 | endif() 20 | 21 | # Qt moc & qrc files, C and Objective-C files 22 | set(_exclude_pattern ".*moc_|.*qrc_.*\\.c.*|.*\\.mm.*$") 23 | 24 | # Get the list of files once for all check targets 25 | get_source_files(${_name} ${_exclude_pattern}) 26 | if(NOT ${_name}_FILES) 27 | return() 28 | endif() 29 | 30 | common_clangcheck(${_name} FILES ${${_name}_FILES}) 31 | common_cppcheck(${_name} FILES ${${_name}_FILES} 32 | POSSIBLE_ERROR FAIL_ON_WARNINGS) 33 | common_cpplint(${_name} FILES ${${_name}_FILES} CATEGORY_FILTER_OUT readability/streams) 34 | endfunction() 35 | -------------------------------------------------------------------------------- /CommonClangCheck.cmake: -------------------------------------------------------------------------------- 1 | # - Run clang-check on c++ source files as a custom target and a test 2 | # 3 | # include(clangcheckTargets) 4 | # common_clangcheck( [FILES] [EXCLUDE_PATTERN]) - 5 | # Create a target to check a target's sources with clang-check and the 6 | # indicated options 7 | 8 | if(TARGET ${_name}_clangcheck) 9 | return() 10 | endif() 11 | 12 | include(CMakeParseArguments) 13 | include(GetSourceFilesFromTarget) 14 | 15 | if(NOT CLANGCHECK) 16 | find_program(CLANGCHECK clang-check) 17 | endif() 18 | 19 | if(NOT CLANGCHECK) 20 | if(NOT TARGET clangcheck) 21 | add_custom_target(clangcheck COMMENT "clang-check executable not found") 22 | set_target_properties(clangcheck PROPERTIES 23 | EXCLUDE_FROM_DEFAULT_BUILD ON) 24 | endif() 25 | endif() 26 | 27 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # write compile_commands.json for clangcheck 28 | 29 | if(NOT TARGET clangcheck) 30 | add_custom_target(clangcheck) 31 | endif() 32 | 33 | function(common_clangcheck _name) 34 | if(NOT CLANGCHECK) 35 | return() 36 | endif() 37 | 38 | set(_clangcheck_args -p "${PROJECT_BINARY_DIR}" -analyze -fixit 39 | -extra-arg=-Qunused-arguments ${CLANGCHECK_EXTRA_ARGS}) 40 | 41 | cmake_parse_arguments(common_clangcheck "" "EXCLUDE_PATTERN" "FILES" ${ARGN}) 42 | if(NOT common_clangcheck_EXCLUDE_PATTERN) 43 | set(common_clangcheck_EXCLUDE_PATTERN "^$") # Empty string regex 44 | endif() 45 | 46 | set(_files ${common_clangcheck_FILES}) 47 | if(NOT _files) 48 | get_source_files(${_name} ${common_clangcheck_EXCLUDE_PATTERN}) 49 | if(NOT ${_name}_FILES) # nothing to check 50 | return() 51 | endif() 52 | set(_files ${${_name}_FILES}) 53 | endif() 54 | 55 | if(COMMON_ENABLE_CLANGCHECK_TESTS) 56 | add_test(NAME ${_name}-clangcheck-test 57 | COMMAND "${CLANGCHECK}" ${_clangcheck_args} ${_files} 58 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") 59 | 60 | set_tests_properties(${_name}-clangcheck-test 61 | PROPERTIES FAIL_REGULAR_EXPRESSION " (warning|error): ") 62 | endif() 63 | 64 | add_custom_target(${_name}-clangcheck 65 | COMMAND ${CLANGCHECK} ${_clangcheck_args} ${_files} 66 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 67 | COMMENT "Running clangcheck on target ${_name}..." 68 | VERBATIM) 69 | add_dependencies(clangcheck ${_name}-clangcheck) 70 | set_target_properties(${_name}-clangcheck PROPERTIES 71 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests) 72 | endfunction() 73 | -------------------------------------------------------------------------------- /CommonConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Generated by CommonPackageConfig.cmake 2 | 3 | # if target already exists (subproject build), no need to find any dependencies 4 | if(TARGET @PROJECT_NAME@_ALIAS) 5 | list(APPEND CMAKE_MODULE_PATH "@CMAKE_CURRENT_BINARY_DIR@/@CMAKE_MODULE_INSTALL_PATH@") 6 | else() 7 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") 8 | 9 | @DEPENDENT_LIBRARIES@ 10 | if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 11 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 12 | endif() 13 | endif() 14 | 15 | if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/options.cmake") 16 | include("${CMAKE_CURRENT_LIST_DIR}/options.cmake") 17 | endif() 18 | -------------------------------------------------------------------------------- /CommonDate.cmake: -------------------------------------------------------------------------------- 1 | # sets COMMON_DATE to today 2 | if(NOT COMMON_DATE) 3 | if(WIN32) 4 | execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE COMMON_DATE) 5 | else() 6 | execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE COMMON_DATE) 7 | endif() 8 | string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" 9 | COMMON_DATE ${COMMON_DATE}) 10 | endif() 11 | -------------------------------------------------------------------------------- /CommonGraph.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Stefan.Eilemann@epfl.ch 2 | # Raphael.Dumusc@epfl.ch 3 | # 4 | # Provides functions to generate .png dependency graph images using graphviz: 5 | # common_graph_dep(From To Required Source): 6 | # Write a dependency From->To into global properties, called by 7 | # common_find_package() and add_subproject(). 8 | # common_graph(Name): 9 | # Write .dot from the global properties and add Name-graph target, called by 10 | # common_find_package_post(). 11 | # 12 | # CMake options: 13 | # * COMMON_GRAPH_SHOW_EXTERNAL include external dependencies in graphs. 14 | # * COMMON_GRAPH_SHOW_OPTIONAL include optional dependencies in graphs. 15 | # * COMMON_GRAPH_SHOW_NOTFOUND include missing dependencies in graphs. 16 | # 17 | # Targets generated: 18 | # * graphs: generate .png graphs for all (sub)projects. 19 | # * ${PROJECT_NAME}-graph generate a .png graph for the project. 20 | 21 | include(CommonTarget) 22 | if(COMMON_GRAPH_DONE) 23 | return() 24 | endif() 25 | set(COMMON_GRAPH_DONE ON) 26 | 27 | option(COMMON_GRAPH_SHOW_EXTERNAL "Include external dependencies in graphs" ON) 28 | option(COMMON_GRAPH_SHOW_OPTIONAL "Include optional dependencies in graphs" ON) 29 | option(COMMON_GRAPH_SHOW_NOTFOUND "Include missing dependencies in graphs" ON) 30 | 31 | find_program(DOT_EXECUTABLE dot) 32 | find_program(TRED_EXECUTABLE tred) 33 | 34 | function(common_graph_dep From To) 35 | # Parse function arguments 36 | set(__options SOURCE REQUIRED NOTFOUND TOPLEVEL) 37 | set(__oneValueArgs) 38 | set(__multiValueArgs) 39 | cmake_parse_arguments(__dep "${__options}" "${__oneValueArgs}" "${__multiValueArgs}" ${ARGN}) 40 | 41 | if(NOT __dep_SOURCE AND NOT COMMON_GRAPH_SHOW_EXTERNAL) 42 | return() 43 | endif() 44 | if(NOT __dep_REQUIRED AND NOT COMMON_GRAPH_SHOW_OPTIONAL) 45 | return() 46 | endif() 47 | if(__dep_NOTFOUND AND NOT COMMON_GRAPH_SHOW_NOTFOUND) 48 | return() 49 | endif() 50 | 51 | string(REPLACE "-" "_" Title ${From}) 52 | string(REPLACE "-" "_" Dep ${To}) 53 | # prevent syntax error in tred, e.g. Magick++ -> MagickPP 54 | string(REPLACE "+" "P" Title ${Title}) 55 | string(REPLACE "+" "P" Dep ${Dep}) 56 | 57 | if(__dep_SOURCE) 58 | set(_style "style=bold") 59 | elseif(__dep_REQUIRED) 60 | set(_style "style=solid") 61 | elseif(__dep_NOTFOUND) 62 | set(_style "style=dotted") 63 | else() 64 | set(_style "style=dashed") 65 | endif() 66 | 67 | if(__dep_NOTFOUND) 68 | set(_linestyle "style=dotted") 69 | elseif(__dep_SOURCE AND __dep_REQUIRED) 70 | set(_linestyle "style=bold") 71 | elseif(__dep_REQUIRED) 72 | set(_linestyle "style=solid") 73 | else() 74 | set(_linestyle "style=dashed") 75 | endif() 76 | 77 | if(__dep_TOPLEVEL) 78 | set_property(GLOBAL APPEND_STRING PROPERTY ${From}_COMMON_GRAPH 79 | "${Dep} [${_style}, label=\"${To}\"]\n") 80 | else() 81 | set_property(GLOBAL APPEND_STRING PROPERTY ${From}_COMMON_GRAPH 82 | "${Title} [style=bold, label=\"${From}\"]\n" 83 | "${Dep} [${_style}, label=\"${To}\"]\n" 84 | "\"${Dep}\" -> \"${Title}\" [${_linestyle}]\n") 85 | endif() 86 | set_property(GLOBAL APPEND PROPERTY ${From}_COMMON_GRAPH_DEPENDS ${To}) 87 | endfunction() 88 | 89 | function(common_graph Name) 90 | if(NOT DOT_EXECUTABLE OR NOT TRED_EXECUTABLE) 91 | return() 92 | endif() 93 | 94 | # collect graph recursively for all dependencies of Name 95 | get_property(_graph GLOBAL PROPERTY ${Name}_COMMON_GRAPH) 96 | get_property(_dependencies GLOBAL PROPERTY ${Name}_COMMON_GRAPH_DEPENDS) 97 | list(LENGTH _dependencies nDepends) 98 | 99 | set(_loop_count 0) 100 | while(nDepends) 101 | list(GET _dependencies 0 dependency) 102 | list(REMOVE_AT _dependencies 0) 103 | 104 | get_property(_dep_graph GLOBAL PROPERTY ${dependency}_COMMON_GRAPH) 105 | set(_graph "${_dep_graph} ${_graph}") 106 | 107 | get_property(_dep_depends GLOBAL PROPERTY 108 | ${dependency}_COMMON_GRAPH_DEPENDS) 109 | foreach(dep ${_dep_depends}) 110 | list(FIND _dependencies ${dep} _found) 111 | if(_found EQUAL "-1") 112 | list(APPEND _dependencies ${dep}) 113 | endif() 114 | endforeach() 115 | list(LENGTH _dependencies nDepends) 116 | 117 | # prevent infinite looping in the case of circular dependencies 118 | MATH(EXPR _loop_count "${_loop_count}+1") 119 | if(_loop_count GREATER 1000) 120 | message(WARNING "CommonGraph detected a probable circular dependency") 121 | return() 122 | endif() 123 | endwhile() 124 | 125 | set(_dot_file ${CMAKE_CURRENT_BINARY_DIR}/${Name}.dot) 126 | file(GENERATE OUTPUT ${_dot_file} 127 | CONTENT "strict digraph G { rankdir=\"RL\"; ${_graph} }") 128 | 129 | set(_tred_dot_file ${CMAKE_CURRENT_BINARY_DIR}/${Name}_tred.dot) 130 | add_custom_command(OUTPUT ${_tred_dot_file} 131 | COMMAND ${TRED_EXECUTABLE} ${_dot_file} > ${_tred_dot_file} 132 | DEPENDS ${_dot_file}) 133 | 134 | set(_image_folder ${PROJECT_BINARY_DIR}/doc/images) 135 | set(_image_file ${_image_folder}/${Name}.png) 136 | add_custom_command(OUTPUT ${_image_file} 137 | COMMAND ${CMAKE_COMMAND} -E make_directory ${_image_folder} 138 | COMMAND ${DOT_EXECUTABLE} -o ${_image_file} -Tpng ${_tred_dot_file} 139 | DEPENDS ${_tred_dot_file}) 140 | 141 | add_custom_target(${Name}-graph DEPENDS ${_image_file}) 142 | set_target_properties(${Name}-graph PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON 143 | FOLDER ${Name}/doxygen) 144 | common_target(graphs doxygen) 145 | add_dependencies(graphs ${Name}-graph) 146 | endfunction() 147 | -------------------------------------------------------------------------------- /CommonHelp.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Stefan.Eilemann@epfl.ch 2 | # Raphael.Dumusc@epfl.ch 3 | # 4 | # Generate help page for doxygen by running Name application with --help: 5 | # common_help( [LOCATION location]) 6 | # 7 | # Arguments: 8 | # * Name: an existing application target 9 | # * LOCATION: (Optional) location of the application for custom targets such as 10 | # python scripts. For EXECUTABLE targets $ is used by 11 | # default. 12 | # 13 | # Output Global Properties: 14 | # * ${PROJECT_NAME}_HELP help page names generated (see DoxygenRule.cmake) 15 | # 16 | # Targets generated: 17 | # * ${Name}-help to generate the help file for a given application 18 | # * ${PROJECT_NAME}-help to generate the help for the current project 19 | 20 | include(CMakeParseArguments) 21 | include(CommonTarget) 22 | 23 | function(common_help Name) 24 | set(_opts) 25 | set(_singleArgs LOCATION) 26 | set(_multiArgs) 27 | cmake_parse_arguments(THIS "${_opts}" "${_singleArgs}" "${_multiArgs}" 28 | ${ARGN}) 29 | 30 | # run binary with --help to capture output for doxygen 31 | set(_doc "${PROJECT_BINARY_DIR}/help/${Name}.md") 32 | set(_cmake "${CMAKE_CURRENT_BINARY_DIR}/${Name}.cmake") 33 | file(WRITE ${_cmake} " 34 | execute_process(COMMAND \${APP} --help TIMEOUT 5 RESULT_VARIABLE _result 35 | OUTPUT_VARIABLE _help_content OUTPUT_STRIP_TRAILING_WHITESPACE 36 | ERROR_VARIABLE _error ERROR_STRIP_TRAILING_WHITESPACE 37 | ) 38 | if(NOT _result EQUAL 0 OR NOT _help_content) 39 | message(FATAL_ERROR \"${Name} is missing --help\n\${_error}\") 40 | endif() 41 | file(WRITE ${_doc} \"${Name} {#${Name}} 42 | ============ 43 | 44 | ``` 45 | \${_help_content} 46 | ``` 47 | \") 48 | ") 49 | 50 | if(THIS_LOCATION) 51 | set(_app ${THIS_LOCATION}) 52 | else() 53 | get_property(_type TARGET ${Name} PROPERTY TYPE) 54 | if(_type STREQUAL "EXECUTABLE") 55 | set(_app $) 56 | else() 57 | message(FATAL_ERROR "common_help(${Name}): application location not " 58 | "provided for custom target") 59 | endif() 60 | endif() 61 | 62 | add_custom_command(OUTPUT ${_doc} 63 | COMMAND ${CMAKE_COMMAND} -DAPP=${_app} -P ${_cmake} 64 | DEPENDS ${Name} COMMENT "Creating help for ${Name}") 65 | add_custom_target(${Name}-help DEPENDS ${_doc}) 66 | set_target_properties(${Name}-help PROPERTIES 67 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/doxygen) 68 | 69 | set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_HELP ${Name}) 70 | 71 | if(NOT TARGET ${PROJECT_NAME}-help) 72 | add_custom_target(${PROJECT_NAME}-help) 73 | set_target_properties(${PROJECT_NAME}-help PROPERTIES 74 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/doxygen) 75 | endif() 76 | add_dependencies(${PROJECT_NAME}-help ${Name}-help) 77 | endfunction() 78 | -------------------------------------------------------------------------------- /CommonInstall.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 Stefan.Eilemann@epfl.ch 2 | 3 | # Uses a compatible subset of the install() syntax, but can install 4 | # files while preserving their relative directory, and additionally 5 | # installing them into the PROJECT_BINARY_DIR or CMAKE_BINARY_DIR for 6 | # compatibility with superprojects. Files with an absolute filename 7 | # are installed directly into the DESTINATION, that is, their 8 | # directory is not preserved. If RELATIVE is set, directories are 9 | # ignored on all files. 10 | # 11 | # Usage: common_install(FILES [COMPONENT ] [DESTINATION ] 12 | # [RELATIVE] [CMAKE_BINARY_DIR]) 13 | 14 | include(CMakeParseArguments) 15 | 16 | function(COMMON_INSTALL) 17 | set(OPT_NAMES RELATIVE CMAKE_BINARY_DIR) 18 | set(ARG_NAMES COMPONENT DESTINATION) 19 | set(ARGS_NAMES FILES) 20 | cmake_parse_arguments(THIS "${OPT_NAMES}" "${ARG_NAMES}" "${ARGS_NAMES}" 21 | ${ARGN}) 22 | 23 | if(THIS_COMPONENT) 24 | set(THIS_COMPONENT COMPONENT ${THIS_COMPONENT}) 25 | endif() 26 | if(NOT THIS_DESTINATION) 27 | set(THIS_DESTINATION ".") 28 | endif() 29 | set(THIS_BINARY_DIR "${PROJECT_BINARY_DIR}") 30 | if(THIS_CMAKE_BINARY_DIR) 31 | set(THIS_BINARY_DIR "${CMAKE_BINARY_DIR}") 32 | endif() 33 | 34 | foreach(FILE ${THIS_FILES}) 35 | if(IS_ABSOLUTE ${FILE} OR THIS_RELATIVE) 36 | set(DIR) 37 | else() 38 | string(REGEX MATCH "(.*)[/\\]" DIR ${FILE}) 39 | endif() 40 | get_filename_component(BASENAME ${FILE} NAME) 41 | 42 | install(FILES ${FILE} DESTINATION ${THIS_DESTINATION}/${DIR} 43 | ${THIS_COMPONENT}) 44 | configure_file(${FILE} 45 | ${THIS_BINARY_DIR}/${THIS_DESTINATION}/${DIR}/${BASENAME} COPYONLY) 46 | endforeach() 47 | endfunction() 48 | -------------------------------------------------------------------------------- /CommonInstallProject.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Stefan.Eilemann@epfl.ch 2 | # 3 | # Generates ${PROJECT_NAME}-install rule. Adds common_add_install_dependencies 4 | # function which takes a list of dependencies and adds their install target to 5 | # the project install, if available. 6 | # 7 | # This rule is for targets which depend on the installed artefacts, e.g., 8 | # doxygen and smoke tests. CMake does not provide this, so this is a workaround. 9 | # install naturally depends on all, which depends on all common_library and 10 | # common_application targets. Furthermore, ${PROJECT_NAME}-install depends on 11 | # all subprojects which have an install rule, so that all necessary artefacts in 12 | # a superproject build are installed. The list of subprojects is extracted from 13 | # ${PROJECT_NAME}_FIND_PACKAGES_FOUND, set by common_find_package. 14 | 15 | if(NOT TARGET ${PROJECT_NAME}-install) 16 | add_custom_target(${PROJECT_NAME}-install 17 | ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/cmake_install.cmake 18 | DEPENDS ${PROJECT_NAME}-all) 19 | set_target_properties(${PROJECT_NAME}-install PROPERTIES 20 | EXCLUDE_FROM_DEFAULT_BUILD ON) 21 | endif() 22 | 23 | function(COMMON_ADD_INSTALL_DEPENDENCIES) 24 | foreach(__dep ${ARGN}) 25 | if(TARGET ${PROJECT_NAME}-install AND TARGET ${__dep}-install) 26 | add_dependencies(${PROJECT_NAME}-install ${__dep}-install) 27 | endif() 28 | endforeach() 29 | endfunction() 30 | -------------------------------------------------------------------------------- /CommonPackageConfig.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 Daniel.Nachbaur@epfl.ch 2 | # 3 | # Write ${PROJECT_NAME}ConfigVersion.cmake, ${PROJECT_NAME}Config.cmake, and 4 | # ${PROJECT_NAME}Targets.cmake like CMake suggests to create a 'package' that 5 | # can be found by downstream projects, either from the build tree (subproject) 6 | # or from the install tree (package/module). 7 | # http://www.cmake.org/cmake/help/v3.1/manual/cmake-packages.7.html#creating-packages 8 | # 9 | # Uses: 10 | # * ${UPPER_PROJECT_NAME}_DEPENDENT_LIBRARIES - list of 'leaking'/public 11 | # dependent libraries that need to be 'found' first to provide targets that 12 | # this project is depending on. Usually this matches the list of targets that 13 | # are used PUBLIC in target_link_libraries(). 14 | # * ${PROJECT_NAME}Targets - the set of targets to export, added by 15 | # CommonLibrary.cmake 16 | 17 | # Generate ${PROJECT_NAME}ConfigVersion.cmake 18 | include(CMakePackageConfigHelpers) 19 | write_basic_package_version_file( 20 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" 21 | COMPATIBILITY SameMajorVersion 22 | ) 23 | 24 | # Add find_dependency calls for leaking dependent libraries to 25 | # ${PROJECT_NAME}Config.cmake 26 | if(${UPPER_PROJECT_NAME}_DEPENDENT_LIBRARIES) 27 | set(DEPENDENT_LIBRARIES 28 | " # find dependent libraries which provide dependent targets\n" 29 | " include(CMakeFindDependencyMacro)\n") 30 | 31 | foreach(_dependent ${${UPPER_PROJECT_NAME}_DEPENDENT_LIBRARIES}) 32 | list(APPEND DEPENDENT_LIBRARIES " find_dependency(${_dependent})\n") 33 | endforeach() 34 | string(REGEX REPLACE ";" " " DEPENDENT_LIBRARIES ${DEPENDENT_LIBRARIES}) 35 | endif() 36 | 37 | # Generate ${PROJECT_NAME}Config.cmake; is consumed by any find_package() call 38 | # to this project. Does an inclusion of ${PROJECT_NAME}Targets.cmake if the 39 | # target ${PROJECT_NAME} is not defined, which should only be the case when 40 | # finding this project from the install tree. 41 | configure_package_config_file("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake.in" 42 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" 43 | INSTALL_DESTINATION ${CMAKE_MODULE_INSTALL_PATH} 44 | ) 45 | 46 | install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" 47 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" 48 | DESTINATION ${CMAKE_MODULE_INSTALL_PATH} 49 | ) 50 | 51 | if(NOT TARGET ${PROJECT_NAME}_ALIAS) 52 | return() 53 | endif() 54 | 55 | # Generate ${PROJECT_NAME}Targets.cmake; is written after the CMake run 56 | # succeeds. Provides IMPORTED targets when using this project from the install 57 | # tree. 58 | export(EXPORT ${PROJECT_NAME}Targets 59 | FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake" 60 | ) 61 | 62 | install(EXPORT ${PROJECT_NAME}Targets FILE ${PROJECT_NAME}Targets.cmake 63 | DESTINATION ${CMAKE_MODULE_INSTALL_PATH} 64 | ) 65 | -------------------------------------------------------------------------------- /CommonPythonCTest.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Juan Hernando 2 | # 3 | # Creates a per project pythontests target. 4 | # This target creates a test for each .py file in the current 5 | # directory tree. The per project target is included into the global 6 | # 'tests' from CommonCTest.cmake. 7 | # 8 | # Input: 9 | # * PYTHON_TEST_DEPENDENCIES targets that are required by the tests 10 | # * PYTHON_TEST_EXCLUDE relative paths to test files to exclude; optional 11 | # Output: 12 | # * PYTHON_TEST_OUTPUT_PATH the output path where python tests are copied to 13 | # in the build dir. Additional modules can be placed in that destination 14 | # directory if needed by the tests. 15 | 16 | set(PYTHON_TEST_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/python) 17 | 18 | file(GLOB_RECURSE TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR} *.py) 19 | foreach(FILE ${PYTHON_TEST_EXCLUDE}) 20 | list(REMOVE_ITEM TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) 21 | endforeach() 22 | list(SORT TEST_FILES) 23 | 24 | function(common_add_python_test TEST_SOURCE) 25 | 26 | get_filename_component(BASENAME ${TEST_SOURCE} NAME) 27 | set(TEST_FILE ${PYTHON_TEST_OUTPUT_PATH}/${BASENAME}) 28 | string(REGEX REPLACE "(.*)\\.py" "\\1" BASENAME "${BASENAME}") 29 | set(TEST_NAME ${PROJECT_NAME}-python-${BASENAME}) 30 | 31 | add_custom_command(OUTPUT ${TEST_FILE} 32 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TEST_SOURCE} ${TEST_FILE} 33 | DEPENDS ${TEST_SOURCE}) 34 | 35 | add_test(NAME ${TEST_NAME} COMMAND ${PYTHON_EXECUTABLE} ${TEST_FILE}) 36 | 37 | add_custom_target(ctest_${TEST_NAME} 38 | COMMAND ${CMAKE_CTEST_COMMAND} -T test --no-compress-output 39 | -R '^${TEST_NAME}$$' -C $ \${ARGS} 40 | DEPENDS ${PYTHON_TEST_DEPENDENCIES} ${TEST_FILE} 41 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 42 | COMMENT "Running ${TEST_NAME} python test") 43 | set_target_properties(ctest_${TEST_NAME} PROPERTIES 44 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER "Tests") 45 | 46 | set(ALL_PYTHON_TESTS ${ALL_PYTHON_TESTS} ctest_${TEST_NAME} PARENT_SCOPE) 47 | endfunction() 48 | 49 | set(ALL_PYTHON_TESTS) 50 | foreach(TEST_FILE ${TEST_FILES}) 51 | common_add_python_test(${TEST_FILE}) 52 | endforeach() 53 | 54 | if(NOT ALL_PYTHON_TESTS) 55 | return() 56 | endif() 57 | 58 | if(NOT TARGET ${PROJECT_NAME}-pythontests) 59 | add_custom_target(${PROJECT_NAME}-pythontests) 60 | set_target_properties(${PROJECT_NAME}-pythontests PROPERTIES 61 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER "Tests") 62 | 63 | if(NOT TARGET ${PROJECT_NAME}-tests) 64 | add_custom_target(${PROJECT_NAME}-tests) 65 | endif() 66 | add_dependencies(${PROJECT_NAME}-tests ${PROJECT_NAME}-pythontests) 67 | add_dependencies(tests ${PROJECT_NAME}-tests) 68 | endif() 69 | 70 | add_dependencies(${PROJECT_NAME}-pythontests ${ALL_PYTHON_TESTS}) 71 | -------------------------------------------------------------------------------- /CommonSmokeTest.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Stefan.Eilemann@epfl.ch 2 | 3 | # Create a smoke test target for the given target executable, 4 | # running it from the installation folder with the given arguments as a smoke 5 | # test to check installation: 6 | # common_smoke_test( [args]) 7 | # 8 | # Output targets 9 | # - smoketests: run all smoke tests of the given (sub)project 10 | # - -smoketests: run all smoke tests of the given (sub)project 11 | # - -smoketest: run the given smoke test 12 | 13 | if(NOT TARGET smoketests) 14 | add_custom_target(smoketests) 15 | set_target_properties(smoketests PROPERTIES 16 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests) 17 | endif() 18 | 19 | if(NOT TARGET ${PROJECT_NAME}-smoketests) 20 | add_custom_target(${PROJECT_NAME}-smoketests) 21 | set_target_properties(${PROJECT_NAME}-smoketests PROPERTIES 22 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests) 23 | add_dependencies(smoketests ${PROJECT_NAME}-smoketests) 24 | endif() 25 | 26 | function(common_smoke_test Target) 27 | set(_cmake "${CMAKE_CURRENT_BINARY_DIR}/${Target}.smoke.cmake") 28 | file(WRITE ${_cmake} " 29 | set(ENV{LD_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib:\$ENV{LD_LIBRARY_PATH}) 30 | set(ENV{DYLD_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib:\$ENV{DYLD_LIBRARY_PATH}) 31 | execute_process(COMMAND \${APP} ${ARGN} TIMEOUT 60 32 | OUTPUT_VARIABLE _output ERROR_VARIABLE _output RESULT_VARIABLE _result) 33 | if(NOT _result EQUAL 0) 34 | message(FATAL_ERROR \"${Target} failed to run:\${_output}\") 35 | endif() 36 | ") 37 | 38 | set(_app $) 39 | get_target_property(_isMacGUI ${Target} MACOSX_BUNDLE_INFO_PLIST) 40 | if(_isMacGUI) 41 | set(_app ${_app}.app/Contents/MacOS/${_app}) 42 | endif() 43 | 44 | add_custom_target(${Target}-smoketest DEPENDS ${PROJECT_NAME}-install 45 | COMMAND ${CMAKE_COMMAND} -DAPP="${CMAKE_INSTALL_PREFIX}/bin/${_app}" -P ${_cmake} 46 | COMMENT "Running smoke test ${Name}" 47 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests) 48 | add_dependencies(${PROJECT_NAME}-smoketests ${Target}-smoketest) 49 | endfunction() 50 | -------------------------------------------------------------------------------- /CommonTarget.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Create an empty target, exclude it from the default build, and add it to 3 | # the given IDE folder 4 | 5 | macro(common_target NAME FOLDER) 6 | if(NOT TARGET ${NAME}) 7 | add_custom_target(${NAME}) 8 | set_target_properties(${NAME} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON 9 | FOLDER ${NAME}/${FOLDER}) 10 | endif() 11 | endmacro() 12 | -------------------------------------------------------------------------------- /CoverageGcovr.cmake: -------------------------------------------------------------------------------- 1 | # Gcovr code coverage reporting 2 | # - sets compiler flags to enable code coverage reporting (optional) 3 | # - provides a function(add_gcovr_targets) to add 'coverage' targets 4 | # 5 | # CMake options: 6 | # ENABLE_GCOVR Must be explicitly enabled by the user since adding code 7 | # coverage compiler flags may break downstream projects. 8 | # Ex: cmake . -DENABLE_GCOVR=ON 9 | # Warning: THIS CHANGES CMAKE_C_FLAGS_DEBUG/CMAKE_CXX_FLAGS_DEBUG 10 | # 11 | # add_gcovr_targets(TARGET GCOVR_EXCLUDE) 12 | # Input variables: 13 | # * GCOVR_EXCLUDE List of files to exclude from the coverage report 14 | # 15 | # Targets generated: 16 | # * gcovr_html_${PROJECT_NAME} generate a HTML report for a specific project 17 | # * gcovr_txt_${PROJECT_NAME} generate a XML report for a specific project 18 | # * gcovr_xml_${PROJECT_NAME} generate a XML report for a specific project 19 | # * gcovr run all coverage_${PROJECT_NAME} 20 | 21 | option(ENABLE_GCOVR "Enable code gcovr testing" OFF) 22 | 23 | set(__profiling_flags "-fprofile-arcs -ftest-coverage") 24 | 25 | if(ENABLE_GCOVR) 26 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG) 27 | find_program(GCOVR gcovr) 28 | if(NOT GCOVR) 29 | message(FATAL_ERROR "No code coverage report, ${COVERAGE_MISSING}") 30 | endif() 31 | 32 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${__profiling_flags}") 33 | set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${__profiling_flags}") 34 | endif() 35 | endif() 36 | 37 | macro(_gcovr_target) 38 | #ARGV0 is the output name 39 | #ARGV1 is the output command line argument 40 | if(NOT TARGET gcovr_${ARGV0}_${PROJECT_NAME}) 41 | add_custom_target(gcovr_${ARGV0}_${PROJECT_NAME} 42 | COMMAND ${GCOVR} -s -r ${CMAKE_SOURCE_DIR} ${__gcovr_exclude} ${ARGV1} 43 | -o gcovr.${ARGV0} 44 | COMMENT "Creating ${ARGV0} coverage report" 45 | WORKING_DIRECTORY ${PROJECT_BINARY_DIR} 46 | ) 47 | endif() 48 | add_dependencies(gcovr_${ARGV0}_${PROJECT_NAME} ${TEST_TARGET}) 49 | endmacro() 50 | 51 | function(add_gcovr_targets TEST_TARGET GCOVR_EXCLUDE) 52 | foreach(__exclude ${GCOVR_EXCLUDE}) 53 | set(__gcovr_exclude ${__gcovr_exclude} "--exclude=${__exclude}") 54 | endforeach() 55 | 56 | _gcovr_target(txt "") 57 | _gcovr_target(xml --xml) 58 | _gcovr_target(html --html) 59 | 60 | if(NOT TARGET gcovr) 61 | add_custom_target(gcovr) 62 | endif() 63 | add_dependencies(gcovr gcovr_txt_${PROJECT_NAME}) 64 | add_dependencies(gcovr gcovr_xml_${PROJECT_NAME}) 65 | add_dependencies(gcovr gcovr_html_${PROJECT_NAME}) 66 | endfunction() 67 | -------------------------------------------------------------------------------- /FindAIO.cmake: -------------------------------------------------------------------------------- 1 | # Try to find AIO 2 | # Once done, this will define 3 | # 4 | # AIO_FOUND - system has AIO 5 | # AIO_INCLUDE_DIR - the AIO include directories 6 | # AIO_LIBRARIES - link these to use AIO 7 | 8 | if(AIO_INCLUDE_DIR AND AIO_LIBRARIES) 9 | set(AIO_FIND_QUIETLY TRUE) 10 | endif(AIO_INCLUDE_DIR AND AIO_LIBRARIES) 11 | 12 | # include dir 13 | find_path(AIO_INCLUDE_DIR libaio.h) 14 | 15 | # finally the library itself 16 | find_library(LIBAIO NAMES aio) 17 | set(AIO_LIBRARIES ${LIBAIO}) 18 | # handle the QUIETLY and REQUIRED arguments and set AIO_FOUND to TRUE if 19 | # all listed variables are TRUE 20 | include(FindPackageHandleStandardArgs) 21 | find_package_handle_standard_args(AIO DEFAULT_MSG AIO_LIBRARIES AIO_INCLUDE_DIR) 22 | 23 | mark_as_advanced(AIO_LIBRARIES AIO_INCLUDE_DIR) 24 | -------------------------------------------------------------------------------- /FindAtlas.cmake: -------------------------------------------------------------------------------- 1 | # Copyright: (C) 2010 RobotCub Consortium 2 | # Authors: Arjan Gijsberts 3 | # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT 4 | 5 | # 6 | # Find the Atlas (and Lapack) libraries 7 | # 8 | SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) 9 | 10 | SET(ATLAS_POSSIBLE_INCLUDE_PATHS 11 | /usr/include 12 | /usr/include/atlas 13 | /usr/local/include 14 | $ENV{ATLAS_DIR} 15 | $ENV{ATLAS_DIR}/include 16 | ) 17 | 18 | # Ubuntu's package management does not handle blas elegantly, causing 19 | # many possible locations here. 20 | SET(ATLAS_POSSIBLE_LIBRARY_PATHS 21 | /usr/lib/libatlas-corei7sse3 22 | /usr/lib/atlas-amd64sse3 23 | /usr/lib/atlas-base 24 | /usr/lib64/atlas 25 | /usr/lib/sse2 26 | /usr/lib/sse 27 | /usr/local/lib/sse2 28 | /usr/local/lib/sse 29 | $ENV{ATLAS_DIR} 30 | $ENV{ATLAS_DIR}/lib 31 | /usr/lib 32 | /usr/lib64 33 | /usr/local/lib 34 | ) 35 | 36 | FIND_PATH(ATLAS_CBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${ATLAS_POSSIBLE_INCLUDE_PATHS}) 37 | FIND_PATH(ATLAS_CLAPACK_INCLUDE_DIR NAMES clapack.h PATHS ${ATLAS_POSSIBLE_INCLUDE_PATHS}) 38 | FIND_LIBRARY(ATLAS_CBLAS_LIBRARY NAMES ptcblas_r ptcblas cblas_r cblas PATHS ${ATLAS_POSSIBLE_LIBRARY_PATHS} NO_DEFAULT_PATH) 39 | FIND_LIBRARY(ATLAS_ATLAS_LIBRARY NAMES atlas_r atlas PATHS ${ATLAS_POSSIBLE_LIBRARY_PATHS} NO_DEFAULT_PATH) 40 | FIND_LIBRARY(ATLAS_LAPACK_ATLAS_LIBRARY NAMES alapack_r alapack lapack_atlas lapack PATHS ${ATLAS_POSSIBLE_LIBRARY_PATHS} NO_DEFAULT_PATH) 41 | FIND_LIBRARY(ATLAS_CLAPACK_ATLAS_LIBRARY NAMES calapack_r calapack clapack_atlas clapack PATHS ${ATLAS_POSSIBLE_LIBRARY_PATHS} NO_DEFAULT_PATH) 42 | 43 | SET(ATLAS_FOUND ON) 44 | 45 | FOREACH(INCDIR ATLAS_CBLAS_INCLUDE_DIR ATLAS_CLAPACK_INCLUDE_DIR) 46 | IF(${INCDIR}) 47 | SET(ATLAS_INCLUDE_DIR ${ATLAS_INCLUDE_DIR} ${${INCDIR}} ) 48 | ELSE(${INCDIR}) 49 | MESSAGE("${INCDIR} not found turning off ATLAS_FOUND") 50 | SET(ATLAS_FOUND OFF) 51 | ENDIF (${INCDIR}) 52 | ENDFOREACH(INCDIR) 53 | 54 | # could make LAPACK_ATLAS optional 55 | FOREACH(LIBNAME ATLAS_LAPACK_ATLAS_LIBRARY ATLAS_CLAPACK_ATLAS_LIBRARY ATLAS_CBLAS_LIBRARY ATLAS_ATLAS_LIBRARY) 56 | IF(${LIBNAME}) 57 | SET(ATLAS_LIBRARIES ${ATLAS_LIBRARIES} ${${LIBNAME}} ) 58 | ELSE(${LIBNAME}) 59 | MESSAGE("${LIBNAME} not found turning off ATLAS_FOUND") 60 | SET(ATLAS_FOUND OFF) 61 | ENDIF (${LIBNAME}) 62 | ENDFOREACH(LIBNAME) 63 | 64 | 65 | IF (ATLAS_FOUND) 66 | IF (NOT Atlas_FIND_QUIETLY) 67 | MESSAGE(STATUS "Found Atlas libraries: ${ATLAS_LIBRARIES}") 68 | MESSAGE(STATUS "Found Atlas include: ${ATLAS_INCLUDE_DIR}") 69 | ENDIF (NOT Atlas_FIND_QUIETLY) 70 | ELSE (ATLAS_FOUND) 71 | IF (Atlas_FIND_REQUIRED) 72 | MESSAGE(FATAL_ERROR "Could not find Atlas") 73 | ENDIF (Atlas_FIND_REQUIRED) 74 | ENDIF (ATLAS_FOUND) 75 | 76 | MARK_AS_ADVANCED( 77 | ATLAS_INCLUDE_DIR 78 | ATLAS_CBLAS_INCLUDE_DIR 79 | ATLAS_CLAPACK_INCLUDE_DIR 80 | ATLAS_LIBRARIES 81 | ATLAS_CBLAS_LIBRARY 82 | ATLAS_ATLAS_LIBRARY 83 | ATLAS_LAPACK_ATLAS_LIBRARY 84 | ATLAS_CLAPACK_ATLAS_LIBRARY 85 | ) 86 | 87 | set(Atlas_FOUND ${ATLAS_FOUND}) 88 | -------------------------------------------------------------------------------- /FindBlueZ.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find BlueZ 2 | # Find BlueZ headers, libraries and the answer to all questions. 3 | # 4 | # BLUEZ_FOUND True if BlueZ libraries got found 5 | # BLUEZ_INCLUDE_DIR Location of BlueZ headers 6 | # BLUEZ_LIBRARIES List of libaries to use BlueZ 7 | # 8 | # Copyright (c) 2007 Daniel Gollub 9 | # Copyright (c) 2007-2009 Bjoern Ricks 10 | # 11 | # Redistribution and use is allowed according to the terms of the New 12 | # BSD license. 13 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 14 | # 15 | 16 | INCLUDE( FindPkgConfig ) 17 | 18 | # Take care about bluez.pc settings 19 | IF ( BlueZ_FIND_REQUIRED ) 20 | SET( _pkgconfig_REQUIRED "REQUIRED" ) 21 | ELSE( BlueZ_FIND_REQUIRED ) 22 | SET( _pkgconfig_REQUIRED "" ) 23 | ENDIF ( BlueZ_FIND_REQUIRED ) 24 | 25 | IF ( BLUEZ_MIN_VERSION ) 26 | PKG_SEARCH_MODULE( BLUEZ ${_pkgconfig_REQUIRED} bluez>=${BLUEZ_MIN_VERSION} ) 27 | ELSE ( BLUEZ_MIN_VERSION ) 28 | PKG_SEARCH_MODULE( BLUEZ ${_pkgconfig_REQUIRED} bluez ) 29 | ENDIF ( BLUEZ_MIN_VERSION ) 30 | 31 | # Look for BlueZ include dir and libraries 32 | IF( NOT BLUEZ_FOUND AND NOT PKG_CONFIG_FOUND ) 33 | 34 | FIND_PATH( BLUEZ_INCLUDE_DIR bluetooth/bluetooth.h ) 35 | FIND_LIBRARY( BLUEZ_LIBRARIES bluetooth ) 36 | 37 | # Report results 38 | IF ( BLUEZ_LIBRARIES AND BLUEZ_INCLUDE_DIR ) 39 | SET( BLUEZ_FOUND 1 ) 40 | IF ( NOT BlueZ_FIND_QUIETLY ) 41 | MESSAGE( STATUS "Found BlueZ: ${BLUEZ_LIBRARIES}" ) 42 | ENDIF ( NOT BlueZ_FIND_QUIETLY ) 43 | ELSE ( BLUEZ_LIBRARIES AND BLUEZ_INCLUDE_DIR ) 44 | IF ( BlueZ_FIND_REQUIRED ) 45 | MESSAGE( SEND_ERROR "Could NOT find BLUEZ" ) 46 | ELSE ( BlueZ_FIND_REQUIRED ) 47 | IF ( NOT BlueZ_FIND_QUIETLY ) 48 | MESSAGE( STATUS "Could NOT find BLUEZ" ) 49 | ENDIF ( NOT BlueZ_FIND_QUIETLY ) 50 | ENDIF ( BlueZ_FIND_REQUIRED ) 51 | ENDIF ( BLUEZ_LIBRARIES AND BLUEZ_INCLUDE_DIR ) 52 | 53 | ENDIF( NOT BLUEZ_FOUND AND NOT PKG_CONFIG_FOUND ) 54 | 55 | # Hide advanced variables from CMake GUIs 56 | MARK_AS_ADVANCED( BLUEZ_LIBRARIES BLUEZ_INCLUDE_DIR ) 57 | 58 | -------------------------------------------------------------------------------- /FindBoostConfig.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2015, Stefan Eilemann 2 | # 2013-2015, Daniel Nachbaur 3 | # 2013-2015, Ahmet Bilgili 4 | # 2015, Raphael Dumuc 5 | # 6 | # Boost settings to ensure that the Boost finder works in some platforms 7 | # (e.g. RHEL 6.5) 8 | 9 | set(Boost_NO_BOOST_CMAKE ON CACHE BOOL "Enable fix for FindBoost.cmake" ) 10 | set(Boost_DETAILED_FAILURE_MSG ON) # Output which components are missing 11 | add_definitions(-DBOOST_ALL_NO_LIB) # Don't use 'pragma lib' on Windows 12 | add_definitions(-DBoost_NO_BOOST_CMAKE) # Fix for CMake problem in FindBoost 13 | if(NOT "$ENV{BOOST_ROOT}" STREQUAL "" OR 14 | NOT "$ENV{BOOST_LIBRARYDIR}" STREQUAL "") 15 | # Fix find of non-system Boost 16 | option(Boost_NO_SYSTEM_PATHS "Disable system paths for FindBoost" ON) 17 | endif() 18 | 19 | if(CMAKE_COMPILER_IS_XLCXX AND XLC_BACKEND) 20 | set(Boost_NO_BOOST_CMAKE TRUE) 21 | set(Boost_USE_STATIC_LIBS TRUE) 22 | endif() 23 | -------------------------------------------------------------------------------- /FindDNSSD.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2011 Stefan Eilemann 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # - Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # - Redistributions in binary form must reproduce the above copyright notice, 10 | # this list of conditions and the following disclaimer in the documentation 11 | # and/or other materials provided with the distribution. 12 | # - Neither the name of Eyescale Software GmbH nor the names of its 13 | # contributors may be used to endorse or promote products derived from this 14 | # software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | # POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | #================================== 29 | # 30 | # - Find ZeroConf headers 31 | # 32 | #================================== 33 | # 34 | # The following environment variables are respected for finding Dnssd. 35 | # CMAKE_PREFIX_PATH can also be used for this (see find_library() CMake 36 | # documentation). 37 | # 38 | # DNSSD_ROOT 39 | # 40 | # This module defines the following output variables: 41 | # 42 | # DNSSD_FOUND - Was Dnssd and all of the specified components found? 43 | # 44 | # DNSSD_INCLUDE_DIRS - Where to find the headers 45 | # 46 | # DNSSD_LIBRARIES - The Dnssd libraries 47 | # 48 | #================================== 49 | # Example Usage: 50 | # 51 | # find_package(DNSSD REQUIRED) 52 | # include_directories(${DNSSD_INCLUDE_DIRS}) 53 | # 54 | # add_executable(foo foo.cc) 55 | # target_link_libraries(foo ${DNSSD_LIBRARIES}) 56 | # 57 | #================================== 58 | # Naming convention: 59 | # Local variables of the form _dnssd_foo 60 | # Output variables of the form DNSSD_FOO 61 | # 62 | 63 | if(WIN32) 64 | if("$ENV{ProgramW6432}" STREQUAL "") 65 | set(_dnssd_lib_paths "$ENV{ProgramFiles}/Bonjour SDK") 66 | else() 67 | set(_dnssd_lib_paths "$ENV{ProgramW6432}/Bonjour SDK") 68 | endif() 69 | else() 70 | list(APPEND _dnssd_lib_paths /usr /usr/local /opt/local /opt) 71 | endif() 72 | 73 | find_path(_dnssd_INCLUDE_DIR dns_sd.h 74 | HINTS $ENV{DNSSD_ROOT} ${DNSSD_ROOT} 75 | PATH_SUFFIXES include 76 | PATHS ${_dnssd_lib_paths} 77 | ) 78 | 79 | if(DNSSD_FIND_REQUIRED) 80 | set(_dnssd_output_type FATAL_ERROR) 81 | set(_dnssd_output 1) 82 | else() 83 | set(_dnssd_output_type STATUS) 84 | if(NOT DNSSD_FIND_QUIETLY) 85 | set(_dnssd_output 1) 86 | endif() 87 | endif() 88 | 89 | if(NOT _dnssd_INCLUDE_DIR) 90 | set(_dnssd_EPIC_FAIL TRUE) 91 | if(_dnssd_output) 92 | message(${_dnssd_output_type} "Can't find dns_sd.h header file.") 93 | endif() 94 | endif() 95 | 96 | if(APPLE) 97 | find_library(_dnssd_LIBRARY System 98 | HINTS $ENV{DNSSD_ROOT} ${DNSSD_ROOT} 99 | PATH_SUFFIXES lib PATHS ${_dnssd_lib_paths} 100 | ) 101 | elseif(WIN32) 102 | if("${CMAKE_SHARED_LINKER_FLAGS}" MATCHES "x64") 103 | set(_dnssd_lib_postfix "x64") 104 | else() 105 | set(_dnssd_lib_postfix "Win32") 106 | endif() 107 | find_library(_dnssd_LIBRARY dnssd.lib 108 | HINTS $ENV{DNSSD_ROOT} ${DNSSD_ROOT} 109 | PATH_SUFFIXES lib 110 | PATHS ${_dnssd_lib_paths}/Lib/${_dnssd_lib_postfix}) 111 | else() 112 | find_library(_dnssd_LIBRARY dns_sd 113 | HINTS $ENV{DNSSD_ROOT} ${DNSSD_ROOT} 114 | PATH_SUFFIXES lib PATHS ${_dnssd_lib_paths} 115 | ) 116 | endif() 117 | 118 | if(DNSSD_FIND_REQUIRED) 119 | if(_dnssd_LIBRARY MATCHES "_dnssd_LIBRARY-NOTFOUND") 120 | set(_dnssd_EPIC_FAIL TRUE) 121 | message(FATAL_ERROR "Missing the ZeroConf library.\n" 122 | "Consider using CMAKE_PREFIX_PATH or the DNSSD_ROOT environment variable. " 123 | "See the ${CMAKE_CURRENT_LIST_FILE} for more details.") 124 | endif() 125 | endif() 126 | 127 | include(FindPackageHandleStandardArgs) 128 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(DNSSD DEFAULT_MSG 129 | _dnssd_LIBRARY _dnssd_INCLUDE_DIR) 130 | 131 | if(_dnssd_EPIC_FAIL) 132 | # Zero out everything, we didn't meet version requirements 133 | set(DNSSD_FOUND FALSE) 134 | set(_dnssd_LIBRARY) 135 | set(_dnssd_INCLUDE_DIR) 136 | endif() 137 | 138 | set(DNSSD_INCLUDE_DIRS ${_dnssd_INCLUDE_DIR}) 139 | set(DNSSD_LIBRARIES ${_dnssd_LIBRARY}) 140 | 141 | if(DNSSD_FOUND AND _dnssd_output) 142 | message(STATUS "Found ZeroConf in ${DNSSD_INCLUDE_DIRS};${DNSSD_LIBRARIES}") 143 | endif() 144 | -------------------------------------------------------------------------------- /FindFCGI.cmake: -------------------------------------------------------------------------------- 1 | # - Try to Find libfastcgi 2 | # Once done this will define 3 | # FCGI_FOUND 4 | # FCGI_INCLUDE_DIRS 5 | # FCGI_LIBRARIES 6 | 7 | # Look for the header file. 8 | find_path(FCGI_INCLUDE_DIR NAMES fastcgi.h fcgi.h fcgio.h) 9 | 10 | # Look for the library. 11 | find_library(FCGI_LIBRARY NAMES fcgi) 12 | find_library(FCGIPP_LIBRARY NAMES fcgi++) 13 | 14 | # Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE. 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(FCGI DEFAULT_MSG FCGI_INCLUDE_DIR FCGI_LIBRARY FCGIPP_LIBRARY) 17 | 18 | # Copy the results to the output variables. 19 | if(FCGI_FOUND) 20 | set(FCGI_LIBRARIES ${FCGI_LIBRARY} ${FCGIPP_LIBRARY}) 21 | set(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR}) 22 | endif() 23 | 24 | mark_as_advanced(FCGI_INCLUDE_DIR FCGI_LIBRARY FCGIPP_LIBRARY) 25 | 26 | -------------------------------------------------------------------------------- /FindFFMPEG.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Find the native FFMPEG includes and library 3 | # 4 | # This module defines 5 | # FFMPEG_INCLUDE_DIR, where to find avcodec.h, avformat.h ... 6 | # FFMPEG_LIBRARIES, the libraries to link against to use FFMPEG. 7 | # FFMPEG_FOUND, If false, do not try to use FFMPEG. 8 | 9 | # also defined, but not for general use are 10 | # FFMPEG_avformat_LIBRARY and FFMPEG_avcodec_LIBRARY, where to find the FFMPEG library. 11 | # This is useful to do it this way so that we can always add more libraries 12 | # if needed to FFMPEG_LIBRARIES if ffmpeg ever changes... 13 | 14 | # if ffmpeg headers are all in one directory 15 | FIND_PATH(FFMPEG_INCLUDE_DIR avformat.h 16 | PATHS 17 | $ENV{FFMPEG_DIR}/include 18 | $ENV{OSGDIR}/include 19 | $ENV{OSG_ROOT}/include 20 | ~/Library/Frameworks 21 | /Library/Frameworks 22 | /usr/local/include 23 | /usr/include 24 | /sw/include # Fink 25 | /opt/local/include # DarwinPorts 26 | /opt/csw/include # Blastwave 27 | /opt/include 28 | /usr/freeware/include 29 | PATH_SUFFIXES ffmpeg 30 | DOC "Location of FFMPEG Headers" 31 | ) 32 | 33 | # if ffmpeg headers are separated to each of libavformat, libavcodec etc.. 34 | IF( NOT FFMPEG_INCLUDE_DIR ) 35 | FIND_PATH(FFMPEG_INCLUDE_DIR libavformat/avformat.h 36 | PATHS 37 | $ENV{FFMPEG_DIR}/include 38 | $ENV{OSGDIR}/include 39 | $ENV{OSG_ROOT}/include 40 | ~/Library/Frameworks 41 | /Library/Frameworks 42 | /usr/local/include 43 | /usr/include 44 | /sw/include # Fink 45 | /opt/local/include # DarwinPorts 46 | /opt/csw/include # Blastwave 47 | /opt/include 48 | /usr/freeware/include 49 | PATH_SUFFIXES ffmpeg 50 | DOC "Location of FFMPEG Headers" 51 | ) 52 | 53 | ENDIF( NOT FFMPEG_INCLUDE_DIR ) 54 | 55 | # we want the -I include line to use the parent directory of ffmpeg as 56 | # ffmpeg uses relative includes such as or 57 | get_filename_component(FFMPEG_INCLUDE_DIR ${FFMPEG_INCLUDE_DIR} ABSOLUTE) 58 | 59 | FIND_LIBRARY(FFMPEG_avformat_LIBRARY avformat 60 | /usr/local/lib 61 | /usr/lib 62 | ) 63 | 64 | FIND_LIBRARY(FFMPEG_avcodec_LIBRARY avcodec 65 | /usr/local/lib 66 | /usr/lib 67 | ) 68 | 69 | FIND_LIBRARY(FFMPEG_avutil_LIBRARY avutil 70 | /usr/local/lib 71 | /usr/lib 72 | ) 73 | 74 | FIND_LIBRARY(FFMPEG_vorbis_LIBRARY vorbis 75 | /usr/local/lib 76 | /usr/lib 77 | ) 78 | 79 | FIND_LIBRARY(FFMPEG_dc1394_LIBRARY dc1394_control 80 | /usr/local/lib 81 | /usr/lib 82 | ) 83 | 84 | FIND_LIBRARY(FFMPEG_vorbisenc_LIBRARY vorbisenc 85 | /usr/local/lib 86 | /usr/lib 87 | ) 88 | 89 | FIND_LIBRARY(FFMPEG_theora_LIBRARY theora 90 | /usr/local/lib 91 | /usr/lib 92 | ) 93 | 94 | FIND_LIBRARY(FFMPEG_dts_LIBRARY dts 95 | /usr/local/lib 96 | /usr/lib 97 | ) 98 | 99 | FIND_LIBRARY(FFMPEG_gsm_LIBRARY gsm 100 | /usr/local/lib 101 | /usr/lib 102 | ) 103 | 104 | FIND_LIBRARY(FFMPEG_swscale_LIBRARY swscale 105 | /usr/local/lib 106 | /usr/lib 107 | ) 108 | 109 | FIND_LIBRARY(FFMPEG_z_LIBRARY z 110 | /usr/local/lib 111 | /usr/lib 112 | ) 113 | 114 | FIND_LIBRARY(FFMPEG_bz2_LIBRARY bz2 115 | /usr/local/lib 116 | /usr/lib 117 | ) 118 | 119 | SET(FFMPEG_LIBRARIES) 120 | IF(FFMPEG_INCLUDE_DIR) 121 | IF(FFMPEG_avformat_LIBRARY) 122 | IF(FFMPEG_avcodec_LIBRARY) 123 | IF(FFMPEG_avutil_LIBRARY) 124 | SET(FFMPEG_FOUND TRUE) 125 | SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIR}) 126 | SET(FFMPEG_BASIC_LIBRARIES 127 | ${FFMPEG_avcodec_LIBRARY} 128 | ${FFMPEG_avformat_LIBRARY} 129 | ${FFMPEG_avutil_LIBRARY} 130 | ) 131 | 132 | # swscale is always a part of newer ffmpeg distros 133 | IF(FFMPEG_swscale_LIBRARY) 134 | LIST(APPEND FFMPEG_BASIC_LIBRARIES ${FFMPEG_swscale_LIBRARY}) 135 | ENDIF(FFMPEG_swscale_LIBRARY) 136 | 137 | SET(FFMPEG_LIBRARIES ${FFMPEG_BASIC_LIBRARIES}) 138 | 139 | IF(FFMPEG_vorbis_LIBRARY) 140 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_vorbis_LIBRARY}) 141 | ENDIF(FFMPEG_vorbis_LIBRARY) 142 | 143 | IF(FFMPEG_dc1394_LIBRARY) 144 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_dc1394_LIBRARY}) 145 | ENDIF(FFMPEG_dc1394_LIBRARY) 146 | 147 | IF(FFMPEG_vorbisenc_LIBRARY) 148 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_vorbisenc_LIBRARY}) 149 | ENDIF(FFMPEG_vorbisenc_LIBRARY) 150 | 151 | IF(FFMPEG_theora_LIBRARY) 152 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_theora_LIBRARY}) 153 | ENDIF(FFMPEG_theora_LIBRARY) 154 | 155 | IF(FFMPEG_dts_LIBRARY) 156 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_dts_LIBRARY}) 157 | ENDIF(FFMPEG_dts_LIBRARY) 158 | 159 | IF(FFMPEG_gsm_LIBRARY) 160 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_gsm_LIBRARY}) 161 | ENDIF(FFMPEG_gsm_LIBRARY) 162 | 163 | IF(FFMPEG_z_LIBRARY) 164 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_z_LIBRARY}) 165 | ENDIF(FFMPEG_z_LIBRARY) 166 | 167 | IF(FFMPEG_bz2_LIBRARY) 168 | LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_bz2_LIBRARY}) 169 | ENDIF(FFMPEG_bz2_LIBRARY) 170 | 171 | SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE INTERNAL "All presently found FFMPEG libraries.") 172 | 173 | ENDIF(FFMPEG_avutil_LIBRARY) 174 | ENDIF(FFMPEG_avcodec_LIBRARY) 175 | ENDIF(FFMPEG_avformat_LIBRARY) 176 | ENDIF(FFMPEG_INCLUDE_DIR) 177 | 178 | MARK_AS_ADVANCED( 179 | FFMPEG_INCLUDE_DIR 180 | FFMPEG_avformat_LIBRARY 181 | FFMPEG_avcodec_LIBRARY 182 | FFMPEG_avutil_LIBRARY 183 | FFMPEG_vorbis_LIBRARY 184 | FFMPEG_dc1394_LIBRARY 185 | FFMPEG_vorbisenc_LIBRARY 186 | FFMPEG_theora_LIBRARY 187 | FFMPEG_dts_LIBRARY 188 | FFMPEG_gsm_LIBRARY 189 | FFMPEG_swscale_LIBRARY 190 | FFMPEG_z_LIBRARY 191 | ) 192 | -------------------------------------------------------------------------------- /FindFlowVR.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Ahmet Bilgili 2 | # Modified from: FindSAGE.cmake 3 | 4 | # - Try to find the FlowVR library 5 | # Once done this will define 6 | # 7 | # FLOWVR_ROOT - Set this variable to the root installation of FlowVR 8 | # 9 | # Read-Only variables: 10 | # FLOWVR_FOUND - system has the FlowVR library 11 | # FLOWVR_INCLUDE_DIRS - the FlowVR include directory 12 | # FLOWVR_LIBRARIES - The libraries needed to use FlowVR 13 | include(FindPackageHandleStandardArgs) 14 | 15 | if(FlowVR_FIND_REQUIRED) 16 | set(_FlowVR_required REQUIRED) 17 | set(_FlowVR_output 1) 18 | else() 19 | if(NOT FlowVR_FIND_QUIETLY) 20 | set(_FlowVR_output 1) 21 | endif() 22 | endif() 23 | if(FlowVR_FIND_QUIETLY) 24 | set(_FlowVR_quiet QUIET) 25 | endif() 26 | 27 | set(FLOWVR_INCLUDE_DIRS) 28 | 29 | find_path(FLOWVRVR_BASE_INCLUDE_DIR flowvr/buffer.h 30 | PATH_SUFFIXES include 31 | PATHS ${PROJECT_SOURCE_DIR}/../../.. $ENV{FLOWVR_PREFIX} /usr/include /usr /opt ) 32 | 33 | if(FLOWVRVR_BASE_INCLUDE_DIR) 34 | list(APPEND FLOWVR_INCLUDE_DIRS ${FLOWVRVR_BASE_INCLUDE_DIR}) 35 | endif() 36 | 37 | find_path(FLOWVRVR_MODULE_INCLUDE_DIR flowvr/module.h 38 | PATH_SUFFIXES include 39 | PATHS ${PROJECT_SOURCE_DIR}/../../.. $ENV{FLOWVR_PREFIX} /usr/include /usr /opt ) 40 | 41 | if(FLOWVRVR_MODULE_INCLUDE_DIR) 42 | list(APPEND FLOWVR_INCLUDE_DIRS ${FLOWVRVR_MODULE_INCLUDE_DIR}) 43 | endif() 44 | 45 | if(FLOWVR_INCLUDE_DIRS) 46 | set(_FLOWVR_FAIL FALSE) 47 | else() 48 | set(_FLOWVR_FAIL TRUE) 49 | if(_FLOWVR_output) 50 | message(STATUS "Can't find FlowVR headers.") 51 | endif() 52 | endif() 53 | 54 | set(_FLOWVR_LIBRARIES "flowvr-base" 55 | "flowvr-commands" 56 | "flowvr-mod" 57 | "flowvr-plugd" 58 | "ftlm" 59 | "fca" ) 60 | 61 | set(FLOWVR_LIBRARIES) 62 | 63 | foreach(FLOWVR_LIBRARY ${_FLOWVR_LIBRARIES}) 64 | find_library(${FLOWVR_LIBRARY}_LIBRARY ${FLOWVR_LIBRARY} 65 | PATH_SUFFIXES lib lib64 66 | PATHS ${PROJECT_SOURCE_DIR}/../../.. $ENV{FLOWVR_PREFIX} /usr/local /usr /usr/local /opt /opt/local ) 67 | if(${FLOWVR_LIBRARY}_LIBRARY) 68 | list(APPEND FLOWVR_LIBRARIES ${${FLOWVR_LIBRARY}_LIBRARY}) 69 | if(NOT _FlowVR_quiet) 70 | message(STATUS "FlowVR: ${${FLOWVR_LIBRARY}_LIBRARY} FOUND") 71 | endif() 72 | else() 73 | if(NOT _FlowVR_quiet) 74 | message(STATUS "FlowVR: ${${FLOWVR_LIBRARY}_LIBRARY} NOT FOUND") 75 | endif() 76 | endif() 77 | endforeach(FLOWVR_LIBRARY) 78 | 79 | if(FLOWVR_FIND_REQUIRED) 80 | if(NOT FLOWVR_LIBRARIES) 81 | message(FATAL_ERROR "Missing the FlowVR libraries.\n" 82 | "Consider using CMAKE_PREFIX_PATH or the FLOWVR_PREFIX environment variable. " 83 | "See the ${CMAKE_CURRENT_LIST_FILE} for more details.") 84 | set(_FLOWVR_FAIL TRUE) 85 | endif() 86 | endif() 87 | find_package_handle_standard_args(FLOWVR DEFAULT_MSG FLOWVR_LIBRARIES FLOWVR_INCLUDE_DIRS) 88 | 89 | if(_FLOWVR_FAIL) 90 | # Zero out everything, we didn't meet the requirements 91 | set(FLOWVR_FOUND FALSE) 92 | set(FLOWVR_LIBRARY) 93 | set(FLOWVR_INCLUDE_DIRS) 94 | set(_FLOWVR_LIBRARIES) 95 | set(FLOWVR_LIBRARIES) 96 | else() 97 | set(FLOWVR_FOUND TRUE) 98 | endif() 99 | -------------------------------------------------------------------------------- /FindGLEW_MX.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010 Daniel Pfeifer 2 | # 2011-2013 Stefan Eilemann 3 | 4 | if(GLEW_MX_FIND_QUIETLY) 5 | set(_glew_mx_output) 6 | else() 7 | set(_glew_mx_output 1) 8 | endif() 9 | 10 | find_path(_glew_mx_INCLUDE_DIR GL/glew.h 11 | HINTS ${GLEW_ROOT}/include $ENV{GLEW_ROOT}/include /usr/include /usr/local/include /opt/local/include) 12 | 13 | find_library(_glew_mx_LIBRARY 14 | NAMES GLEWmx glew32mx GLEW glew glew32 15 | HINTS ${GLEW_ROOT}/lib64 $ENV{GLEW_ROOT}/lib64 /usr/lib /usr/local/lib) 16 | 17 | if(_glew_mx_INCLUDE_DIR AND _glew_mx_LIBRARY) 18 | set(TEST_SRC ${PROJECT_BINARY_DIR}/glew_test.cpp) 19 | file(WRITE ${TEST_SRC} 20 | "#include \n" 21 | "int main( )\n" 22 | "{\n" 23 | " glewContextInit(0);\n" 24 | "}\n" 25 | ) 26 | 27 | try_compile(_glew_mx_SUPPORTED ${PROJECT_BINARY_DIR}/glew_test ${TEST_SRC} 28 | CMAKE_FLAGS 29 | "-DINCLUDE_DIRECTORIES:STRING=${_glew_mx_INCLUDE_DIR}" 30 | "-DLINK_LIBRARIES:STRING=${_glew_mx_LIBRARY}" 31 | COMPILE_DEFINITIONS -DGLEW_MX=1 32 | ) 33 | 34 | if(NOT _glew_mx_SUPPORTED) 35 | if(_glew_mx_output) 36 | message(STATUS " ${_glew_mx_LIBRARY} does not support GLEW_MX.") 37 | endif() 38 | set(_glew_mx_INCLUDE_DIR 0) 39 | set(_glew_mx_LIBRARY 0) 40 | elseif(X11_FOUND) 41 | file(WRITE ${TEST_SRC} 42 | "#include \n" 43 | "int main( )\n" 44 | "{\n" 45 | " glxewContextInit(0);\n" 46 | "}\n" 47 | ) 48 | 49 | try_compile(_glxew_mx_SUPPORTED ${PROJECT_BINARY_DIR}/glew_test ${TEST_SRC} 50 | CMAKE_FLAGS 51 | "-DINCLUDE_DIRECTORIES:STRING=${_glew_mx_INCLUDE_DIR}" 52 | "-DLINK_LIBRARIES:STRING=${_glew_mx_LIBRARY}" 53 | COMPILE_DEFINITIONS -DGLEW_MX=1 54 | ) 55 | if(NOT _glxew_mx_SUPPORTED) 56 | if(_glew_mx_output) 57 | message(STATUS " ${_glew_mx_LIBRARY} is missing glxewContextInit().") 58 | endif() 59 | set(_glew_mx_INCLUDE_DIR 0) 60 | set(_glew_mx_LIBRARY 0) 61 | endif() 62 | endif() 63 | endif() 64 | 65 | include(FindPackageHandleStandardArgs) 66 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW_MX DEFAULT_MSG 67 | _glew_mx_LIBRARY _glew_mx_INCLUDE_DIR) 68 | 69 | set(GLEW_MX_INCLUDE_DIRS SYSTEM ${_glew_mx_INCLUDE_DIR}) 70 | set(GLEW_MX_LIBRARIES ${_glew_mx_LIBRARY}) 71 | if(GLEW_MX_FOUND AND _glew_mx_output) 72 | message(STATUS 73 | "Found GLEW_MX in ${GLEW_MX_INCLUDE_DIRS};${GLEW_MX_LIBRARIES}") 74 | endif() 75 | -------------------------------------------------------------------------------- /FindGPFS.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2013 Stefan.Eilemann@epfl.ch 3 | # finds the ittnotify API 4 | # if not found, installs a dummy ittnotify.h to build_dir/include to eliminate 5 | # the need to protect the itt calls with ifdefs 6 | 7 | if(GPFS_FIND_REQUIRED) 8 | set(_gpfs_output 1) 9 | elseif(NOT GPFS_FIND_QUIETLY) 10 | set(_gpfs_output 1) 11 | endif() 12 | 13 | find_path(GPFS_INCLUDE_DIR gpfs.h 14 | PATHS /usr/include /usr/local/include /opt/local/include) 15 | 16 | find_library(GPFS_LIBRARY NAMES gpfs 17 | PATHS /usr/lib /usr/local/lib /opt/local/lib) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPFS DEFAULT_MSG GPFS_INCLUDE_DIR GPFS_LIBRARY) 21 | 22 | set(GPFS_INCLUDE_DIRS ${GPFS_INCLUDE_DIR}) 23 | set(GPFS_LIBRARIES ${GPFS_LIBRARY}) 24 | 25 | if(_gpfs_output AND GPFS_FOUND) 26 | message(STATUS "Found GPFS in ${GPFS_INCLUDE_DIRS};${GPFS_LIBRARIES}") 27 | endif() 28 | -------------------------------------------------------------------------------- /FindGTS.cmake: -------------------------------------------------------------------------------- 1 | # Try to find gnu triangulation library GTS 2 | # See 3 | # http://gts.sf.net 4 | # 5 | # Once run this will define: 6 | # 7 | # GTS_FOUND = system has GTS lib 8 | # 9 | # GTS_LIBRARIES = full path to the libraries 10 | # on Unix/Linux with additional linker flags from "gts-config --libs" 11 | # 12 | # CMAKE_GTS_CXX_FLAGS = Unix compiler flags for GTS, essentially "`gts-config --cxxflags`" 13 | # 14 | # GTS_INCLUDE_DIR = where to find headers 15 | # 16 | # GTS_LINK_DIRECTORIES = link directories, useful for rpath on Unix 17 | # GTS_EXE_LINKER_FLAGS = rpath on Unix 18 | # 19 | # 20 | # GTS modyfication by 21 | # A.Khalatyan 05/2009 22 | # 23 | # www.aip.de/~arm2arm 24 | # 25 | # This script is based on GSL script by 26 | # Felix Woelk 07/2004 27 | # and Jan Woetzel 28 | # www.mip.informatik.uni-kiel.de 29 | # -------------------------------- 30 | 31 | if(GTS_FIND_REQUIRED) 32 | set(_gts_output_type FATAL_ERROR) 33 | set(_gts_output 1) 34 | else() 35 | set(_gts_output_type STATUS) 36 | if(NOT GTS_FIND_QUIETLY) 37 | set(_gts_output 1) 38 | endif() 39 | endif() 40 | 41 | IF(WIN32) 42 | # JW tested with gsl-1.8, Windows XP, MSVS 7.1, MSVS 8.0 43 | SET(GTS_POSSIBLE_ROOT_DIRS 44 | ${GTS_ROOT_DIR} 45 | $ENV{GTS_ROOT_DIR} 46 | ${GTS_DIR} 47 | ${GTS_HOME} 48 | $ENV{GTS_DIR} 49 | $ENV{GTS_HOME} 50 | $ENV{EXTERN_LIBS_DIR}/gts 51 | $ENV{EXTRA} 52 | # "C:/home/arm2arm/SOFTWARE/gts-0.7.6" 53 | ) 54 | FIND_PATH(GTS_INCLUDE_DIR 55 | NAMES gts.h gtsconfig.h 56 | PATHS ${GTS_POSSIBLE_ROOT_DIRS} 57 | PATH_SUFFIXES include 58 | DOC "GTS header include dir" 59 | ) 60 | 61 | FIND_LIBRARY(GTS_GTS_LIBRARY 62 | NAMES gts libgts 63 | PATHS ${GTS_POSSIBLE_ROOT_DIRS} 64 | PATH_SUFFIXES lib 65 | DOC "GTS library dir" ) 66 | 67 | # FIND_LIBRARY(GTS_GLIB_LIBRARY 68 | # NAMES glib libgslcblas 69 | # PATHS ${GSL_POSSIBLE_ROOT_DIRS} 70 | # PATH_SUFFIXES lib 71 | # DOC "GSL cblas library dir" ) 72 | 73 | SET(GTS_LIBRARIES ${GTS_GTS_LIBRARY}) 74 | 75 | #MESSAGE("DBG\n" 76 | # "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n" 77 | # "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n" 78 | # "GSL_LIBRARIES=${GSL_LIBRARIES}") 79 | 80 | 81 | ELSE(WIN32) 82 | 83 | IF(UNIX) 84 | SET(GSL_CONFIG_PREFER_PATH 85 | "$ENV{GTS_DIR}/bin" 86 | "$ENV{GTS_DIR}" 87 | "$ENV{GTS_HOME}/bin" 88 | "$ENV{GTS_HOME}" 89 | CACHE STRING "preferred path to GTS (gts-config)") 90 | FIND_PROGRAM(GTS_CONFIG gts-config 91 | ${GTS_CONFIG_PREFER_PATH} 92 | /work2/arm2arm/SOFTWARE/bin/ 93 | ) 94 | #MESSAGE("DBG GTS_CONFIG ${GTS_CONFIG}") 95 | 96 | IF (GTS_CONFIG) 97 | if(_gts_output) 98 | MESSAGE(STATUS "GTS using gts-config ${GTS_CONFIG}") 99 | endif() 100 | # set CXXFLAGS to be fed into CXX_FLAGS by the user: 101 | EXEC_PROGRAM(${GTS_CONFIG} 102 | ARGS --cflags 103 | OUTPUT_VARIABLE GTS_CXX_FLAGS ) 104 | #SET(GTS_CXX_FLAGS "`${GTS_CONFIG} --cflags`") 105 | SET(CMAKE_GTS_CXX_FLAGS ${GTS_CXX_FLAGS}) 106 | # MESSAGE("DBG ${GTS_CXX_FLAGS}") 107 | # set INCLUDE_DIRS to prefix+include 108 | EXEC_PROGRAM(${GTS_CONFIG} 109 | ARGS --prefix 110 | OUTPUT_VARIABLE GTS_PREFIX) 111 | SET(GTS_INCLUDE_DIR ${GTS_PREFIX}/include CACHE STRING INTERNAL) 112 | # set link libraries and link flags 113 | 114 | #SET(GSL_LIBRARIES "`${GSL_CONFIG} --libs`") 115 | 116 | # extract link dirs for rpath 117 | EXEC_PROGRAM(${GTS_CONFIG} 118 | ARGS --libs 119 | OUTPUT_VARIABLE GTS_CONFIG_LIBS ) 120 | SET(GTS_LIBRARIES "${GTS_CONFIG_LIBS}") 121 | 122 | # split off the link dirs (for rpath) 123 | # use regular expression to match wildcard equivalent "-L*" 124 | # with is a space or a semicolon 125 | STRING(REGEX MATCHALL "[-][L]([^ ;])+" 126 | GTS_LINK_DIRECTORIES_WITH_PREFIX 127 | "${GTS_CONFIG_LIBS}" ) 128 | # MESSAGE("DBG GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}") 129 | 130 | # remove prefix -L because we need the pure directory for LINK_DIRECTORIES 131 | 132 | IF (GTS_LINK_DIRECTORIES_WITH_PREFIX) 133 | STRING(REGEX REPLACE "[-][L]" "" GTS_LINK_DIRECTORIES ${GTS_LINK_DIRECTORIES_WITH_PREFIX} ) 134 | ENDIF (GTS_LINK_DIRECTORIES_WITH_PREFIX) 135 | SET(GTS_EXE_LINKER_FLAGS "-Wl,-rpath,${GTS_LINK_DIRECTORIES}" CACHE STRING INTERNAL) 136 | # MESSAGE("DBG GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}") 137 | # MESSAGE("DBG GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}") 138 | 139 | # ADD_DEFINITIONS("-DHAVE_GSL") 140 | # SET(GSL_DEFINITIONS "-DHAVE_GSL") 141 | MARK_AS_ADVANCED( 142 | GTS_CXX_FLAGS 143 | GTS_INCLUDE_DIR 144 | GTS_LIBRARIES 145 | GTS_LINK_DIRECTORIES 146 | GTS_DEFINITIONS 147 | ) 148 | if(_gts_output) 149 | MESSAGE(STATUS "Using GTS from ${GTS_PREFIX}") 150 | endif() 151 | ELSE(GTS_CONFIG) 152 | 153 | INCLUDE(UsePkgConfig) #needed for PKGCONFIG(...) 154 | 155 | if(_gts_output) 156 | MESSAGE(STATUS "GSL using pkgconfig") 157 | endif() 158 | # PKGCONFIG(gsl includedir libdir linkflags cflags) 159 | PKGCONFIG(gts GTS_INCLUDE_DIR GTS_LINK_DIRECTORIES GTS_LIBRARIES GTS_CXX_FLAGS) 160 | IF(GTS_INCLUDE_DIR) 161 | MARK_AS_ADVANCED( 162 | GTS_CXX_FLAGS 163 | GTS_INCLUDE_DIR 164 | GTS_LIBRARIES 165 | GTS_LINK_DIRECTORIES 166 | ) 167 | 168 | ELSEIF(_gts_output) 169 | MESSAGE(${_gts_output_type} 170 | "FindGTS.cmake: gts-config/pkg-config gts not found. Please set it manually. GTS_CONFIG=${GTS_CONFIG}") 171 | ENDIF() 172 | 173 | ENDIF(GTS_CONFIG) 174 | 175 | ENDIF(UNIX) 176 | ENDIF(WIN32) 177 | 178 | 179 | IF(GTS_LIBRARIES) 180 | IF(GTS_INCLUDE_DIR OR GTS_CXX_FLAGS) 181 | 182 | SET(GTS_FOUND 1) 183 | 184 | ENDIF(GTS_INCLUDE_DIR OR GTS_CXX_FLAGS) 185 | ENDIF(GTS_LIBRARIES) 186 | 187 | 188 | # ========================================== 189 | IF(NOT GTS_FOUND AND _gts_output) 190 | MESSAGE(${_gts_output_type} "GTS was not found.") 191 | ENDIF() 192 | -------------------------------------------------------------------------------- /FindLibJpegTurbo.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find libjpeg-turbo 2 | # Once done, this will define 3 | # 4 | # LibJpegTurbo_FOUND - system has libjpeg-turbo 5 | # LibJpegTurbo_INCLUDE_DIRS - the libjpeg-turbo include directories 6 | # LibJpegTurbo_LIBRARIES - link these to use libjpeg-turbo 7 | # LibJpegTurbo_VERSION - the version of libjpeg-turbo 8 | # 9 | # this file is modelled after http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries 10 | 11 | include(LibFindMacros) 12 | 13 | # Use pkg-config to get hints about paths 14 | libfind_pkg_check_modules(LibJpegTurbo_PKGCONF LibJpegTurbo) 15 | if(NOT LibJpegTurbo_PKGCONF_FOUND) 16 | libfind_pkg_check_modules(LibJpegTurbo_PKGCONF libturbojpeg) 17 | endif() 18 | 19 | # Include dir 20 | find_path(LibJpegTurbo_INCLUDE_DIR 21 | NAMES turbojpeg.h 22 | PATHS ${LibJpegTurbo_PKGCONF_INCLUDE_DIRS} /opt/libjpeg-turbo/include $ENV{LIBJPEGTURBO_ROOT}/include 23 | ) 24 | 25 | # Search for header with version: jconfig.h 26 | if(LibJpegTurbo_INCLUDE_DIR) 27 | if(EXISTS "${LibJpegTurbo_INCLUDE_DIR}/jconfig-64.h") 28 | set(_version_header "${LibJpegTurbo_INCLUDE_DIR}/jconfig-64.h") 29 | elseif(EXISTS "${LibJpegTurbo_INCLUDE_DIR}/jconfig.h") 30 | set(_version_header "${LibJpegTurbo_INCLUDE_DIR}/jconfig.h") 31 | elseif(EXISTS "${LibJpegTurbo_INCLUDE_DIR}/x86_64-linux-gnu/jconfig.h") 32 | set(_version_header "${LibJpegTurbo_INCLUDE_DIR}/x86_64-linux-gnu/jconfig.h") 33 | else() 34 | set(_version_header) 35 | if(NOT LibJpegTurbo_FIND_QUIETLY) 36 | message(STATUS "Could not find 'jconfig.h' to check version") 37 | endif() 38 | endif() 39 | endif() 40 | 41 | # Found the header, read version 42 | if(_version_header) 43 | file(READ "${_version_header}" _header) 44 | if(_header) 45 | string(REGEX REPLACE ".*#define[\t ]+LIBJPEG_TURBO_VERSION[\t ]+([0-9.]+).*" 46 | "\\1" LibJpegTurbo_VERSION "${_header}") 47 | endif() 48 | unset(_header) 49 | endif() 50 | 51 | # Finally the library itself 52 | find_library(LibJpegTurbo_LIBRARY 53 | NAMES libturbojpeg.so libturbojpeg.so.0 turbojpeg.lib libturbojpeg.dylib 54 | PATHS ${LibJpegTurbo_PKGCONF_LIBRARY_DIRS} /opt/libjpeg-turbo/lib $ENV{LIBJPEGTURBO_ROOT}/lib 55 | ) 56 | 57 | include(FindPackageHandleStandardArgs) 58 | find_package_handle_standard_args(LibJpegTurbo FOUND_VAR LibJpegTurbo_FOUND 59 | REQUIRED_VARS LibJpegTurbo_LIBRARY 60 | LibJpegTurbo_INCLUDE_DIR LibJpegTurbo_VERSION 61 | VERSION_VAR LibJpegTurbo_VERSION) 62 | 63 | if(LibJpegTurbo_FOUND) 64 | set(LibJpegTurbo_INCLUDE_DIRS ${LibJpegTurbo_INCLUDE_DIR}) 65 | set(LibJpegTurbo_LIBRARIES ${LibJpegTurbo_LIBRARY}) 66 | if(NOT LibJpegTurbo_FIND_QUIETLY) 67 | message(STATUS "Found LibJpegTurbo in ${LibJpegTurbo_INCLUDE_DIR}:${LibJpegTurbo_LIBRARIES}") 68 | endif() 69 | else() 70 | set(LibJpegTurbo_INCLUDE_DIR) 71 | set(LibJpegTurbo_INCLUDE_DIRS) 72 | set(LibJpegTurbo_LIBRARY) 73 | set(LibJpegTurbo_LIBRARIES) 74 | set(LibJpegTurbo_VERSION) 75 | endif() 76 | -------------------------------------------------------------------------------- /FindMAGELLAN.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011-2013 Stefan Eilemann 2 | 3 | include(FindPackageHandleStandardArgs) 4 | 5 | set(MAGELLAN_API "spnav") 6 | if(APPLE) 7 | foreach(ARCH ${CMAKE_OSX_ARCHITECTURES}) 8 | if(ARCH STREQUAL "ppc" OR ARCH STREQUAL "i386") 9 | set(MAGELLAN_API "Carbon") 10 | endif() 11 | endforeach() 12 | endif() 13 | if(MSVC) 14 | set(MAGELLAN_API "Windows") 15 | endif() 16 | if(MAGELLAN_FIND_COMPONENTS) 17 | set(MAGELLAN_API ${MAGELLAN_FIND_COMPONENTS}) 18 | endif() 19 | 20 | if(MAGELLAN_API STREQUAL "Windows") 21 | set(MAGELLAN_FOUND 1) # always on 22 | return() 23 | endif() 24 | 25 | if(MAGELLAN_API STREQUAL "Carbon") 26 | find_path(MAGELLAN_INCLUDE_DIR 3DconnexionClient/ConnexionClientAPI.h) 27 | find_library(MAGELLAN_LIBRARY 3DconnexionClient) 28 | 29 | # WAR cmake bug: 30 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -F/Library/Frameworks") 31 | elseif(MAGELLAN_API STREQUAL "spnav") 32 | find_path(MAGELLAN_INCLUDE_DIR spnav.h PATHS /usr/include /usr/local/include) 33 | find_library(MAGELLAN_LIBRARY spnav PATHS /usr/lib /usr/local/lib) 34 | endif() 35 | 36 | find_package_handle_standard_args(MAGELLAN DEFAULT_MSG MAGELLAN_INCLUDE_DIR 37 | MAGELLAN_LIBRARY) 38 | 39 | if(MAGELLAN_FOUND AND NOT MAGELLAN_FIND_QUIETLY) 40 | message(STATUS 41 | "Found SpaceMouse API in ${MAGELLAN_INCLUDE_DIR};${MAGELLAN_LIBRARY}") 42 | endif() 43 | -------------------------------------------------------------------------------- /FindMKL.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the Intel Math Kernel Library 2 | # Forked from: https://github.com/openmeeg/openmeeg/blob/master/macros/FindMKL.cmake 3 | # Once done this will define 4 | # 5 | # MKL_FOUND - system has MKL 6 | # MKL_ROOT_DIR - path to the MKL base directory 7 | # MKL_INCLUDE_DIR - the MKL include directory 8 | # MKL_LIBRARIES - MKL libraries 9 | # 10 | # There are few sets of libraries: 11 | # Array indexes modes: 12 | # LP - 32 bit indexes of arrays 13 | # ILP - 64 bit indexes of arrays 14 | # Threading: 15 | # SEQUENTIAL - no threading 16 | # INTEL - Intel threading library 17 | # GNU - GNU threading library 18 | # MPI support 19 | # NOMPI - no MPI support 20 | # INTEL - Intel MPI library 21 | # OPEN - Open MPI library 22 | # SGI - SGI MPT Library 23 | 24 | # linux 25 | if(UNIX AND NOT APPLE) 26 | if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64") 27 | set(MKL_ARCH_DIR "em64t") 28 | else() 29 | set(MKL_ARCH_DIR "32") 30 | endif() 31 | endif() 32 | 33 | # macos 34 | if(APPLE) 35 | set(MKL_ARCH_DIR "em64t") 36 | endif() 37 | 38 | IF(FORCE_BUILD_32BITS) 39 | set(MKL_ARCH_DIR "32") 40 | ENDIF() 41 | 42 | if (WIN32) 43 | if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) 44 | set(MKL_ARCH_DIR "intel64") 45 | else() 46 | set(MKL_ARCH_DIR "ia32") 47 | endif() 48 | endif() 49 | 50 | set (MKL_THREAD_VARIANTS SEQUENTIAL GNUTHREAD INTELTHREAD) 51 | set (MKL_MODE_VARIANTS ILP LP) 52 | set (MKL_MPI_VARIANTS NOMPI INTELMPI OPENMPI SGIMPT) 53 | 54 | find_path(MKL_ROOT_DIR 55 | include/mkl_cblas.h 56 | PATHS 57 | $ENV{MKLDIR} 58 | /opt/intel/mkl/*/ 59 | /opt/intel/cmkl/*/ 60 | /Library/Frameworks/Intel_MKL.framework/Versions/Current/lib/universal 61 | "Program Files (x86)/Intel/ComposerXE-2011/mkl" 62 | ) 63 | 64 | MESSAGE("MKL_ROOT_DIR : ${MKL_ROOT_DIR}") # for debug 65 | 66 | find_path(MKL_INCLUDE_DIR 67 | mkl_cblas.h 68 | PATHS 69 | ${MKL_ROOT_DIR}/include 70 | ${INCLUDE_INSTALL_DIR} 71 | ) 72 | 73 | find_path(MKL_FFTW_INCLUDE_DIR 74 | fftw3.h 75 | PATH_SUFFIXES fftw 76 | PATHS 77 | ${MKL_ROOT_DIR}/include 78 | ${INCLUDE_INSTALL_DIR} 79 | NO_DEFAULT_PATH 80 | ) 81 | 82 | find_library(MKL_CORE_LIBRARY 83 | mkl_core 84 | PATHS 85 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 86 | ${MKL_ROOT_DIR}/lib/ 87 | ) 88 | 89 | # Threading libraries 90 | find_library(MKL_SEQUENTIAL_LIBRARY 91 | mkl_sequential 92 | PATHS 93 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 94 | ${MKL_ROOT_DIR}/lib/ 95 | ) 96 | 97 | find_library(MKL_INTELTHREAD_LIBRARY 98 | mkl_intel_thread 99 | PATHS 100 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 101 | ${MKL_ROOT_DIR}/lib/ 102 | ) 103 | 104 | find_library(MKL_GNUTHREAD_LIBRARY 105 | mkl_gnu_thread 106 | PATHS 107 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 108 | ${MKL_ROOT_DIR}/lib/ 109 | ) 110 | 111 | # Intel Libraries 112 | IF("${MKL_ARCH_DIR}" STREQUAL "32") 113 | find_library(MKL_LP_LIBRARY 114 | mkl_intel 115 | PATHS 116 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 117 | ${MKL_ROOT_DIR}/lib/ 118 | ) 119 | 120 | find_library(MKL_ILP_LIBRARY 121 | mkl_intel 122 | PATHS 123 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 124 | ${MKL_ROOT_DIR}/lib/ 125 | ) 126 | else() 127 | find_library(MKL_LP_LIBRARY 128 | mkl_intel_lp64 129 | PATHS 130 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 131 | ${MKL_ROOT_DIR}/lib/ 132 | ) 133 | 134 | find_library(MKL_ILP_LIBRARY 135 | mkl_intel_ilp64 136 | PATHS 137 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 138 | ${MKL_ROOT_DIR}/lib/ 139 | ) 140 | ENDIF() 141 | 142 | # Lapack 143 | find_library(MKL_LAPACK_LIBRARY 144 | mkl_lapack 145 | PATHS 146 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 147 | ${MKL_ROOT_DIR}/lib/ 148 | ) 149 | 150 | IF(NOT MKL_LAPACK_LIBRARY) 151 | find_library(MKL_LAPACK_LIBRARY 152 | mkl_lapack95_lp64 153 | PATHS 154 | ${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR} 155 | ${MKL_ROOT_DIR}/lib/ 156 | ) 157 | ENDIF() 158 | 159 | # iomp5 160 | IF("${MKL_ARCH_DIR}" STREQUAL "32") 161 | IF(UNIX AND NOT APPLE) 162 | find_library(MKL_IOMP5_LIBRARY 163 | iomp5 164 | PATHS 165 | ${MKL_ROOT_DIR}/../lib/ia32 166 | ) 167 | ELSE() 168 | SET(MKL_IOMP5_LIBRARY "") # no need for mac 169 | ENDIF() 170 | else() 171 | IF(UNIX AND NOT APPLE) 172 | find_library(MKL_IOMP5_LIBRARY 173 | iomp5 174 | PATHS 175 | ${MKL_ROOT_DIR}/../lib/intel64 176 | ) 177 | ELSE() 178 | SET(MKL_IOMP5_LIBRARY "") # no need for mac 179 | ENDIF() 180 | ENDIF() 181 | 182 | foreach (MODEVAR ${MKL_MODE_VARIANTS}) 183 | foreach (THREADVAR ${MKL_THREAD_VARIANTS}) 184 | if (MKL_CORE_LIBRARY AND MKL_${MODEVAR}_LIBRARY AND MKL_${THREADVAR}_LIBRARY) 185 | set(MKL_${MODEVAR}_${THREADVAR}_LIBRARIES 186 | ${MKL_${MODEVAR}_LIBRARY} ${MKL_${THREADVAR}_LIBRARY} ${MKL_CORE_LIBRARY} 187 | ${MKL_LAPACK_LIBRARY} ${MKL_IOMP5_LIBRARY}) 188 | message("${MODEVAR} ${THREADVAR} ${MKL_${MODEVAR}_${THREADVAR}_LIBRARIES}") # for debug 189 | endif() 190 | endforeach() 191 | endforeach() 192 | 193 | set(MKL_LIBRARIES ${MKL_LP_SEQUENTIAL_LIBRARIES}) 194 | LINK_DIRECTORIES(${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}) # hack 195 | 196 | include(FindPackageHandleStandardArgs) 197 | find_package_handle_standard_args(MKL DEFAULT_MSG MKL_INCLUDE_DIR MKL_LIBRARIES) 198 | 199 | mark_as_advanced(MKL_INCLUDE_DIR MKL_LIBRARIES 200 | MKL_CORE_LIBRARY MKL_LP_LIBRARY MKL_ILP_LIBRARY 201 | MKL_SEQUENTIAL_LIBRARY MKL_INTELTHREAD_LIBRARY MKL_GNUTHREAD_LIBRARY 202 | ) 203 | -------------------------------------------------------------------------------- /FindMUSIC.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find MUSIC headers and library 2 | # Once done this will define: 3 | # 4 | # MUSIC_FOUND - system has Poppler and specified components 5 | # MUSIC_INCLUDE_DIRS - The include directories for Poppler headers 6 | # MUSIC_LIBRARIES - Link these to use Poppler 7 | 8 | if(MUSIC_LIBRARIES ) 9 | # in cache already 10 | set(MUSIC_FIND_QUIETLY TRUE) 11 | endif(MUSIC_LIBRARIES) 12 | 13 | set(MUSIC_FOUND FALSE) 14 | set(MUSIC_INCLUDE_DIRS) 15 | set(MUSIC_LIBRARIES) 16 | 17 | find_path(MUSIC_INCLUDE_DIR NAMES music.hh PATH_SUFFIXES include 18 | HINTS $ENV{MUSIC_ROOT} ${MUSIC_ROOT}) 19 | if(MUSIC_INCLUDE_DIR) 20 | list(APPEND MUSIC_INCLUDE_DIRS ${MUSIC_INCLUDE_DIR}) 21 | endif() 22 | 23 | find_library(MUSIC_LIBRARY NAMES music PATH_SUFFIXES lib 24 | HINTS $ENV{MUSIC_ROOT} ${MUSIC_ROOT}) 25 | if(MUSIC_LIBRARY) 26 | list(APPEND MUSIC_LIBRARIES ${MUSIC_LIBRARY}) 27 | endif() 28 | 29 | include(FindPackageHandleStandardArgs) 30 | find_package_handle_standard_args(MUSIC DEFAULT_MSG 31 | MUSIC_INCLUDE_DIRS MUSIC_LIBRARIES) 32 | 33 | mark_as_advanced(MUSIC_INCLUDE_DIR MUSIC_LIBRARIES) 34 | -------------------------------------------------------------------------------- /FindMaya.cmake: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # 3 | # Ecole Polythechnique Federal De Lausanne (EPFL) 4 | # Brain Mind Institute (BMI) 5 | # Blue Brain Project (BBP) 6 | # Copyrights (c) 2012-2013 7 | # 8 | # Author : Marwam Abdellah 9 | # 10 | ############################################################ 11 | 12 | # Checking REQUIRED or NOT 13 | if(MAYA_FIND_REQUIRED) 14 | set(_maya_output_type FATAL_ERROR) 15 | set(_maya_output 1) 16 | else() 17 | set(_maya_output_type STATUS) 18 | if(NOT Maya_FIND_QUIETLY) 19 | set(_maya_output 1) 20 | endif() 21 | endif() 22 | 23 | find_path(MAYA_ROOT_DIR include/maya/MLibrary.h 24 | /usr/autodesk/maya2013-x64 25 | /usr/autodesk/maya2012-x64 26 | /usr/autodesk/maya8.5-x64 27 | /usr/autodesk/maya8.0-x64 28 | /usr/aw/maya8.0-x64 29 | /usr/autodesk/maya8.5 30 | /usr/autodesk/maya8.0 31 | /usr/aw/maya8.0 32 | /usr/aw/maya7.0 33 | /usr/aw/maya6.5 34 | "$ENV{PROGRAMFILES}/Autodesk/Maya8.5-x64" 35 | "$ENV{PROGRAMFILES}/Autodesk/Maya8.5" 36 | "$ENV{PROGRAMFILES}/Autodesk/Maya8.0-x64" 37 | "$ENV{PROGRAMFILES}/Autodesk/Maya8.0" 38 | "$ENV{PROGRAMFILES}/Alias/Maya8.0-x64" 39 | "$ENV{PROGRAMFILES}/Alias/Maya8.0" 40 | "$ENV{PROGRAMFILES}/Alias/Maya7.0" 41 | "$ENV{PROGRAMFILES}/Alias/Maya6.5" 42 | DOC "Root directory of Maya installation" 43 | ) 44 | 45 | if(MAYA_ROOT_DIR) 46 | # Include & libraries directories 47 | set(MAYA_INCLUDE_DIR "${MAYA_ROOT_DIR}/include") 48 | set(MAYA_LIBRARY_DIR "${MAYA_ROOT_DIR}/lib") 49 | set(MAYE_DEFINITIONS -D_BOOL -DFUNCPROTO -DREQUIRE_IOSTREAM) 50 | 51 | # Checking the libraries 52 | if(UNIX) 53 | set(MAYA_LIBRARY_NAMES OpenMayalib) 54 | endif() 55 | 56 | list(APPEND MAYA_LIBRARY_NAMES Foundation OpenMaya OpenMayaAnim OpenMayaUI 57 | OpenMayaRender OpenMayaFX Cloth Image) 58 | 59 | foreach(MAYA_LIBRARY ${MAYA_LIBRARY_NAMES}) 60 | find_library(MAYA_${MAYA_LIBRARY}_LIBRARY ${MAYA_LIBRARY} 61 | ${MAYA_LIBRARY_DIR} NO_DEFAULT_PATH) 62 | list(APPEND MAYA_LIBRARIES ${MAYA_${MAYA_LIBRARY}_LIBRARY}) 63 | list(APPEND MAYA_LIBRARY_CHECKS MAYA_${MAYA_LIBRARY}_LIBRARY) 64 | endforeach() 65 | 66 | include(FindPackageHandleStandardArgs) 67 | find_package_handle_standard_args(MAYA DEFAULT_MSG MAYA_ROOT_DIR 68 | ${MAYA_LIBRARY_CHECKS}) 69 | else() 70 | if(${_maya_output}) 71 | message(${_maya_output_type} "MAYA_ROOT_DIR not found") 72 | endif() 73 | endif(MAYA_ROOT_DIR) 74 | 75 | if(MAYA_FOUND AND _maya_output) 76 | message(STATUS "Found Maya in ${MAYA_INCLUDE_DIR}:${MAYA_LIBRARIES}") 77 | endif() 78 | 79 | -------------------------------------------------------------------------------- /FindNumPy.cmake: -------------------------------------------------------------------------------- 1 | # Find the Python NumPy package 2 | # PYTHON_NUMPY_INCLUDE_DIR 3 | # PYTHON_NUMPY_FOUND 4 | # will be set by this script 5 | 6 | cmake_minimum_required(VERSION 2.6) 7 | 8 | if(NOT PYTHON_EXECUTABLE) 9 | if(NumPy_FIND_QUIETLY) 10 | find_package(PythonInterp QUIET) 11 | else() 12 | find_package(PythonInterp) 13 | set(__numpy_out 1) 14 | endif() 15 | endif() 16 | 17 | if (PYTHON_EXECUTABLE) 18 | # Find out the include path 19 | execute_process( 20 | COMMAND "${PYTHON_EXECUTABLE}" -c 21 | "from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept:pass\n" 22 | OUTPUT_VARIABLE __numpy_path) 23 | # And the version 24 | execute_process( 25 | COMMAND "${PYTHON_EXECUTABLE}" -c 26 | "from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept:pass\n" 27 | OUTPUT_VARIABLE __numpy_version) 28 | elseif(__numpy_out) 29 | message(STATUS "Python executable not found.") 30 | endif(PYTHON_EXECUTABLE) 31 | 32 | find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h 33 | HINTS "${__numpy_path}" "${PYTHON_INCLUDE_PATH}" NO_DEFAULT_PATH) 34 | 35 | if(PYTHON_NUMPY_INCLUDE_DIR) 36 | set(PYTHON_NUMPY_FOUND 1 CACHE INTERNAL "Python numpy found") 37 | endif(PYTHON_NUMPY_INCLUDE_DIR) 38 | 39 | include(FindPackageHandleStandardArgs) 40 | find_package_handle_standard_args(NumPy REQUIRED_VARS PYTHON_NUMPY_INCLUDE_DIR 41 | VERSION_VAR __numpy_version) 42 | -------------------------------------------------------------------------------- /FindOFED.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011-2012 Stefan Eilemann 2 | 3 | find_path(_ofed_INCLUDE_DIR rdma/rdma_verbs.h 4 | HINTS ${OFED_ROOT}/include 5 | PATHS /usr/include /usr/local/include /opt/local/include) 6 | find_library(_rdma_LIBRARY NAMES rdmacm 7 | HINTS ${OFED_ROOT}/lib 8 | PATHS /usr/lib /usr/local/lib /opt/local/lib) 9 | find_library(_ibverbs_LIBRARY NAMES ibverbs 10 | HINTS ${OFED_ROOT}/lib 11 | PATHS /usr/lib /usr/local/lib /opt/local/lib) 12 | 13 | include(FindPackageHandleStandardArgs) 14 | find_package_handle_standard_args(OFED DEFAULT_MSG 15 | _ofed_INCLUDE_DIR _rdma_LIBRARY _ibverbs_LIBRARY) 16 | 17 | set(OFED_INCLUDE_DIRS ${_ofed_INCLUDE_DIR}) 18 | set(OFED_LIBRARIES ${_rdma_LIBRARY}) 19 | list(APPEND OFED_LIBRARIES ${_ibverbs_LIBRARY}) 20 | 21 | if(OFED_FOUND AND NOT OFED_FIND_QUIETLY) 22 | message(STATUS "Found OFED in ${OFED_INCLUDE_DIRS};${OFED_LIBRARIES}") 23 | endif() 24 | -------------------------------------------------------------------------------- /FindOpenMesh.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014 Stefan.Eilemann@epfl.ch 2 | 3 | find_path(_openMesh_INCLUDE_DIR OpenMesh/Core/Geometry/Config.hh 4 | HINTS ${OPENMESH_ROOT}/include 5 | PATHS /usr/include /usr/local/include /opt/local/include) 6 | 7 | find_library(_openMesh_CORE_LIBRARY NAMES openMeshCore openMeshCored 8 | HINTS ${OPENMESH_ROOT}/lib/OpenMesh 9 | PATHS /usr/lib/OpenMesh /usr/local/lib/OpenMesh /opt/local/lib/OpenMesh) 10 | 11 | find_library(_openMesh_TOOLS_LIBRARY NAMES openMeshTools openMeshToolsd 12 | HINTS ${OPENMESH_ROOT}/lib/OpenMesh 13 | PATHS /usr/lib/OpenMesh /usr/local/lib/OpenMesh /opt/local/lib/OpenMesh) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENMESH DEFAULT_MSG 17 | _openMesh_INCLUDE_DIR _openMesh_CORE_LIBRARY _openMesh_TOOLS_LIBRARY) 18 | 19 | set(OPENMESH_INCLUDE_DIRS ${_openMesh_INCLUDE_DIR}) 20 | set(OPENMESH_LIBRARIES ${_openMesh_CORE_LIBRARY} ${_openMesh_TOOLS_LIBRARY}) 21 | if(OPENMESH_FOUND AND NOT OPENMESH_FIND_QUIETLY) 22 | message(STATUS "Found OpenMesh in ${OPENMESH_INCLUDE_DIRS};${OPENMESH_LIBRARIES}") 23 | endif() 24 | -------------------------------------------------------------------------------- /FindPythonCython.cmake: -------------------------------------------------------------------------------- 1 | # Find the Python Cython package. 2 | # Will set PYTHONCYTHON_FOUND and PYTHONCYTHON_VERSION as appropriate 3 | 4 | include(FindPythonModule) 5 | find_python_module("Cython") 6 | 7 | 8 | -------------------------------------------------------------------------------- /FindPythonModule.cmake: -------------------------------------------------------------------------------- 1 | # Find a specific Python module. 2 | # 3 | # Will set: 4 | # PYTHON${NAME_UPPER}_FOUND if found; 5 | # PYTHON${NAME_UPPER}_VERSION if module __version__ is defined; 6 | # where ${NAME_UPPER} is the capitalized module name. 7 | # 8 | # find_python_module(${MODULE}) will emulate find_package()'s 'quiet' behaviour 9 | # if Python${MODULE}_FIND_QUIETLY is set to a true value, and similarly 10 | # will emulate 'required' behaviour if Python${MODULE}_FIND_REQUIRED 11 | # is set to a true value. (MODULE is case-sensitive.) 12 | 13 | macro(cache_test_and_set KEY MSG FOUND) 14 | if("${MSG}" STREQUAL "${MESSAGE_CACHE_BY_${KEY}}") 15 | set("${FOUND}" 1) 16 | else() 17 | set("${FOUND}" 0) 18 | set("MESSAGE_CACHE_BY_${KEY}" "${MSG}" CACHE INTERNAL "cached reporting message") 19 | endif() 20 | endmacro() 21 | 22 | # Don't repeat a message; check by looking up key in cache 23 | macro(fail_message key msg) 24 | if(REQUIRED) 25 | message(FATAL_ERROR "${msg}") 26 | elseif (NOT QUIET) 27 | cache_test_and_set("${key}" "${msg}" FOUND) 28 | if(NOT FOUND) 29 | message(STATUS "${msg}") 30 | endif() 31 | endif() 32 | endmacro() 33 | 34 | macro(success_message key msg) 35 | if(NOT QUIET) 36 | cache_test_and_set("${key}" "${msg}" FOUND) 37 | if(NOT FOUND) 38 | message(STATUS "${msg}") 39 | endif() 40 | endif() 41 | endmacro() 42 | 43 | function(find_python_module MODULENAME) 44 | string(TOUPPER ${MODULENAME} NAME_UPPER) 45 | 46 | set(QUIET ${Python${MODULENAME}_FIND_QUIETLY}) 47 | set(REQUIRED ${Python${MODULENAME}_FIND_REQUIRED}) 48 | 49 | find_package(PythonInterp ${QUIET} ${REQUIRED}) 50 | 51 | if(NOT PYTHON_EXECUTABLE) 52 | fail_message(PYTHON_${MODULENAME} "No python interpreter found") 53 | set(PYTHON${NAME_UPPER}_FOUND 0) 54 | else() 55 | execute_process(COMMAND ${PYTHON_EXECUTABLE} -c 56 | "import ${MODULENAME} as x; print x.__version__ if hasattr(x,'__version__') else ''" 57 | ERROR_QUIET 58 | RESULT_VARIABLE RV 59 | OUTPUT_VARIABLE MODVER 60 | OUTPUT_STRIP_TRAILING_WHITESPACE) 61 | if(NOT RV) 62 | set(PYTHON${NAME_UPPER}_FOUND 1 CACHE INTERNAL "Python module ${MODULENAME} found") 63 | set(PYTHON${NAME_UPPER}_VERSION "${MODVER}" CACHE INTERNAL "Python module ${MODULENAME} version") 64 | success_message(PYTHON${MODULENAME} "Found python module ${MODULENAME}: (found version \"${MODVER}\")") 65 | else() 66 | fail_message(PYTHON${MODULENAME} "Could NOT find python module ${MODULENAME}") 67 | endif() 68 | endif() 69 | endfunction() 70 | 71 | -------------------------------------------------------------------------------- /FindPythonh5py.cmake: -------------------------------------------------------------------------------- 1 | # Find the Python h5py package. 2 | # Will set PYTHONH5PY_FOUND and PYTHONH5PY_VERSION as appropriate 3 | 4 | include(FindPythonModule) 5 | find_python_module("h5py") 6 | -------------------------------------------------------------------------------- /FindPythonnose.cmake: -------------------------------------------------------------------------------- 1 | # Find the Python nose package. 2 | # Will set PYTHONNOSE_FOUND and PYTHONNOSE_VERSION as appropriate 3 | 4 | include(FindPythonModule) 5 | find_python_module("nose") 6 | 7 | 8 | -------------------------------------------------------------------------------- /FindQwt.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # The RealityGrid Steerer 3 | # 4 | # Copyright (c) 2002-2009, University of Manchester, United Kingdom. 5 | # All rights reserved. 6 | # 7 | # This software is produced by Research Computing Services, University 8 | # of Manchester as part of the RealityGrid project and associated 9 | # follow on projects, funded by the EPSRC under grants GR/R67699/01, 10 | # GR/R67699/02, GR/T27488/01, EP/C536452/1, EP/D500028/1, 11 | # EP/F00561X/1. 12 | # 13 | # LICENCE TERMS 14 | # 15 | # Redistribution and use in source and binary forms, with or without 16 | # modification, are permitted provided that the following conditions 17 | # are met: 18 | # 19 | # * Redistributions of source code must retain the above copyright 20 | # notice, this list of conditions and the following disclaimer. 21 | # 22 | # * Redistributions in binary form must reproduce the above 23 | # copyright notice, this list of conditions and the following 24 | # disclaimer in the documentation and/or other materials provided 25 | # with the distribution. 26 | # 27 | # * Neither the name of The University of Manchester nor the names 28 | # of its contributors may be used to endorse or promote products 29 | # derived from this software without specific prior written 30 | # permission. 31 | # 32 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 33 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 34 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 35 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 36 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 37 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 38 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 40 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 41 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 42 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 43 | # POSSIBILITY OF SUCH DAMAGE. 44 | # 45 | # Author: Robert Haines 46 | 47 | # QWT_FOUND - system has Qwt 48 | # QWT_INCLUDE_DIR - where to find qwt.h 49 | # QWT_LIBRARIES - the libraries to link against to use Qwt 50 | # QWT_LIBRARY - where to find the Qwt library (not for general use) 51 | 52 | if(NOT QT4_FOUND) 53 | include(FindQt4) 54 | endif(NOT QT4_FOUND) 55 | 56 | set(QWT_FOUND NO) 57 | 58 | if(QT4_FOUND) 59 | find_path(QWT_INCLUDE_DIR qwt.h 60 | PATHS /usr/local/qwt /usr/local /usr/include/qwt-qt4 /usr/include/qwt 61 | /usr/include/qwt5 /usr /opt/local/include/qwt 62 | HINTS $ENV{QWT_ROOT} ${QWT_ROOT} 63 | PATH_SUFFIXES include 64 | ) 65 | 66 | set(QWT_NAMES ${QWT_NAMES} qwt-qt4 qwt5 qwt libqwt-qt4 libqwt) 67 | find_library(QWT_LIBRARY 68 | NAMES ${QWT_NAMES} 69 | PATHS /usr/local/qwt /usr/local /usr $ENV{QWT_ROOT} ${QWT_ROOT} 70 | PATH_SUFFIXES lib 71 | ) 72 | 73 | if(QWT_LIBRARY) 74 | set(QWT_LIBRARIES ${QWT_LIBRARY}) 75 | set(QWT_FOUND YES) 76 | 77 | endif(QWT_LIBRARY) 78 | endif(QT4_FOUND) 79 | 80 | include(FindPackageHandleStandardArgs) 81 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(QWT DEFAULT_MSG QWT_LIBRARIES) 82 | 83 | mark_as_advanced(QWT_INCLUDE_DIR QWT_LIBRARY) 84 | -------------------------------------------------------------------------------- /FindRealityGrid.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # The RealityGrid Steerer 3 | # 4 | # Copyright (c) 2002-2009, University of Manchester, United Kingdom. 5 | # All rights reserved. 6 | # 7 | # This software is produced by Research Computing Services, University 8 | # of Manchester as part of the RealityGrid project and associated 9 | # follow on projects, funded by the EPSRC under grants GR/R67699/01, 10 | # GR/R67699/02, GR/T27488/01, EP/C536452/1, EP/D500028/1, 11 | # EP/F00561X/1. 12 | # 13 | # LICENCE TERMS 14 | # 15 | # Redistribution and use in source and binary forms, with or without 16 | # modification, are permitted provided that the following conditions 17 | # are met: 18 | # 19 | # * Redistributions of source code must retain the above copyright 20 | # notice, this list of conditions and the following disclaimer. 21 | # 22 | # * Redistributions in binary form must reproduce the above 23 | # copyright notice, this list of conditions and the following 24 | # disclaimer in the documentation and/or other materials provided 25 | # with the distribution. 26 | # 27 | # * Neither the name of The University of Manchester nor the names 28 | # of its contributors may be used to endorse or promote products 29 | # derived from this software without specific prior written 30 | # permission. 31 | # 32 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 33 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 34 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 35 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 36 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 37 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 38 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 40 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 41 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 42 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 43 | # POSSIBILITY OF SUCH DAMAGE. 44 | # 45 | # Author: Robert Haines 46 | 47 | set(REG_DIR_DESCRIPTION "directory containing RealityGridConfig.cmake. This is either the root of the build tree, or PREFIX/lib/RealityGrid for an installation.") 48 | set(REG_DIR_MESSAGE "RealityGrid not found. Set the RealityGrid_DIR cmake cache entry to the ${REG_DIR_DESCRIPTION}") 49 | 50 | #--------------------------------------------------------- 51 | # Search only if the location is not already known. 52 | if(NOT RealityGrid_DIR) 53 | find_path(RealityGrid_DIR UseRealityGrid.cmake 54 | HINTS $ENV{STEER_LIB_ROOT} ${STEER_LIB_ROOT} $ENV{REG_STEER_HOME} $ENV{REG_HOME}} 55 | PATH_SUFFIXES lib/RealityGrid lib 56 | PATHS /usr /usr/local 57 | DOC "The ${REG_DIR_DESCRIPTION}" 58 | ) 59 | endif(NOT RealityGrid_DIR) 60 | 61 | #--------------------------------------------------------- 62 | 63 | if(RealityGrid_DIR) 64 | # have we really found it? 65 | if(EXISTS ${RealityGrid_DIR}/RealityGridConfig.cmake) 66 | # yes - load settings 67 | set(RealityGrid_FOUND 1) 68 | include(${RealityGrid_DIR}/RealityGridConfig.cmake) 69 | else(EXISTS ${RealityGrid_DIR}/RealityGridConfig.cmake) 70 | # no 71 | set(RealityGrid_FOUND 0) 72 | endif(EXISTS ${RealityGrid_DIR}/RealityGridConfig.cmake) 73 | else(RealityGrid_DIR) 74 | # not found 75 | set(RealityGrid_FOUND 0) 76 | endif(RealityGrid_DIR) 77 | 78 | #--------------------------------------------------------- 79 | 80 | if(NOT RealityGrid_FOUND) 81 | if(RealityGrid_FIND_REQUIRED) 82 | message(FATAL_ERROR ${REG_DIR_MESSAGE}) 83 | else(RealityGrid_FIND_REQUIRED) 84 | if(NOT RealityGrid_FIND_QUIETLY) 85 | message(STATUS ${REG_DIR_MESSAGE}) 86 | endif(NOT RealityGrid_FIND_QUIETLY) 87 | endif(RealityGrid_FIND_REQUIRED) 88 | endif(NOT RealityGrid_FOUND) 89 | -------------------------------------------------------------------------------- /FindSLURM.cmake: -------------------------------------------------------------------------------- 1 | find_program(SLURM_SBATCH_COMMAND sbatch DOC "Path to the SLURM sbatch executable") 2 | find_program(SLURM_SRUN_COMMAND srun DOC "Path to the SLURM srun executable") 3 | find_program(SLURM_SACCTMGR_COMMAND sacctmgr DOC "Path to the SLURM sacctmgr executable") 4 | mark_as_advanced(SLURM_SRUN_COMMAND SLURM_SBATCH_COMMAND SLURM_SACCTMGR_COMMAND) 5 | 6 | if(SLURM_SRUN_COMMAND AND SLURM_SBATCH_COMMAND) 7 | set(SLURM_FOUND true) 8 | if(NOT SLURM_FIND_QUIETLY) 9 | message (STATUS "Found SLURM. SLURM_SBATCH_COMMAND: ${SLURM_SBATCH_COMMAND}, SLURM_SRUN_COMMAND: ${SLURM_SRUN_COMMAND}, SLURM_SACCTMGR_COMMAND: ${SLURM_SACCTMGR_COMMAND}") 10 | endif() 11 | else() 12 | set(SLURM_FOUND false ) 13 | if(SLURM_FIND_REQUIRED) 14 | message(FATAL_ERROR "Could not find SLURM") 15 | elseif(NOT SLURM_FIND_QUIETLY) 16 | message(STATUS "Could not find SLURM") 17 | endif() 18 | endif() 19 | 20 | -------------------------------------------------------------------------------- /FindSpatialIndex.cmake: -------------------------------------------------------------------------------- 1 | # Find Spatialindex 2 | # ~~~~~~~~ 3 | # Redistribution and use is allowed according to the terms of the BSD license. 4 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 5 | # 6 | # Once run this will define: 7 | # 8 | # SPATIALINDEX_FOUND = system has Spatialindex lib 9 | # SPATIALINDEX_LIBRARY = full path to the Spatialindex library 10 | # SPATIALINDEX_INCLUDE_DIR = where to find headers 11 | # 12 | 13 | 14 | FIND_PATH(SPATIALINDEX_INCLUDE_DIR NAMES SpatialIndex.h PATHS 15 | /usr/include 16 | /usr/local/include 17 | "$ENV{LIB_DIR}/include" 18 | "$ENV{INCLUDE}" 19 | "$ENV{OSGEO4W_ROOT}/include" 20 | PATH_SUFFIXES spatialindex 21 | ) 22 | 23 | FIND_LIBRARY(SPATIALINDEX_LIBRARY NAMES spatialindex_i spatialindex PATHS 24 | /usr/lib 25 | /usr/local/lib 26 | "$ENV{LIB_DIR}/lib" 27 | "$ENV{LIB}/lib" 28 | "$ENV{OSGEO4W_ROOT}/lib" 29 | ) 30 | 31 | IF (SPATIALINDEX_INCLUDE_DIR AND SPATIALINDEX_LIBRARY) 32 | SET(SPATIALINDEX_FOUND TRUE) 33 | ENDIF (SPATIALINDEX_INCLUDE_DIR AND SPATIALINDEX_LIBRARY) 34 | 35 | IF (SPATIALINDEX_FOUND) 36 | IF (NOT SPATIALINDEX_FIND_QUIETLY) 37 | MESSAGE(STATUS "Found libSpatialIndex: ${SPATIALINDEX_LIBRARY}") 38 | ENDIF (NOT SPATIALINDEX_FIND_QUIETLY) 39 | ELSE (SPATIALINDEX_FOUND) 40 | IF (SPATIALINDEX_FIND_REQUIRED) 41 | MESSAGE(FATAL_ERROR "Could not find libSpatialIndex") 42 | ENDIF (SPATIALINDEX_FIND_REQUIRED) 43 | ENDIF (SPATIALINDEX_FOUND) 44 | -------------------------------------------------------------------------------- /FindUDT.cmake: -------------------------------------------------------------------------------- 1 | 2 | find_path(_udt_INCLUDE_DIR udt.h 3 | HINTS ${UDT_ROOT}/include 4 | PATHS /usr/include /usr/local/include /opt/local/include /usr/include/udt) 5 | 6 | find_library(_udt_LIBRARY NAMES udt 7 | HINTS ${UDT_ROOT}/lib 8 | PATHS /usr/lib /usr/local/lib /opt/local/lib) 9 | 10 | include(FindPackageHandleStandardArgs) 11 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(UDT DEFAULT_MSG 12 | _udt_INCLUDE_DIR _udt_LIBRARY) 13 | 14 | set(UDT_INCLUDE_DIRS ${_udt_INCLUDE_DIR}) 15 | set(UDT_LIBRARIES ${_udt_LIBRARY}) 16 | if(_udt_INCLUDE_DIR) 17 | file(STRINGS "${_udt_INCLUDE_DIR}/udt.h" UDT_HAS_RCVDATA REGEX UDT_RCVDATA) 18 | endif() 19 | 20 | if(UDT_FOUND AND NOT UDT_FIND_QUIETLY) 21 | message(STATUS "Found UDT in ${UDT_INCLUDE_DIRS};${UDT_LIBRARIES}") 22 | endif() 23 | 24 | -------------------------------------------------------------------------------- /FindVRPN.cmake: -------------------------------------------------------------------------------- 1 | # - try to find VRPN library 2 | # 3 | # Cache Variables: 4 | # VRPN_LIBRARY 5 | # VRPN_SERVER_LIBRARY 6 | # VRPN_INCLUDE_DIR 7 | # 8 | # Non-cache variables you might use in your CMakeLists.txt: 9 | # VRPN_FOUND 10 | # VRPN_SERVER_LIBRARIES - server libraries 11 | # VRPN_LIBRARIES - client libraries 12 | # VRPN_CLIENT_DEFINITIONS - definitions if you only use the client library 13 | # VRPN_DEFINITIONS - Client-only definition if all we found was the client library. 14 | # VRPN_INCLUDE_DIRS 15 | # 16 | # VRPN_ROOT_DIR is searched preferentially for these files 17 | # 18 | # Requires these CMake modules: 19 | # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) 20 | # 21 | # Original Author: 22 | # 2009-2012 Ryan Pavlik 23 | # http://academic.cleardefinition.com 24 | # Iowa State University HCI Graduate Program/VRAC 25 | # 26 | # Copyright Iowa State University 2009-2012. 27 | # Distributed under the Boost Software License, Version 1.0. 28 | # (See accompanying file LICENSE_1_0.txt or copy at 29 | # http://www.boost.org/LICENSE_1_0.txt) 30 | 31 | set(VRPN_ROOT_DIR 32 | "${VRPN_ROOT_DIR}" 33 | CACHE 34 | PATH 35 | "Root directory to search for VRPN") 36 | 37 | if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8") 38 | set(_libsuffixes lib64 lib) 39 | 40 | # 64-bit dir: only set on win64 41 | file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles) 42 | else() 43 | set(_libsuffixes lib) 44 | set(_PF86 "ProgramFiles(x86)") 45 | if(NOT "$ENV{${_PF86}}" STREQUAL "") 46 | # 32-bit dir: only set on win64 47 | file(TO_CMAKE_PATH "$ENV{${_PF86}}" _progfiles) 48 | else() 49 | # 32-bit dir on win32, useless to us on win64 50 | file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles) 51 | endif() 52 | endif() 53 | 54 | set(_vrpn_quiet) 55 | if(VRPN_FIND_QUIETLY) 56 | set(_vrpn_quiet QUIET) 57 | endif() 58 | 59 | ### 60 | # Configure VRPN 61 | ### 62 | 63 | find_path(VRPN_INCLUDE_DIR 64 | NAMES 65 | vrpn_Connection.h 66 | PATH_SUFFIXES 67 | include 68 | include/vrpn 69 | HINTS 70 | "${VRPN_ROOT_DIR}" 71 | PATHS 72 | "${_progfiles}/VRPN" 73 | C:/usr/local 74 | /usr/local) 75 | 76 | find_library(VRPN_LIBRARY 77 | NAMES 78 | vrpn 79 | PATH_SUFFIXES 80 | ${_libsuffixes} 81 | HINTS 82 | "${VRPN_ROOT_DIR}" 83 | PATHS 84 | "${_progfiles}/VRPN" 85 | C:/usr/local 86 | /usr/local) 87 | 88 | find_library(VRPN_SERVER_LIBRARY 89 | NAMES 90 | vrpnserver 91 | PATH_SUFFIXES 92 | ${_libsuffixes} 93 | HINTS 94 | "${VRPN_ROOT_DIR}" 95 | PATHS 96 | "${_progfiles}/VRPN" 97 | C:/usr/local 98 | /usr/local) 99 | 100 | ### 101 | # Dependencies 102 | ### 103 | set(_deps_libs) 104 | set(_deps_includes) 105 | set(_deps_check) 106 | 107 | find_package(quatlib ${_vrpn_quiet}) 108 | list(APPEND _deps_libs ${QUATLIB_LIBRARIES}) 109 | list(APPEND _deps_includes ${QUATLIB_INCLUDE_DIRS}) 110 | list(APPEND _deps_check QUATLIB_FOUND) 111 | 112 | if(NOT WIN32) 113 | find_package(Threads ${_vrpn_quiet}) 114 | list(APPEND _deps_libs ${CMAKE_THREAD_LIBS_INIT}) 115 | list(APPEND _deps_check Threads_FOUND) 116 | endif() 117 | 118 | if(WIN32) 119 | find_package(Libusb1 QUIET) 120 | if(LIBUSB1_FOUND) 121 | list(APPEND _deps_libs ${LIBUSB1_LIBRARIES}) 122 | list(APPEND _deps_includes ${LIBUSB1_INCLUDE_DIRS}) 123 | endif() 124 | endif() 125 | 126 | 127 | # handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if 128 | # all listed variables are TRUE 129 | include(FindPackageHandleStandardArgs) 130 | find_package_handle_standard_args(VRPN 131 | DEFAULT_MSG 132 | VRPN_LIBRARY 133 | VRPN_INCLUDE_DIR 134 | ${_deps_check}) 135 | 136 | if(VRPN_FOUND) 137 | set(VRPN_INCLUDE_DIRS "${VRPN_INCLUDE_DIR}" ${_deps_includes}) 138 | set(VRPN_LIBRARIES "${VRPN_LIBRARY}" ${_deps_libs}) 139 | set(VRPN_SERVER_LIBRARIES "${VRPN_SERVER_LIBRARY}" ${_deps_libs}) 140 | 141 | if(VRPN_LIBRARY) 142 | set(VRPN_CLIENT_DEFINITIONS -DVRPN_CLIENT_ONLY) 143 | else() 144 | unset(VRPN_CLIENT_DEFINITIONS) 145 | endif() 146 | 147 | if(VRPN_LIBRARY AND NOT VRPN_SERVER_LIBRARY) 148 | set(VRPN_DEFINITIONS -DVRPN_CLIENT_ONLY) 149 | else() 150 | unset(VRPN_DEFINITIONS) 151 | endif() 152 | 153 | mark_as_advanced(VRPN_ROOT_DIR) 154 | endif() 155 | 156 | mark_as_advanced(VRPN_LIBRARY VRPN_SERVER_LIBRARY VRPN_INCLUDE_DIR) 157 | -------------------------------------------------------------------------------- /FindVTune.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2013-2014 Stefan.Eilemann@epfl.ch 3 | # finds the ittnotify API 4 | # if not found, installs a dummy ittnotify.h to build_dir/include to eliminate 5 | # the need to protect the itt calls with ifdefs 6 | 7 | find_program(VTUNE_EXECUTABLE amplxe-cl) 8 | if(NOT VTUNE_EXECUTABLE) 9 | set(VTUNE_FOUND) 10 | configure_file(${CMAKE_CURRENT_LIST_DIR}/ittnotify.h 11 | ${PROJECT_BINARY_DIR}/include/ittnotify.h COPYONLY) 12 | add_definitions(-DINTEL_NO_ITTNOTIFY_API) 13 | return() 14 | endif() 15 | 16 | get_filename_component(VTUNE_DIR ${VTUNE_EXECUTABLE} PATH) 17 | set(VTUNE_DIR "${VTUNE_DIR}/..") 18 | 19 | find_path(VTUNE_INCLUDE_DIR ittnotify.h 20 | HINTS ${VTUNE_DIR}/include 21 | PATHS /usr/include /usr/local/include /opt/local/include) 22 | 23 | find_library(VTUNE_ITTNOTIFY_LIBRARY NAMES ittnotify 24 | HINTS ${VTUNE_DIR}/lib64 25 | PATHS /usr/lib /usr/local/lib /opt/local/lib) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(VTune DEFAULT_MSG 29 | VTUNE_INCLUDE_DIR VTUNE_ITTNOTIFY_LIBRARY) 30 | 31 | set(VTUNE_INCLUDE_DIRS ${VTUNE_INCLUDE_DIR}) 32 | set(VTUNE_LIBRARIES ${VTUNE_ITTNOTIFY_LIBRARY}) 33 | if(UNIX) 34 | list(APPEND VTUNE_LIBRARIES dl) 35 | endif() 36 | set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DINTEL_NO_ITTNOTIFY_API") 37 | set(CMAKE_CXX_FLAGS_RELEASE 38 | "${CMAKE_CXX_FLAGS_RELEASE} -DINTEL_NO_ITTNOTIFY_API") 39 | -------------------------------------------------------------------------------- /FindWiiuse.cmake: -------------------------------------------------------------------------------- 1 | # _____________________________________________________________________________ 2 | # 3 | # WIIUSE 4 | # _____________________________________________________________________________ 5 | 6 | # PATH ________________________________________________________________________ 7 | 8 | if(NOT WIIUSE_PATH) 9 | find_path(WIIUSE_PATH include/wiiuse.h 10 | HINTS ${WIIUSE_ROOT} $ENV{WIIUSE_ROOT} 11 | /usr/local/ 12 | /usr/) 13 | endif() 14 | 15 | # HEADERS _____________________________________________________________________ 16 | 17 | if(WIIUSE_PATH) 18 | set (WIIUSE_INCLUDE_DIR ${WIIUSE_PATH}/include) 19 | mark_as_advanced (WIIUSE_INCLUDE_DIR) 20 | endif() 21 | 22 | # STATIC LIBRARY ______________________________________________________________ 23 | 24 | if(WIIUSE_PATH) 25 | find_library(WIIUSE_LIBRARIES NAMES wiiuse 26 | HINTS ${WIIUSE_ROOT} $ENV{WIIUSE_ROOT} 27 | PATHS ${WIIUSE_PATH}/lib) 28 | mark_as_advanced(WIIUSE_LIBRARIES) 29 | endif() 30 | 31 | find_package_handle_standard_args(Wiiuse DEFAULT_MSG 32 | WIIUSE_LIBRARIES WIIUSE_INCLUDE_DIR) 33 | -------------------------------------------------------------------------------- /FindXDR.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # The RealityGrid Steering Library 3 | # 4 | # Copyright (c) 2002-2010, University of Manchester, United Kingdom. 5 | # All rights reserved. 6 | # 7 | # This software is produced by Research Computing Services, University 8 | # of Manchester as part of the RealityGrid project and associated 9 | # follow on projects, funded by the EPSRC under grants GR/R67699/01, 10 | # GR/R67699/02, GR/T27488/01, EP/C536452/1, EP/D500028/1, 11 | # EP/F00561X/1. 12 | # 13 | # LICENCE TERMS 14 | # 15 | # Redistribution and use in source and binary forms, with or without 16 | # modification, are permitted provided that the following conditions 17 | # are met: 18 | # 19 | # * Redistributions of source code must retain the above copyright 20 | # notice, this list of conditions and the following disclaimer. 21 | # 22 | # * Redistributions in binary form must reproduce the above 23 | # copyright notice, this list of conditions and the following 24 | # disclaimer in the documentation and/or other materials provided 25 | # with the distribution. 26 | # 27 | # * Neither the name of The University of Manchester nor the names 28 | # of its contributors may be used to endorse or promote products 29 | # derived from this software without specific prior written 30 | # permission. 31 | # 32 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 33 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 34 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 35 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 36 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 37 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 38 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 40 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 41 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 42 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 43 | # POSSIBILITY OF SUCH DAMAGE. 44 | # 45 | # Author: Robert Haines 46 | 47 | if(XDR_INCLUDE_DIR) 48 | # already in cache so be quiet 49 | set(XDR_FIND_QUIETLY TRUE) 50 | endif(XDR_INCLUDE_DIR) 51 | 52 | # if we have rpc.h then we may *need* it for xdr.h 53 | # so don't only look for xdr.h 54 | find_path(RPC_INCLUDE_DIR "rpc/rpc.h") 55 | 56 | # might only have xdr.h 57 | if(RPC_INCLUDE_DIR STREQUAL "RPC_INCLUDE_DIR-NOTFOUND") 58 | find_path(XDR_INCLUDE_DIR "rpc/xdr.h") 59 | if(NOT XDR_INCLUDE_DIR STREQUAL "XDR_INCLUDE_DIR-NOTFOUND") 60 | set(REG_HAS_XDR_H 1) 61 | endif(NOT XDR_INCLUDE_DIR STREQUAL "XDR_INCLUDE_DIR-NOTFOUND") 62 | else(RPC_INCLUDE_DIR STREQUAL "RPC_INCLUDE_DIR-NOTFOUND") 63 | set(REG_HAS_RPC_H 1) 64 | set(XDR_INCLUDE_DIR ${RPC_INCLUDE_DIR}) 65 | endif(RPC_INCLUDE_DIR STREQUAL "RPC_INCLUDE_DIR-NOTFOUND") 66 | 67 | # find the lib and add it if found 68 | find_library(XDR_LIBRARY NAMES rpc xdr_s xdr openxdr) 69 | if(NOT XDR_LIBRARY STREQUAL "XDR_LIBRARY-NOTFOUND") 70 | set(REG_EXTERNAL_LIBS ${REG_EXTERNAL_LIBS} ${XDR_LIBRARY}) 71 | endif(NOT XDR_LIBRARY STREQUAL "XDR_LIBRARY-NOTFOUND") 72 | 73 | mark_as_advanced(RPC_INCLUDE_DIR XDR_INCLUDE_DIR XDR_LIBRARY) 74 | 75 | # tend not to need a separate lib on Unix systems 76 | # do need one for Windows and Cygwin 77 | include(FindPackageHandleStandardArgs) 78 | if(UNIX) 79 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR DEFAULT_MSG XDR_INCLUDE_DIR) 80 | else(UNIX) 81 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR DEFAULT_MSG XDR_INCLUDE_DIR XDR_LIBRARY) 82 | endif(UNIX) 83 | -------------------------------------------------------------------------------- /Findcppcheck.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * \file Findcppcheck.cpp 3 | * \brief Dummy C++ source file used by CMake module Findcppcheck.cmake 4 | * 5 | * \author 6 | * Ryan Pavlik, 2009-2010 7 | * 8 | * http://academic.cleardefinition.com/ 9 | * 10 | */ 11 | 12 | 13 | 14 | int main(int, char**) { 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Findcpplint.cmake: -------------------------------------------------------------------------------- 1 | # - try to find CPPLINT tool 2 | # 3 | # Cache Variable: 4 | # CPPLINT_SCRIPT 5 | # 6 | # Non-cache variables you might use in your CMakeLists.txt: 7 | # CPPLINT_FOUND 8 | # CPPLINT_ROOT_DIR 9 | # CPPLINT_DEFAULT_LOCATIONS 10 | # CPPLINT_NOT_FOUND_MSG 11 | # CPPLINT_FIND_QUIETLY 12 | # CPPLINT_MARK_AS_ADVANCED - whether to mark our vars as advanced even 13 | # if we don't find this program. 14 | # 15 | # Requires these CMake modules: 16 | # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) 17 | # FindPythonInterp 18 | # FindPythonLibs 19 | 20 | # Check python installation as cpplint is a python script 21 | if(NOT PYTHON_EXECUTABLE) 22 | find_package(PythonInterp QUIET) 23 | endif() 24 | 25 | if(NOT PYTHONLIBS_FOUND) 26 | find_package(PythonLibs QUIET) 27 | endif() 28 | 29 | if(PYTHON_EXECUTABLE AND PYTHONLIBS_FOUND) 30 | set(_python_found true) 31 | endif() 32 | 33 | file(TO_CMAKE_PATH "${CPPLINT_ROOT_DIR}" CPPLINT_ROOT_DIR) 34 | set(CPPLINT_ROOT_DIR 35 | "${CPPLINT_ROOT_DIR}" 36 | CACHE 37 | PATH 38 | "Path to search for cpplint") 39 | 40 | if(CPPLINT_SCRIPT AND NOT EXISTS "${CPPLINT_SCRIPT}") 41 | set(CPPLINT_SCRIPT NOTFOUND CACHE PATH "" FORCE) 42 | endif(CPPLINT_SCRIPT AND NOT EXISTS "${CPPLINT_SCRIPT}") 43 | 44 | # If we have a custom path, look there first. 45 | if(CPPLINT_ROOT_DIR) 46 | find_file(CPPLINT_SCRIPT 47 | NAMES cpplint.py 48 | PATHS "${CPPLINT_ROOT_DIR}" 49 | NO_DEFAULT_PATH) 50 | endif(CPPLINT_ROOT_DIR) 51 | 52 | set(CPPLINT_SCRIPT_DEFAULT_LOCATIONS 53 | "${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/util" "${PROJECT_SOURCE_DIR}/scripts" 54 | "${PROJECT_SOURCE_DIR}/util/scripts" "${CMAKE_CURRENT_LIST_DIR}/util") 55 | 56 | find_file(CPPLINT_SCRIPT 57 | NAMES cpplint.py 58 | PATHS ${CPPLINT_SCRIPT_DEFAULT_LOCATIONS}) 59 | 60 | include(FindPackageHandleStandardArgs) 61 | 62 | if(_python_found) 63 | set(CPPLINT_NOT_FOUND_MSG "Could NOT find cpplint.py. Please copy e.g. http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py into one of the following directories:\n") 64 | 65 | foreach(location ${CPPLINT_SCRIPT_DEFAULT_LOCATIONS}) 66 | set(CPPLINT_NOT_FOUND_MSG "${CPPLINT_NOT_FOUND_MSG} ${location} \n") 67 | endforeach(location ${CPPLINT_SCRIPT_DEFAULT_LOCATIONS}) 68 | set(CPPLINT_NOT_FOUND_MSG "${CPPLINT_NOT_FOUND_MSG} or set CPPLINT_ROOT_DIR to the desired location\n") 69 | else(_python_found) 70 | set(CPPLINT_NOT_FOUND_MSG "Could NOT find python needed to run cpplint.py. Please check both executable and libraries are installed.") 71 | endif(_python_found) 72 | 73 | find_package_handle_standard_args(cpplint "${CPPLINT_NOT_FOUND_MSG}" PYTHON_EXECUTABLE PYTHONLIBS_FOUND CPPLINT_SCRIPT) 74 | 75 | if(CPPLINT_FOUND OR CPPLINT_MARK_AS_ADVANCED) 76 | mark_as_advanced(CPPLINT_ROOT_DIR) 77 | endif(CPPLINT_FOUND OR CPPLINT_MARK_AS_ADVANCED) 78 | 79 | mark_as_advanced(CPPLINT_SCRIPT) 80 | 81 | if(CPPLINT_FOUND AND NOT cpplint_FIND_QUIETLY) 82 | message(STATUS "Found cpplint in ${CPPLINT_SCRIPT}") 83 | endif(CPPLINT_FOUND AND NOT cpplint_FIND_QUIETLY) 84 | -------------------------------------------------------------------------------- /Findcppnetlib.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015 Grigori Chevtchenko 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # - Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # - Redistributions in binary form must reproduce the above copyright notice, 10 | # this list of conditions and the following disclaimer in the documentation 11 | # and/or other materials provided with the distribution. 12 | # - Neither the name of Eyescale Software GmbH nor the names of its 13 | # contributors may be used to endorse or promote products derived from this 14 | # software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | # POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | # ============================================================================= 29 | # 30 | # CPPNETLIB 31 | # 32 | #============================================================================== 33 | # This module uses the following input variables: 34 | # 35 | # CPPNETLIB_ROOT - Path to the cpp-netlib module 36 | # 37 | # This module defines the following output variables: 38 | # 39 | # CPPNETLIB_FOUND - Was cppnetlib and all of the specified components found? 40 | # 41 | # CPPNETLIB_INCLUDE_DIRS - Where to find the headers 42 | # 43 | # CPPNETLIB_LIBRARIES - The cppnetlib libraries 44 | #============================================================================== 45 | # 46 | 47 | # Assume not found. 48 | set(CPPNETLIB_FOUND FALSE) 49 | set(CPPNETLIB_PATH) 50 | 51 | # Find headers 52 | find_path(CPPNETLIB_INCLUDE_DIR boost/network.hpp 53 | HINTS ${CPPNETLIB_ROOT}/include $ENV{CPPNETLIB_ROOT}/include 54 | ${COMMON_SOURCE_DIR}/cppnetlib ${CMAKE_SOURCE_DIR}/cppnetlib 55 | /usr/local/include 56 | /usr/include) 57 | 58 | if(CPPNETLIB_INCLUDE_DIR) 59 | set(CPPNETLIB_PATH "${CPPNETLIB_INCLUDE_DIR}/..") 60 | endif() 61 | 62 | # Find dynamic libraries 63 | if(CPPNETLIB_PATH) 64 | set(__libraries cppnetlib-client-connections 65 | cppnetlib-server-parsers 66 | cppnetlib-uri) 67 | 68 | foreach(__library ${__libraries}) 69 | if(TARGET ${__library}) 70 | list(APPEND CPPNETLIB_LIBRARIES ${__library}) 71 | set(CPPNETLIB_FOUND_SUBPROJECT ON) 72 | else() 73 | find_library(${__library} NAMES ${__library} 74 | HINTS ${CPPNETLIB_ROOT} $ENV{CPPNETLIB_ROOT} 75 | PATHS ${CPPNETLIB_PATH}/lib64 ${CPPNETLIB_PATH}/lib) 76 | list(APPEND CPPNETLIB_LIBRARIES ${${__library}}) 77 | endif() 78 | endforeach() 79 | mark_as_advanced(CPPNETLIB_LIBRARIES) 80 | endif() 81 | 82 | 83 | if(NOT cppnetlib_FIND_QUIETLY) 84 | set(_cppnetlib_output 1) 85 | endif() 86 | 87 | include(FindPackageHandleStandardArgs) 88 | find_package_handle_standard_args(cppnetlib DEFAULT_MSG 89 | CPPNETLIB_LIBRARIES 90 | CPPNETLIB_INCLUDE_DIR) 91 | 92 | if(CPPNETLIB_FOUND) 93 | set(CPPNETLIB_INCLUDE_DIRS ${CPPNETLIB_INCLUDE_DIR}) 94 | if(_cppnetlib_output ) 95 | message(STATUS "Found cppnetlib in ${CPPNETLIB_INCLUDE_DIR}:${CPPNETLIB_LIBRARIES}") 96 | endif() 97 | else() 98 | set(CPPNETLIB_FOUND) 99 | set(CPPNETLIB_INCLUDE_DIR) 100 | set(CPPNETLIB_INCLUDE_DIRS) 101 | set(CPPNETLIB_LIBRARIES) 102 | endif() 103 | -------------------------------------------------------------------------------- /Findgmock.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Julio Delgado Mangas 2 | # 3 | # - Try to find Google's gmock 4 | # This module defines 5 | # 6 | # GMOCK_FOUND 7 | # GMOCK_INCLUDE_DIRS 8 | # GMOCK_LIBRARIES 9 | # GTEST_LIBRARIES 10 | 11 | find_path(GMOCK_INCLUDE_DIR gmock/gmock.h) 12 | find_path(GTEST_INCLUDE_DIR gtest/gtest.h) 13 | 14 | find_library(GMOCK_LIB NAMES libgmock.a) 15 | find_library(GMOCK_LIB_MAIN NAMES libgmock_main.a) 16 | 17 | set(GMOCK_LIBRARIES ${GMOCK_LIB} ${GMOCK_LIB_MAIN}) 18 | set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR}) 19 | set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR}) 20 | 21 | include(FindPackageHandleStandardArgs) 22 | find_package_handle_standard_args(gmock DEFAULT_MSG 23 | GMOCK_LIB 24 | GMOCK_LIB_MAIN 25 | GMOCK_INCLUDE_DIR 26 | GTEST_INCLUDE_DIR 27 | ) 28 | 29 | mark_as_advanced(GMOCK_LIB 30 | GMOCK_LIB_MAIN 31 | GMOCK_INCLUDE_DIR 32 | GTEST_INCLUDE_DIR 33 | ) 34 | -------------------------------------------------------------------------------- /Findhttpxx.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Stefan.Eilemann@epfl.ch 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # - Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # - Redistributions in binary form must reproduce the above copyright notice, 10 | # this list of conditions and the following disclaimer in the documentation 11 | # and/or other materials provided with the distribution. 12 | # - Neither the name of Eyescale Software GmbH nor the names of its 13 | # contributors may be used to endorse or promote products derived from this 14 | # software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | # POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | # ============================================================================= 29 | # 30 | # HTTPXX 31 | # 32 | #============================================================================== 33 | # This module uses the following input variables: 34 | # 35 | # HTTPXX_ROOT - Path to the httpxx module 36 | # 37 | # This module defines the following output variables: 38 | # 39 | # HTTPXX_FOUND - Was httpxx and all of the specified components found? 40 | # 41 | # HTTPXX_INCLUDE_DIRS - Where to find the headers 42 | # 43 | # HTTPXX_LIBRARIES - The httpxx libraries 44 | #============================================================================== 45 | # 46 | 47 | # Assume not found. 48 | set(HTTPXX_FOUND FALSE) 49 | set(HTTPXX_PATH) 50 | 51 | # Find headers 52 | find_path(HTTPXX_INCLUDE_DIR httpxx/Message.hpp 53 | HINTS ${HTTPXX_ROOT}/include $ENV{HTTPXX_ROOT}/include 54 | ${COMMON_SOURCE_DIR}/httpxx ${CMAKE_SOURCE_DIR}/httpxx 55 | /usr/local/include /opt/local/include /usr/include) 56 | 57 | if(HTTPXX_INCLUDE_DIR) 58 | set(HTTPXX_PATH "${HTTPXX_INCLUDE_DIR}/..") 59 | endif() 60 | 61 | # Find dynamic libraries 62 | if(HTTPXX_PATH) 63 | set(__libraries httpxx) 64 | 65 | foreach(__library ${__libraries}) 66 | if(TARGET ${__library}) 67 | list(APPEND HTTPXX_LIBRARIES ${__library}) 68 | set(HTTPXX_FOUND_SUBPROJECT ON) 69 | else() 70 | find_library(${__library} NAMES ${__library} 71 | HINTS ${HTTPXX_ROOT} $ENV{HTTPXX_ROOT} 72 | PATHS ${HTTPXX_PATH}/lib64 ${HTTPXX_PATH}/lib) 73 | list(APPEND HTTPXX_LIBRARIES ${${__library}}) 74 | endif() 75 | endforeach() 76 | mark_as_advanced(HTTPXX_LIBRARIES) 77 | endif() 78 | 79 | if(NOT httpxx_FIND_QUIETLY) 80 | set(_httpxx_output 1) 81 | endif() 82 | 83 | include(FindPackageHandleStandardArgs) 84 | find_package_handle_standard_args(httpxx DEFAULT_MSG HTTPXX_LIBRARIES 85 | HTTPXX_INCLUDE_DIR) 86 | 87 | if(HTTPXX_FOUND) 88 | set(HTTPXX_INCLUDE_DIRS ${HTTPXX_INCLUDE_DIR}) 89 | if(_httpxx_output ) 90 | message(STATUS "Found httpxx in ${HTTPXX_INCLUDE_DIR}:${HTTPXX_LIBRARIES}") 91 | endif() 92 | else() 93 | set(HTTPXX_FOUND) 94 | set(HTTPXX_INCLUDE_DIR) 95 | set(HTTPXX_INCLUDE_DIRS) 96 | set(HTTPXX_LIBRARIES) 97 | endif() 98 | -------------------------------------------------------------------------------- /Findhwloc.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Marwan Abdellah 2 | # Daniel Nachbaur 3 | # 2013 Stefan.Eilemann@epfl.ch 4 | 5 | # Use pkg-config to fetch the contents of the .pc file 6 | # After that, use the directories refer to the libraries and 7 | # also the headers 8 | 9 | if(NOT PKGCONFIG_FOUND) 10 | find_package(PkgConfig QUIET) 11 | endif() 12 | 13 | if(HWLOC_ROOT) 14 | set(ENV{PKG_CONFIG_PATH} "${HWLOC_ROOT}/lib/pkgconfig") 15 | else() 16 | foreach(PREFIX ${CMAKE_PREFIX_PATH}) 17 | set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig") 18 | endforeach() 19 | set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") 20 | endif() 21 | 22 | if(hwloc_FIND_REQUIRED) 23 | set(_hwloc_OPTS "REQUIRED") 24 | endif() 25 | if(hwloc_FIND_QUIETLY) 26 | set(_hwloc_OPTS "QUIET") 27 | endif() 28 | if(hwloc_FIND_REQUIRED AND hwloc_FIND_QUIETLY) 29 | set(_hwloc_OPTS "REQUIRED QUIET") 30 | endif() 31 | if(NOT hwloc_FIND_QUIETLY) 32 | set(_hwloc_output 1) 33 | endif() 34 | 35 | if(hwloc_FIND_VERSION) 36 | if(hwloc_FIND_VERSION_EXACT) 37 | pkg_check_modules(hwloc ${_hwloc_OPTS} hwloc=${hwloc_FIND_VERSION}) 38 | else() 39 | pkg_check_modules(hwloc ${_hwloc_OPTS} hwloc>=${hwloc_FIND_VERSION}) 40 | endif() 41 | else() 42 | pkg_check_modules(hwloc ${_hwloc_OPTS} hwloc) 43 | endif() 44 | 45 | if(hwloc_FOUND) 46 | include(FindPackageHandleStandardArgs) 47 | find_package_handle_standard_args(hwloc DEFAULT_MSG hwloc_LIBRARIES 48 | hwloc_INCLUDE_DIR) 49 | 50 | if(NOT ${hwloc_VERSION} VERSION_LESS 1.7.0) 51 | set(hwloc_GL_FOUND 1) 52 | endif() 53 | 54 | if(_hwloc_output) 55 | message(STATUS 56 | "Found hwloc ${hwloc_VERSION} in ${hwloc_INCLUDE_DIR}:${hwloc_LIBRARIES}") 57 | endif() 58 | endif() 59 | -------------------------------------------------------------------------------- /Findjack.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Stefan.Eilemann@epfl.ch 2 | 3 | # Use pkg-config to fetch the contents of the .pc file 4 | # After that, use the directories refer to the libraries and 5 | # also the headers 6 | 7 | find_package(PkgConfig) 8 | 9 | if(JACK_ROOT) 10 | set(ENV{PKG_CONFIG_PATH} "${JACK_ROOT}/lib/pkgconfig") 11 | else() 12 | foreach(PREFIX ${CMAKE_PREFIX_PATH}) 13 | set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig") 14 | endforeach() 15 | set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") 16 | endif() 17 | 18 | if(jack_FIND_REQUIRED) 19 | set(_jack_OPTS "REQUIRED") 20 | elseif(jack_FIND_QUIETLY) 21 | set(_jack_OPTS "QUIET") 22 | else() 23 | set(_jack_output 1) 24 | endif() 25 | 26 | if(jack_FIND_VERSION) 27 | if(jack_FIND_VERSION_EXACT) 28 | pkg_check_modules(JACK ${_jack_OPTS} jack=${jack_FIND_VERSION}) 29 | else() 30 | pkg_check_modules(JACK ${_jack_OPTS} jack>=${jack_FIND_VERSION}) 31 | endif() 32 | else() 33 | pkg_check_modules(JACK ${_jack_OPTS} jack) 34 | endif() 35 | 36 | if(JACK_FOUND) 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(JACK DEFAULT_MSG JACK_LIBRARIES) 39 | 40 | if(_jack_output) 41 | message(STATUS 42 | "Found jack ${JACK_VERSION} in ${JACK_INCLUDE_DIRS}:${JACK_LIBRARIES}") 43 | endif() 44 | endif() 45 | -------------------------------------------------------------------------------- /Findleveldb.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014 Stefan.Eilemann@epfl.ch 2 | 3 | # - Try to find the Leveldb library 4 | # Once done this will define 5 | # 6 | # LEVELDB_ROOT - Set this variable to the root installation 7 | # 8 | # Read-Only variables: 9 | # LEVELDB_FOUND - system has the Leveldb library 10 | # LEVELDB_INCLUDE_DIR - the Leveldb include directory 11 | # LEVELDB_LIBRARIES - The libraries needed to use Leveldb 12 | # LEVELDB_VERSION - This is set to $major.$minor.$patch (eg. 0.9.8) 13 | 14 | include(FindPackageHandleStandardArgs) 15 | 16 | if(leveldb_FIND_REQUIRED) 17 | set(_LEVELDB_output_type FATAL_ERROR) 18 | else() 19 | set(_LEVELDB_output_type STATUS) 20 | endif() 21 | 22 | if(leveldb_FIND_QUIETLY) 23 | set(_LEVELDB_output) 24 | else() 25 | set(_LEVELDB_output 1) 26 | endif() 27 | 28 | find_path(_LEVELDB_INCLUDE_DIR leveldb/db.h 29 | HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{LEVELDB_ROOT} ${LEVELDB_ROOT} 30 | PATH_SUFFIXES include 31 | PATHS /usr /usr/local /opt /opt/local) 32 | 33 | if(_LEVELDB_INCLUDE_DIR AND EXISTS "${_LEVELDB_INCLUDE_DIR}/leveldb/db.h") 34 | set(_LEVELDB_Version_file "${_LEVELDB_INCLUDE_DIR}/leveldb/db.h") 35 | file(READ ${_LEVELDB_Version_file} _LEVELDB_header_contents) 36 | string(REGEX REPLACE ".*kMajorVersion = ([0-9]+).*kMinorVersion = ([0-9]+).*" 37 | "\\1.\\2" _LEVELDB_VERSION "${_LEVELDB_header_contents}") 38 | set(LEVELDB_VERSION ${_LEVELDB_VERSION} CACHE INTERNAL 39 | "The version of leveldb which was detected") 40 | else() 41 | set(_LEVELDB_EPIC_FAIL TRUE) 42 | if(_LEVELDB_output) 43 | message(${_LEVELDB_output_type} 44 | "Can't find leveldb header file leveldb/db.h.") 45 | endif() 46 | endif() 47 | 48 | # Version checking 49 | if(LEVELDB_FIND_VERSION AND LEVELDB_VERSION) 50 | if(LEVELDB_FIND_VERSION_EXACT) 51 | if(NOT LEVELDB_VERSION VERSION_EQUAL ${LEVELDB_FIND_VERSION}) 52 | set(_LEVELDB_version_not_exact TRUE) 53 | endif() 54 | else() 55 | # version is too low 56 | if(NOT LEVELDB_VERSION VERSION_EQUAL ${LEVELDB_FIND_VERSION} AND 57 | NOT LEVELDB_VERSION VERSION_GREATER ${LEVELDB_FIND_VERSION}) 58 | set(_LEVELDB_version_not_high_enough TRUE) 59 | endif() 60 | endif() 61 | endif() 62 | 63 | find_library(LEVELDB_LIBRARY leveldb 64 | HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{LEVELDB_ROOT} ${LEVELDB_ROOT} 65 | PATH_SUFFIXES lib lib64 66 | PATHS /usr /usr/local /opt /opt/local) 67 | 68 | # Inform the users with an error message based on what version they 69 | # have vs. what version was required. 70 | if(NOT LEVELDB_VERSION) 71 | set(_LEVELDB_EPIC_FAIL TRUE) 72 | if(_LEVELDB_output) 73 | message(${_LEVELDB_output_type} 74 | "Version not found in ${_LEVELDB_Version_file}.") 75 | endif() 76 | elseif(_LEVELDB_version_not_high_enough) 77 | set(_LEVELDB_EPIC_FAIL TRUE) 78 | if(_LEVELDB_output) 79 | message(${_LEVELDB_output_type} 80 | "Version ${LEVELDB_FIND_VERSION} or higher of leveldb is required. " 81 | "Version ${LEVELDB_VERSION} was found in ${_LEVELDB_Version_file}.") 82 | endif() 83 | elseif(_LEVELDB_version_not_exact) 84 | set(_LEVELDB_EPIC_FAIL TRUE) 85 | if(_LEVELDB_output) 86 | message(${_LEVELDB_output_type} 87 | "Version ${LEVELDB_FIND_VERSION} of leveldb is required exactly. " 88 | "Version ${LEVELDB_VERSION} was found.") 89 | endif() 90 | else() 91 | if(leveldb_FIND_REQUIRED) 92 | if(LEVELDB_LIBRARY MATCHES "LEVELDB_LIBRARY-NOTFOUND") 93 | message(FATAL_ERROR "Missing the leveldb library.\n" 94 | "Consider using CMAKE_PREFIX_PATH or the LEVELDB_ROOT environment variable. " 95 | "See the ${CMAKE_CURRENT_LIST_FILE} for more details.") 96 | endif() 97 | endif() 98 | find_package_handle_standard_args(leveldb DEFAULT_MSG 99 | LEVELDB_LIBRARY _LEVELDB_INCLUDE_DIR) 100 | endif() 101 | 102 | if(_LEVELDB_EPIC_FAIL) 103 | # Zero out everything, we didn't meet version requirements 104 | set(LEVELDB_FOUND FALSE) 105 | set(LEVELDB_LIBRARY) 106 | set(_LEVELDB_INCLUDE_DIR) 107 | set(LEVELDB_INCLUDE_DIRS) 108 | set(LEVELDB_LIBRARIES) 109 | else() 110 | set(LEVELDB_INCLUDE_DIRS ${_LEVELDB_INCLUDE_DIR}) 111 | set(LEVELDB_LIBRARIES ${LEVELDB_LIBRARY}) 112 | if(_LEVELDB_output) 113 | message(STATUS 114 | "Found leveldb ${LEVELDB_VERSION} in ${LEVELDB_INCLUDE_DIRS};${LEVELDB_LIBRARIES}") 115 | endif() 116 | endif() 117 | -------------------------------------------------------------------------------- /Findlo.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Stefan.Eilemann@epfl.ch 2 | 3 | # Use pkg-config to fetch the contents of the .pc file 4 | # After that, use the directories refer to the libraries and 5 | # also the headers 6 | 7 | find_package(PkgConfig) 8 | 9 | if(LO_ROOT) 10 | set(ENV{PKG_CONFIG_PATH} "${LO_ROOT}/lib/pkgconfig") 11 | else() 12 | foreach(PREFIX ${CMAKE_PREFIX_PATH}) 13 | set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig") 14 | endforeach() 15 | set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") 16 | endif() 17 | 18 | if(lo_FIND_REQUIRED) 19 | set(_lo_OPTS "REQUIRED") 20 | elseif(lo_FIND_QUIETLY) 21 | set(_lo_OPTS "QUIET") 22 | else() 23 | set(_lo_output 1) 24 | endif() 25 | 26 | if(lo_FIND_VERSION) 27 | if(lo_FIND_VERSION_EXACT) 28 | pkg_check_modules(LO ${_lo_OPTS} liblo=${lo_FIND_VERSION}) 29 | else() 30 | pkg_check_modules(LO ${_lo_OPTS} liblo>=${lo_FIND_VERSION}) 31 | endif() 32 | else() 33 | pkg_check_modules(LO ${_lo_OPTS} liblo) 34 | endif() 35 | 36 | if(LO_FOUND) 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(LO DEFAULT_MSG LO_LIBRARIES) 39 | 40 | if(_lo_output) 41 | message(STATUS 42 | "Found lo ${LO_VERSION} in ${LO_INCLUDE_DIRS}:${LO_LIBRARIES}") 43 | endif() 44 | endif() 45 | -------------------------------------------------------------------------------- /Findquatlib.cmake: -------------------------------------------------------------------------------- 1 | # - Find quatlib 2 | # Find the quatlib headers and libraries. 3 | # 4 | # QUATLIB_INCLUDE_DIRS - where to find quat.h 5 | # QUATLIB_LIBRARIES - List of libraries when using quatlib. 6 | # QUATLIB_FOUND - True if quatlib found. 7 | # 8 | # Original Author: 9 | # 2009-2010 Ryan Pavlik 10 | # http://academic.cleardefinition.com 11 | # Iowa State University HCI Graduate Program/VRAC 12 | # 13 | # Copyright Iowa State University 2009-2010. 14 | # Distributed under the Boost Software License, Version 1.0. 15 | # (See accompanying file LICENSE_1_0.txt or copy at 16 | # http://www.boost.org/LICENSE_1_0.txt) 17 | 18 | if(TARGET quat) 19 | # Look for the header file. 20 | find_path(QUATLIB_INCLUDE_DIR NAMES quat.h 21 | PATHS ${quatlib_SOURCE_DIR}) 22 | 23 | set(QUATLIB_LIBRARY "quat") 24 | 25 | else() 26 | set(QUATLIB_ROOT_DIR 27 | "${QUATLIB_ROOT_DIR}" 28 | CACHE 29 | PATH 30 | "Root directory to search for quatlib") 31 | if(DEFINED VRPN_ROOT_DIR AND NOT QUATLIB_ROOT_DIR) 32 | set(QUATLIB_ROOT_DIR "${VRPN_ROOT_DIR}") 33 | mark_as_advanced(QUATLIB_ROOT_DIR) 34 | endif() 35 | 36 | if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8") 37 | set(_libsuffixes lib64 lib) 38 | 39 | # 64-bit dir: only set on win64 40 | file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles) 41 | else() 42 | set(_libsuffixes lib) 43 | set(_PF86 "ProgramFiles(x86)") 44 | if(NOT "$ENV{${_PF86}}" STREQUAL "") 45 | # 32-bit dir: only set on win64 46 | file(TO_CMAKE_PATH "$ENV{${_PF86}}" _progfiles) 47 | else() 48 | # 32-bit dir on win32, useless to us on win64 49 | file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles) 50 | endif() 51 | endif() 52 | 53 | # Look for the header file. 54 | find_path(QUATLIB_INCLUDE_DIR 55 | NAMES 56 | quat.h 57 | HINTS 58 | "${QUATLIB_ROOT_DIR}" 59 | PATH_SUFFIXES 60 | include 61 | PATHS 62 | "${_progfiles}/VRPN" 63 | "${_progfiles}/quatlib" 64 | C:/usr/local 65 | /usr/local) 66 | 67 | # Look for the library. 68 | find_library(QUATLIB_LIBRARY 69 | NAMES 70 | quat.lib 71 | libquat.a 72 | HINTS 73 | "${QUATLIB_ROOT_DIR}" 74 | PATH_SUFFIXES 75 | ${_libsuffixes} 76 | PATHS 77 | "${_progfiles}/VRPN" 78 | "${_progfiles}/quatlib" 79 | C:/usr/local 80 | /usr/local) 81 | endif() 82 | 83 | # handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if 84 | # all listed variables are TRUE 85 | include(FindPackageHandleStandardArgs) 86 | find_package_handle_standard_args(quatlib 87 | DEFAULT_MSG 88 | QUATLIB_LIBRARY 89 | QUATLIB_INCLUDE_DIR) 90 | 91 | if(QUATLIB_FOUND) 92 | set(QUATLIB_LIBRARIES ${QUATLIB_LIBRARY}) 93 | if(NOT WIN32) 94 | list(APPEND QUATLIB_LIBRARIES m) 95 | endif() 96 | set(QUATLIB_INCLUDE_DIRS ${QUATLIB_INCLUDE_DIR}) 97 | 98 | mark_as_advanced(QUATLIB_ROOT_DIR) 99 | else() 100 | set(QUATLIB_LIBRARIES) 101 | set(QUATLIB_INCLUDE_DIRS) 102 | endif() 103 | 104 | mark_as_advanced(QUATLIB_LIBRARY QUATLIB_INCLUDE_DIR) 105 | -------------------------------------------------------------------------------- /Findrados.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 MohamedGhaith.Kaabi@gmail.com 2 | 3 | # - Try to find the Rados library 4 | # Once done this will define 5 | # 6 | # RADOS_ROOT - Set this variable to the root installation 7 | # 8 | # Read-Only variables: 9 | # RADOS_FOUND - system has the Rados library 10 | # RADOS_INCLUDE_DIR - the Rados include directory 11 | # RADOS_LIBRARIES - The libraries needed to use Rados 12 | # RADOS_VERSION - This is set to $major.$minor.$patch (eg. 0.9.8) 13 | 14 | include(FindPackageHandleStandardArgs) 15 | 16 | if(rados_FIND_REQUIRED) 17 | set(_RADOS_output_type FATAL_ERROR) 18 | else() 19 | set(_RADOS_output_type STATUS) 20 | endif() 21 | 22 | if(rados_FIND_QUIETLY) 23 | set(_RADOS_output) 24 | else() 25 | set(_RADOS_output 1) 26 | endif() 27 | 28 | find_path(_RADOS_INCLUDE_DIR rados/librados.hpp 29 | HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{RADOS_ROOT} ${RADOS_ROOT} 30 | PATH_SUFFIXES include 31 | PATHS /usr /usr/local /opt /opt/local) 32 | 33 | find_library(RADOS_LIBRARY rados 34 | HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{RADOS_ROOT} ${RADOS_ROOT} 35 | PATH_SUFFIXES lib lib64 36 | PATHS /usr /usr/local /opt /opt/local) 37 | 38 | if(rados_FIND_REQUIRED) 39 | if(RADOS_LIBRARY MATCHES "RADOS_LIBRARY-NOTFOUND") 40 | message(FATAL_ERROR "Missing the rados library.\n" 41 | "Consider using CMAKE_PREFIX_PATH or the RADOS_ROOT environment variable. " 42 | "See the ${CMAKE_CURRENT_LIST_FILE} for more details.") 43 | endif() 44 | endif() 45 | find_package_handle_standard_args(rados DEFAULT_MSG 46 | RADOS_LIBRARY _RADOS_INCLUDE_DIR) 47 | 48 | if(_RADOS_EPIC_FAIL) 49 | set(RADOS_FOUND FALSE) 50 | set(RADOS_LIBRARY) 51 | set(_RADOS_INCLUDE_DIR) 52 | set(RADOS_INCLUDE_DIRS) 53 | set(RADOS_LIBRARIES) 54 | else() 55 | set(RADOS_INCLUDE_DIRS ${_RADOS_INCLUDE_DIR}) 56 | set(RADOS_LIBRARIES ${RADOS_LIBRARY}) 57 | if(_RADOS_output) 58 | message(STATUS 59 | "Found rados in ${RADOS_INCLUDE_DIRS};${RADOS_LIBRARIES}") 60 | endif() 61 | endif() 62 | -------------------------------------------------------------------------------- /Findrocksdb.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014 Stefan.Eilemann@epfl.ch 2 | 3 | # - Try to find the Rocksdb library 4 | # Once done this will define 5 | # 6 | # ROCKSDB_ROOT - Set this variable to the root installation 7 | # 8 | # Read-Only variables: 9 | # ROCKSDB_FOUND - system has the Rocksdb library 10 | # ROCKSDB_INCLUDE_DIR - the Rocksdb include directory 11 | # ROCKSDB_LIBRARIES - The libraries needed to use Rocksdb 12 | # ROCKSDB_VERSION - This is set to $major.$minor.$patch (eg. 0.9.8) 13 | 14 | include(FindPackageHandleStandardArgs) 15 | 16 | if(rocksdb_FIND_REQUIRED) 17 | set(_ROCKSDB_output_type FATAL_ERROR) 18 | set(_ROCKSDB_output 1) 19 | else() 20 | set(_ROCKSDB_output_type STATUS) 21 | if(rocksdb_FIND_QUIETLY) 22 | set(_ROCKSDB_output) 23 | else() 24 | set(_ROCKSDB_output 1) 25 | endif() 26 | endif() 27 | 28 | find_path(_ROCKSDB_INCLUDE_DIR rocksdb/db.h 29 | HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{ROCKSDB_ROOT} ${ROCKSDB_ROOT} 30 | PATH_SUFFIXES include 31 | PATHS /usr /usr/local /opt /opt/local) 32 | 33 | if(EXISTS "${_ROCKSDB_INCLUDE_DIR}/rocksdb/version.h") 34 | set(_ROCKSDB_Version_file "${_ROCKSDB_INCLUDE_DIR}/rocksdb/version.h") 35 | elseif(EXISTS "${_ROCKSDB_INCLUDE_DIR}/rocksdb/db.h") 36 | set(_ROCKSDB_Version_file "${_ROCKSDB_INCLUDE_DIR}/rocksdb/db.h") 37 | endif() 38 | if(_ROCKSDB_INCLUDE_DIR AND _ROCKSDB_Version_file) 39 | file(READ ${_ROCKSDB_Version_file} _ROCKSDB_header_contents) 40 | string(REGEX REPLACE ".*kMajorVersion = ([0-9]+).*kMinorVersion = ([0-9]+).*" 41 | "\\1.\\2" _ROCKSDB_VERSION "${_ROCKSDB_header_contents}") 42 | string(REGEX REPLACE ".*ROCKSDB_MAJOR ([0-9]+).*ROCKSDB_MINOR ([0-9]+).*" 43 | "\\1.\\2" _ROCKSDB_VERSION "${_ROCKSDB_header_contents}") 44 | set(ROCKSDB_VERSION ${_ROCKSDB_VERSION} CACHE INTERNAL 45 | "The version of rocksdb which was detected") 46 | else() 47 | set(_ROCKSDB_EPIC_FAIL TRUE) 48 | if(_ROCKSDB_output) 49 | message(${_ROCKSDB_output_type} 50 | "Can't find rocksdb header file rocksdb/db.h.") 51 | endif() 52 | endif() 53 | 54 | # Version checking 55 | if(ROCKSDB_FIND_VERSION AND ROCKSDB_VERSION) 56 | if(ROCKSDB_FIND_VERSION_EXACT) 57 | if(NOT ROCKSDB_VERSION VERSION_EQUAL ${ROCKSDB_FIND_VERSION}) 58 | set(_ROCKSDB_version_not_exact TRUE) 59 | endif() 60 | else() 61 | # version is too low 62 | if(NOT ROCKSDB_VERSION VERSION_EQUAL ${ROCKSDB_FIND_VERSION} AND 63 | NOT ROCKSDB_VERSION VERSION_GREATER ${ROCKSDB_FIND_VERSION}) 64 | set(_ROCKSDB_version_not_high_enough TRUE) 65 | endif() 66 | endif() 67 | endif() 68 | 69 | find_library(ROCKSDB_LIBRARY rocksdb 70 | HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{ROCKSDB_ROOT} ${ROCKSDB_ROOT} 71 | PATH_SUFFIXES lib lib64 72 | PATHS /usr /usr/local /opt /opt/local) 73 | 74 | # Inform the users with an error message based on what version they 75 | # have vs. what version was required. 76 | if(NOT ROCKSDB_VERSION) 77 | set(_ROCKSDB_EPIC_FAIL TRUE) 78 | if(_ROCKSDB_output) 79 | message(${_ROCKSDB_output_type} 80 | "Version not found in ${_ROCKSDB_Version_file}.") 81 | endif() 82 | elseif(_ROCKSDB_version_not_high_enough) 83 | set(_ROCKSDB_EPIC_FAIL TRUE) 84 | if(_ROCKSDB_output) 85 | message(${_ROCKSDB_output_type} 86 | "Version ${ROCKSDB_FIND_VERSION} or higher of rocksdb is required. " 87 | "Version ${ROCKSDB_VERSION} was found in ${_ROCKSDB_Version_file}.") 88 | endif() 89 | elseif(_ROCKSDB_version_not_exact) 90 | set(_ROCKSDB_EPIC_FAIL TRUE) 91 | if(_ROCKSDB_output) 92 | message(${_ROCKSDB_output_type} 93 | "Version ${ROCKSDB_FIND_VERSION} of rocksdb is required exactly. " 94 | "Version ${ROCKSDB_VERSION} was found.") 95 | endif() 96 | else() 97 | if(ROCKSDB_FIND_REQUIRED) 98 | if(ROCKSDB_LIBRARY MATCHES "ROCKSDB_LIBRARY-NOTFOUND") 99 | message(FATAL_ERROR "Missing the rocksdb library.\n" 100 | "Consider using CMAKE_PREFIX_PATH or the ROCKSDB_ROOT environment variable. " 101 | "See the ${CMAKE_CURRENT_LIST_FILE} for more details.") 102 | endif() 103 | endif() 104 | find_package_handle_standard_args(ROCKSDB DEFAULT_MSG 105 | ROCKSDB_LIBRARY _ROCKSDB_INCLUDE_DIR) 106 | endif() 107 | 108 | if(_ROCKSDB_EPIC_FAIL) 109 | # Zero out everything, we didn't meet version requirements 110 | set(ROCKSDB_FOUND FALSE) 111 | set(ROCKSDB_LIBRARY) 112 | set(_ROCKSDB_INCLUDE_DIR) 113 | set(ROCKSDB_INCLUDE_DIRS) 114 | set(ROCKSDB_LIBRARIES) 115 | else() 116 | set(ROCKSDB_INCLUDE_DIRS ${_ROCKSDB_INCLUDE_DIR}) 117 | set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) 118 | if(_ROCKSDB_output) 119 | message(STATUS 120 | "Found rocksdb ${ROCKSDB_VERSION} in ${ROCKSDB_INCLUDE_DIRS};${ROCKSDB_LIBRARIES}") 121 | endif() 122 | endif() 123 | -------------------------------------------------------------------------------- /Findv4l2.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Daniel.Nachbaur@epfl.ch 2 | 3 | # Use pkg-config to fetch the contents of the .pc file 4 | # After that, use the directories refer to the libraries and 5 | # also the headers 6 | 7 | find_package(PkgConfig) 8 | 9 | if(V4L2_ROOT) 10 | set(ENV{PKG_CONFIG_PATH} "${V4L2_ROOT}/lib/pkgconfig") 11 | else() 12 | foreach(PREFIX ${CMAKE_PREFIX_PATH}) 13 | set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig") 14 | endforeach() 15 | set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") 16 | endif() 17 | 18 | if(v4l2_FIND_REQUIRED) 19 | set(_v4l2_OPTS "REQUIRED") 20 | elseif(v4l2_FIND_QUIETLY) 21 | set(_v4l2_OPTS "QUIET") 22 | else() 23 | set(_v4l2_output 1) 24 | endif() 25 | 26 | if(v4l2_FIND_VERSION) 27 | if(v4l2_FIND_VERSION_EXACT) 28 | pkg_check_modules(V4L2 ${_v4l2_OPTS} libv4l2=${v4l2_FIND_VERSION}) 29 | else() 30 | pkg_check_modules(V4L2 ${_v4l2_OPTS} libv4l2>=${v4l2_FIND_VERSION}) 31 | endif() 32 | else() 33 | pkg_check_modules(V4L2 ${_v4l2_OPTS} libv4l2) 34 | endif() 35 | 36 | if(V4L2_FOUND) 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(V4L2 DEFAULT_MSG V4L2_LIBRARIES) 39 | 40 | if(_v4l2_output) 41 | message(STATUS 42 | "Found v4l2 ${V4L2_VERSION} in ${V4L2_INCLUDE_DIRS}:${V4L2_LIBRARIES}") 43 | endif() 44 | endif() 45 | -------------------------------------------------------------------------------- /Findvncserver.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Stefan.Eilemann@epfl.ch 2 | 3 | # Use pkg-config to fetch the contents of the .pc file 4 | # After that, use the directories refer to the libraries and 5 | # also the headers 6 | 7 | find_package(PkgConfig) 8 | 9 | if(VNCSERVER_ROOT) 10 | set(ENV{PKG_CONFIG_PATH} "${VNCSERVER_ROOT}/lib/pkgconfig") 11 | else() 12 | foreach(PREFIX ${CMAKE_PREFIX_PATH}) 13 | set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig") 14 | endforeach() 15 | set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") 16 | endif() 17 | 18 | if(vncserver_FIND_REQUIRED) 19 | set(_vncserver_OPTS "REQUIRED") 20 | elseif(vncserver_FIND_QUIETLY) 21 | set(_vncserver_OPTS "QUIET") 22 | else() 23 | set(_vncserver_output 1) 24 | endif() 25 | 26 | if(vncserver_FIND_VERSION) 27 | if(vncserver_FIND_VERSION_EXACT) 28 | pkg_check_modules(VNCSERVER ${_vncserver_OPTS} libvncserver=${vncserver_FIND_VERSION}) 29 | else() 30 | pkg_check_modules(VNCSERVER ${_vncserver_OPTS} libvncserver>=${vncserver_FIND_VERSION}) 31 | endif() 32 | else() 33 | pkg_check_modules(VNCSERVER ${_vncserver_OPTS} libvncserver) 34 | endif() 35 | 36 | if(VNCSERVER_FOUND) 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(VNCSERVER DEFAULT_MSG VNCSERVER_LIBRARIES) 39 | 40 | if(_vncserver_output) 41 | message(STATUS 42 | "Found vncserver ${VNCSERVER_VERSION} in ${VNCSERVER_INCLUDE_DIRS}:${VNCSERVER_LIBRARIES}") 43 | endif() 44 | endif() 45 | -------------------------------------------------------------------------------- /Findyasm.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Daniel Nachbaur 2 | 3 | include(FindPackageHandleStandardArgs) 4 | 5 | find_program(YASM_EXECUTABLE yasm 6 | HINTS $ENV{YASM_ROOT} ${YASM_ROOT} 7 | PATH_SUFFIXES bin 8 | ) 9 | 10 | find_package_handle_standard_args(yasm DEFAULT_MSG YASM_EXECUTABLE) 11 | -------------------------------------------------------------------------------- /GetSourceFilesFromTarget.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 Daniel.Nachbaur@epfl.ch 2 | # 3 | # Provide the function get_source_files() to get all (C++) source files from the 4 | # given target and filtering them with a regex pattern. The returned list of 5 | # files is stored in ${_target}_FILES. 6 | 7 | function(get_source_files _target _exclude_pattern) 8 | get_target_property(_imported_target "${_name}" IMPORTED) 9 | if(_imported_target) 10 | return() 11 | endif() 12 | 13 | get_target_property(_sources "${_target}" SOURCES) 14 | set(${_target}_FILES) 15 | foreach(_source ${_sources}) 16 | get_source_file_property(_lang "${_source}" LANGUAGE) 17 | get_source_file_property(_loc "${_source}" LOCATION) 18 | if("${_lang}" MATCHES "CXX" AND NOT ${_loc} MATCHES ${_exclude_pattern}) 19 | list(APPEND ${_target}_FILES "${_loc}") 20 | endif() 21 | endforeach() 22 | set(${_target}_FILES ${${_target}_FILES} PARENT_SCOPE) 23 | endfunction() 24 | -------------------------------------------------------------------------------- /GitHooks.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Juan Hernando 2 | # 3 | 4 | if(NOT GIT_FOUND) 5 | find_package(Git QUIET) 6 | endif() 7 | 8 | if(NOT CLANG_FORMAT) 9 | find_program(CLANG_FORMAT clang-format) 10 | endif() 11 | 12 | # Installing clang-format precommit hook if prerequisites are met and it doesn't 13 | # exist yet. 14 | if(GIT_FOUND AND CLANG_FORMAT AND EXISTS ${PROJECT_SOURCE_DIR}/.git AND 15 | NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) 16 | 17 | # We cannot write the file from here because we need exec permissions 18 | configure_file(${CMAKE_SOURCE_DIR}/CMake/common/util/git_pre-commit.in 19 | ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) 20 | endif() 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /GitInfo.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011-2014 Stefan Eilemann 2 | 3 | # Sets the following variables if git is found: 4 | # GIT_REVISION: The current HEAD sha hash 5 | # GIT_STATE: A description of the working tree, e.g., 1.8.0-48-g6d23f80-dirty 6 | # GIT_ORIGIN_URL: The origin of the working tree 7 | # GIT_ROOT_URL: The root remote of the working tree 8 | # GIT_BRANCH: The name of the current branch 9 | # GIT_AUTHORS: A list of all authors in the git history 10 | 11 | if(GIT_INFO_DONE_${PROJECT_NAME}) 12 | return() 13 | endif() 14 | 15 | set(GIT_INFO_DONE_${PROJECT_NAME} ON) 16 | set(GIT_STATE) 17 | set(GIT_ORIGIN_URL) 18 | set(GIT_ROOT_URL) 19 | set(GIT_BRANCH) 20 | 21 | if(EXISTS ${PROJECT_SOURCE_DIR}/.git) 22 | if(NOT GIT_FOUND) 23 | find_package(Git QUIET) 24 | endif() 25 | if(GIT_FOUND) 26 | execute_process( COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD 27 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 28 | OUTPUT_VARIABLE GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE) 29 | execute_process( COMMAND "${GIT_EXECUTABLE}" describe --long --tags --dirty --always 30 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 31 | OUTPUT_VARIABLE GIT_STATE OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) 32 | execute_process( COMMAND "${GIT_EXECUTABLE}" config --get remote.origin.url 33 | OUTPUT_VARIABLE GIT_ORIGIN_URL OUTPUT_STRIP_TRAILING_WHITESPACE 34 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) 35 | execute_process( COMMAND "${GIT_EXECUTABLE}" config --get remote.root.url 36 | OUTPUT_VARIABLE GIT_ROOT_URL OUTPUT_STRIP_TRAILING_WHITESPACE 37 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) 38 | execute_process( COMMAND "${GIT_EXECUTABLE}" branch --contains HEAD 39 | OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE 40 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) 41 | 42 | if(EXISTS ${PROJECT_BINARY_DIR}/Authors.txt) 43 | file(READ ${PROJECT_BINARY_DIR}/Authors.txt GIT_AUTHORS) 44 | else() 45 | # cache authors to not slow down cmake runs 46 | set(GIT_AUTHORS) 47 | execute_process(COMMAND "${GIT_EXECUTABLE}" log 48 | OUTPUT_VARIABLE GIT_LOG OUTPUT_STRIP_TRAILING_WHITESPACE 49 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) 50 | string(REPLACE "\n" ";" GIT_LOG ${GIT_LOG}) 51 | foreach(__line ${GIT_LOG}) 52 | if(__line MATCHES "^Author:") 53 | string(REPLACE "Author: " "" __line "${__line}") 54 | string(REGEX REPLACE "[ ]?<.*" "" __line "${__line}") 55 | list(APPEND GIT_AUTHORS "${__line}") 56 | endif() 57 | endforeach() 58 | list(SORT GIT_AUTHORS) 59 | list(REMOVE_DUPLICATES GIT_AUTHORS) 60 | file(WRITE ${PROJECT_BINARY_DIR}/Authors.txt "${GIT_AUTHORS}") 61 | endif() 62 | 63 | if(NOT GIT_ROOT_URL) 64 | set(GIT_ROOT_URL ${GIT_ORIGIN_URL}) 65 | endif() 66 | if(NOT GIT_STATE) 67 | set(GIT_STATE "") 68 | endif() 69 | if(GIT_BRANCH) 70 | string(REPLACE "* " "" GIT_BRANCH ${GIT_BRANCH}) 71 | endif() 72 | 73 | else() 74 | message(STATUS "No revision version support, git not found") 75 | endif() 76 | endif() 77 | 78 | if(NOT GIT_REVISION) 79 | set(GIT_REVISION "0") 80 | endif() 81 | -------------------------------------------------------------------------------- /GitTargets.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2016 Stefan.Eilemann@epfl.ch 2 | # See doc/GitTargets.md for documentation 3 | 4 | # Targets: 5 | # * ${PROJECT_NAME}-branch: Create a new branch for developing the current 6 | # version and push it to origin. The branch name is MAJOR.MINOR. 7 | # * ${PROJECT_NAME}-cut: Delete the current version branch locally and remote. 8 | # * ${PROJECT_NAME}-tag: Create the version branch if needed, and create a tag 9 | # release-VERSION on the version branch HEAD. Pushes the tag to the 10 | # origin repository. 11 | # * ${PROJECT_NAME}-untag: Delete the current tag locally and remote 12 | # * ${PROJECT_NAME}-retag: Move an existing tag to HEAD 13 | # * tarball: Run ${PROJECT_NAME}-tarball for all projects 14 | # * ${PROJECT_NAME}-tarball: Create an archive of the source code at 15 | # PROJECT_VERSION 16 | # Targets for internal use: 17 | # * ${PROJECT_NAME}-make-branch: Used by ${PROJECT_NAME}-branch to create a new 18 | # local branch 19 | # * ${PROJECT_NAME}-create-tarball: Used by ${PROJECT_NAME}-tarball 20 | 21 | if(GITTARGETS_FOUND) 22 | return() 23 | endif() 24 | set(GITTARGETS_FOUND 1) 25 | 26 | if(NOT GIT_FOUND) 27 | find_package(Git QUIET) 28 | endif() 29 | if(NOT GIT_EXECUTABLE) 30 | return() 31 | endif() 32 | 33 | find_program(GZIP_EXECUTABLE gzip) 34 | 35 | # branch 36 | set(BRANCH_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) 37 | add_custom_target(${PROJECT_NAME}-make-branch 38 | COMMAND "${GIT_EXECUTABLE}" checkout ${BRANCH_VERSION} || "${GIT_EXECUTABLE}" checkout -b ${BRANCH_VERSION} 39 | COMMENT "Create local branch ${BRANCH_VERSION}" 40 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" 41 | ) 42 | 43 | if(TARGET ${PROJECT_NAME}-flatten-gitexternal) 44 | set(BRANCH_DEP ${PROJECT_NAME}-flatten-gitexternal) 45 | else() 46 | set(BRANCH_DEP ${PROJECT_NAME}-make-branch) 47 | endif() 48 | 49 | add_custom_target(${PROJECT_NAME}-branch 50 | COMMAND "${GIT_EXECUTABLE}" push origin ${BRANCH_VERSION} 51 | COMMENT "Add remote branch ${BRANCH_VERSION}" 52 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" 53 | DEPENDS ${BRANCH_DEP} 54 | ) 55 | 56 | # remove branch 57 | add_custom_target(${PROJECT_NAME}-cut 58 | COMMAND "${GIT_EXECUTABLE}" branch -d ${BRANCH_VERSION} 59 | COMMAND "${GIT_EXECUTABLE}" push origin --delete ${BRANCH_VERSION} 60 | COMMENT "Remove branch ${BRANCH_VERSION}" 61 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" 62 | ) 63 | 64 | # tag on branch 65 | file(WRITE ${PROJECT_BINARY_DIR}/gitbranchandtag.cmake 66 | "# Branch: 67 | execute_process(COMMAND \"${GIT_EXECUTABLE}\" branch ${BRANCH_VERSION} 68 | RESULT_VARIABLE hadbranch ERROR_VARIABLE error 69 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) 70 | if(NOT hadbranch) 71 | execute_process(COMMAND \"${GIT_EXECUTABLE}\" push origin ${BRANCH_VERSION} 72 | WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}\") 73 | endif() 74 | set(TAG_BRANCH ${BRANCH_VERSION}) 75 | 76 | # Create or move tag 77 | execute_process( 78 | COMMAND \"${GIT_EXECUTABLE}\" tag -f ${PROJECT_VERSION} ${TAG_BRANCH} 79 | COMMAND \"${GIT_EXECUTABLE}\" push --tags 80 | RESULT_VARIABLE notdone WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}\") 81 | if(notdone) 82 | message(FATAL_ERROR 83 | \"Error creating tag ${PROJECT_VERSION} on branch ${TAG_BRANCH}\") 84 | endif()") 85 | 86 | add_custom_target(${PROJECT_NAME}-tag 87 | COMMAND "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/gitbranchandtag.cmake" 88 | COMMENT "Add tag ${PROJECT_VERSION}" 89 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" 90 | ) 91 | 92 | # remove tag 93 | add_custom_target(${PROJECT_NAME}-untag 94 | COMMAND "${GIT_EXECUTABLE}" tag -d ${PROJECT_VERSION} 95 | COMMAND "${GIT_EXECUTABLE}" push origin :${PROJECT_VERSION} 96 | COMMENT "Remove tag ${PROJECT_VERSION}" 97 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" 98 | ) 99 | 100 | # move tag 101 | add_custom_target(${PROJECT_NAME}-retag 102 | COMMAND "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/gitbranchandtag.cmake" 103 | COMMENT "Add tag ${PROJECT_VERSION}" 104 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" 105 | DEPENDS ${PROJECT_NAME}-untag) 106 | 107 | # tarball 108 | set(TARBALL "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.tar") 109 | 110 | add_custom_target(${PROJECT_NAME}-create-tarball 111 | COMMAND "${GIT_EXECUTABLE}" archive --worktree-attributes 112 | --prefix ${PROJECT_NAME}-${PROJECT_VERSION}/ -o ${TARBALL} 113 | ${PROJECT_VERSION} 114 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" 115 | COMMENT "Creating ${TARBALL}" 116 | ) 117 | 118 | if(GZIP_EXECUTABLE) 119 | set(TARBALL_GZ "${TARBALL}.gz") 120 | add_custom_target(${PROJECT_NAME}-tarball 121 | COMMAND "${CMAKE_COMMAND}" -E remove ${TARBALL_GZ} 122 | COMMAND "${GZIP_EXECUTABLE}" ${TARBALL} 123 | DEPENDS ${PROJECT_NAME}-create-tarball 124 | WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" 125 | COMMENT "Compressing ${TARBALL_GZ}" 126 | ) 127 | else() 128 | add_custom_target(${PROJECT_NAME}-tarball DEPENDS ${PROJECT_NAME}-create-tarball) 129 | endif() 130 | 131 | if(NOT TARGET tarball) 132 | add_custom_target(tarball) 133 | endif() 134 | add_dependencies(tarball ${PROJECT_NAME}-tarball) 135 | 136 | set(_gittargets_TARGETS ${PROJECT_NAME}-branch ${PROJECT_NAME}-make-branch 137 | ${PROJECT_NAME}-cut ${PROJECT_NAME}-tag ${PROJECT_NAME}-untag tarball 138 | ${PROJECT_NAME}-retag ${PROJECT_NAME}-tarball ${PROJECT_NAME}-create-tarball) 139 | foreach(_gittargets_TARGET ${_gittargets_TARGETS}) 140 | set_target_properties(${_gittargets_TARGET} PROPERTIES 141 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER git) 142 | endforeach() 143 | -------------------------------------------------------------------------------- /GithubInfo.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2014 Stefan Eilemann 2 | # 3 | # sets GIT_ORIGIN_ORG based on root or origin remote github.com//... 4 | # sets GIT_ORIGIN_org to lower-case of GIT_ORIGIN_ORG 5 | # sets COMMON_ORGANIZATION_NAME to GIT_ORIGIN_ORG if not already set 6 | # CI_ROOT_URL: The travis-ci.org URL for the root remote 7 | # CI_ROOT_PNG: The travis-ci.org status png for the root remote 8 | # ${UPPER_PROJECT_NAME}_ISSUES_URL: The URL for tickets on the root remote 9 | # ${UPPER_PROJECT_NAME}_URL: The URL for the project, unless set already 10 | 11 | include(GitInfo) 12 | 13 | set(CI_ROOT_URL) 14 | set(CI_ROOT_PNG) 15 | set(ISSUES_ROOT_URL) 16 | 17 | if(GIT_ROOT_URL) 18 | set(_git_origin_url ${GIT_ROOT_URL}) 19 | elseif(GIT_ORIGIN_URL) 20 | set(_git_origin_url ${GIT_ORIGIN_URL}) 21 | endif() 22 | 23 | if(_git_origin_url) 24 | string(REGEX REPLACE ".*github.com[\\/:](.*)\\/.*" "\\1" GIT_ORIGIN_ORG 25 | "${_git_origin_url}") 26 | endif() 27 | 28 | if(NOT GIT_ORIGIN_ORG OR GIT_ORIGIN_ORG STREQUAL _git_origin_url) 29 | set(GIT_ORIGIN_ORG) 30 | else() 31 | string(TOLOWER ${GIT_ORIGIN_ORG} GIT_ORIGIN_org) 32 | if(NOT COMMON_ORGANIZATION_NAME) 33 | set(COMMON_ORGANIZATION_NAME ${GIT_ORIGIN_ORG}) 34 | endif() 35 | endif() 36 | 37 | if(GIT_ROOT_URL MATCHES ".*github.com.*") 38 | string(REPLACE "github.com" "travis-ci.org" CI_ROOT_URL ${GIT_ROOT_URL}) 39 | string(REPLACE ".git" "" CI_ROOT_URL ${CI_ROOT_URL}) 40 | set(CI_ROOT_PNG ${CI_ROOT_URL}.png) 41 | if(NOT ${UPPER_PROJECT_NAME}_ISSUES_URL) 42 | string(REPLACE ".git" "/issues" 43 | ${UPPER_PROJECT_NAME}_ISSUES_URL ${GIT_ROOT_URL}) 44 | endif() 45 | if(NOT ${UPPER_PROJECT_NAME}_URL) 46 | string(REGEX REPLACE ".*(github.com[/[a-zA-Z]+).*" "https://\\1" 47 | ${UPPER_PROJECT_NAME}_URL ${GIT_ROOT_URL}) 48 | endif() 49 | endif() 50 | -------------------------------------------------------------------------------- /Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | @_BUNDLE_NAME@ 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | @_ICON@ 13 | CFBundleIdentifier 14 | 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | @_VERSION@ 19 | CFBundleName 20 | 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | @_VERSION@ 25 | CFBundleSignature 26 | 27 | CFBundleVersion 28 | 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | @_COPYRIGHT@ 35 | NSPrincipalClass 36 | NSApplication 37 | NSHighResolutionCapable 38 | True 39 | 40 | 41 | -------------------------------------------------------------------------------- /InstallDependencies.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014-2016 Stefan.Eilemann@epfl.ch 2 | # Raphael.Dumusc@epfl.ch 3 | 4 | # Provides install_dependencies(name) to ease the installation of the system 5 | # packages that a project declares as dependencies. 6 | # 7 | # Usage: install_dependencies() 8 | # Installs a list of packages using a system-specific package manager. 9 | # 10 | # Input variables 11 | # - ${NAME}__DEPENDS - the list of packages to install, where is 12 | # automatically determined and can be one of: 13 | # - DEB (apt-get) 14 | # - RPM (yum) 15 | # - PORT (port, OSX) 16 | # 17 | # Example usage 18 | # set(HELLO_DEB_DEPENDS qtbase5-dev) 19 | # set(HELLO_PORT_DEPENDS qt5) 20 | # install_dependencies(hello) 21 | 22 | function(install_dependencies name) 23 | string(TOUPPER ${name} NAME) 24 | 25 | # Detect the package manager to use 26 | if(NOT DEFINED __pkg_mng) 27 | if(CMAKE_SYSTEM_NAME MATCHES "Linux" ) 28 | find_program(__pkg_mng apt-get) 29 | if(__pkg_mng) 30 | set(__pkg_type DEB) 31 | else() 32 | find_program(__pkg_mng yum) 33 | if(__pkg_mng) 34 | set(__pkg_type RPM) 35 | endif() 36 | endif() 37 | elseif(APPLE) 38 | find_program(__pkg_mng port) 39 | if(__pkg_mng) 40 | set(__pkg_type PORT) 41 | endif() 42 | endif() 43 | 44 | if(NOT __pkg_mng) 45 | message(WARNING "Could not find the package manager tool for installing dependencies in this system") 46 | endif() 47 | 48 | # Cache variables to do the detection only once, but hide them so they don't 49 | # appear in ccmake. 50 | set(__pkg_mng ${__pkg_mng} CACHE INTERNAL "") 51 | set(__pkg_type ${__pkg_type} CACHE INTERNAL "") 52 | endif() 53 | 54 | if(NOT __pkg_mng OR NOT ${NAME}_${__pkg_type}_DEPENDS) 55 | return() 56 | endif() 57 | 58 | message("Installing '${NAME}_${__pkg_type}_DEPENDS'") 59 | 60 | # add common build requirements 61 | if(__pkg_type STREQUAL DEB) 62 | set(_dependencies cmake doxygen git graphviz ninja-build pkg-config lcov 63 | clang-format) 64 | else() 65 | set(_dependencies) 66 | endif() 67 | 68 | list(APPEND _dependencies ${${NAME}_${__pkg_type}_DEPENDS}) 69 | list(SORT _dependencies) 70 | list(REMOVE_DUPLICATES _dependencies) 71 | 72 | if(CMAKE_SYSTEM_NAME MATCHES "Linux") 73 | message("Running 'sudo ${__pkg_mng} install ${_dependencies}'") 74 | execute_process(COMMAND sudo ${__pkg_mng} install ${_dependencies}) 75 | elseif(APPLE) 76 | set(_universal_ports) 77 | foreach(_port ${_dependencies}) 78 | list(APPEND _universal_ports ${_port} +universal) 79 | endforeach() 80 | message("Running 'sudo port install ${_dependencies} (+universal)'") 81 | execute_process(COMMAND sudo port install -p ${_universal_ports}) 82 | endif() 83 | endfunction() 84 | -------------------------------------------------------------------------------- /InstallFiles.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2016 Stefan.Eilemann@epfl.ch 2 | 3 | # Usage: install_files( FILES [COMPONENT ] [BASE ]) 4 | # Installs files while preserving their relative directory. Files 5 | # with an absolute path are installed directly into prefix. 6 | 7 | include(CMakeParseArguments) 8 | 9 | function(INSTALL_FILES PREFIX) 10 | set(ARG_NAMES COMPONENT BASE) 11 | set(ARGS_NAMES FILES) 12 | cmake_parse_arguments(THIS "" "${ARG_NAMES}" "${ARGS_NAMES}" ${ARGN}) 13 | 14 | foreach(FILE ${THIS_FILES}) 15 | if(IS_ABSOLUTE ${FILE}) 16 | if(THIS_BASE) 17 | string(REPLACE ${THIS_BASE} "" DIR ${FILE}) 18 | string(REGEX MATCH "(.*)[/\\]" DIR ${DIR}) 19 | else() 20 | set(DIR) 21 | endif() 22 | else() 23 | string(REGEX MATCH "(.*)[/\\]" DIR ${FILE}) 24 | endif() 25 | if(THIS_COMPONENT) 26 | install(FILES ${FILE} DESTINATION ${PREFIX}/${DIR} 27 | COMPONENT ${THIS_COMPONENT}) 28 | else() 29 | install(FILES ${FILE} DESTINATION ${PREFIX}/${DIR}) 30 | endif() 31 | endforeach() 32 | endfunction() 33 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Unless otherwise noted in the file, all files in this repository are 2 | licensed under the BSD license, reproduced below. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | - Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | - Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | - Neither the name of Eyescale Software GmbH nor the names of its 13 | contributors may be used to endorse or promote products derived from this 14 | software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /LSBInfo.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2012 Stefan Eilemann 3 | # gathers LSB system information 4 | 5 | if(LSB_RELEASE) 6 | return() 7 | endif() 8 | 9 | find_program(LSB_RELEASE_EXECUTABLE lsb_release) 10 | 11 | if(LSB_RELEASE_EXECUTABLE) 12 | execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sc 13 | OUTPUT_VARIABLE LSB_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE) 14 | 15 | execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sr 16 | OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE) 17 | 18 | execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -si 19 | OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID OUTPUT_STRIP_TRAILING_WHITESPACE) 20 | else() 21 | set(LSB_DISTRIBUTOR_ID "unknown") 22 | set(LSB_RELEASE "unknown") 23 | set(LSB_CODENAME "unknown") 24 | endif() 25 | -------------------------------------------------------------------------------- /LibFindMacros.cmake: -------------------------------------------------------------------------------- 1 | # Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments 2 | # used for the current package. For this to work, the first parameter must be the 3 | # prefix of the current package, then the prefix of the new package etc, which are 4 | # passed to find_package. 5 | macro(libfind_package PREFIX) 6 | set(LIBFIND_PACKAGE_ARGS ${ARGN}) 7 | if(${PREFIX}_FIND_QUIETLY) 8 | set(LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET) 9 | endif() 10 | if(${PREFIX}_FIND_REQUIRED) 11 | set(LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED) 12 | endif() 13 | find_package(${LIBFIND_PACKAGE_ARGS} QUIET) 14 | endmacro() 15 | 16 | # CMake developers made the UsePkgConfig system deprecated in the same release (2.6) 17 | # where they added pkg_check_modules. Consequently I need to support both in my scripts 18 | # to avoid those deprecated warnings. Here's a helper that does just that. 19 | # Works identically to pkg_check_modules, except that no checks are needed prior to use. 20 | macro(libfind_pkg_check_modules PREFIX PKGNAME) 21 | find_package(PkgConfig QUIET) 22 | if (PKG_CONFIG_FOUND) 23 | pkg_check_modules(${PREFIX} ${PKGNAME} QUIET) 24 | endif() 25 | endmacro() 26 | 27 | # Do the final processing once the paths have been detected. 28 | # If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain 29 | # all the variables, each of which contain one include directory. 30 | # Ditto for ${PREFIX}_PROCESS_LIBS and library files. 31 | # Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES. 32 | # Also handles errors in case library detection was required, etc. 33 | macro(libfind_process PREFIX) 34 | # Skip processing if already processed during this run 35 | if(NOT ${PREFIX}_FOUND) 36 | # Start with the assumption that the library was found 37 | set(${PREFIX}_FOUND TRUE) 38 | 39 | # Process all includes and set _FOUND to false if any are missing 40 | foreach(i ${${PREFIX}_PROCESS_INCLUDES}) 41 | if(${i}) 42 | set(${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}}) 43 | mark_as_advanced(${i}) 44 | else() 45 | set(${PREFIX}_FOUND FALSE) 46 | endif() 47 | endforeach() 48 | 49 | # Process all libraries and set _FOUND to false if any are missing 50 | foreach(i ${${PREFIX}_PROCESS_LIBS}) 51 | if(${i}) 52 | set(${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}}) 53 | mark_as_advanced(${i}) 54 | else() 55 | set(${PREFIX}_FOUND FALSE) 56 | endif() 57 | endforeach() 58 | 59 | # Print message and/or exit on fatal error 60 | if(${PREFIX}_FOUND) 61 | if(NOT ${PREFIX}_FIND_QUIETLY) 62 | message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION} in ${${PREFIX}_INCLUDE_DIRS};${${PREFIX}_LIBRARIES}") 63 | endif() 64 | else() 65 | if(${PREFIX}_FIND_REQUIRED) 66 | foreach(i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS}) 67 | message("${i}=${${i}}") 68 | endforeach() 69 | message(FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.") 70 | endif() 71 | endif() 72 | endif() 73 | endmacro() 74 | 75 | macro(libfind_library PREFIX basename) 76 | set(TMP "") 77 | if(MSVC80) 78 | set(TMP -vc80) 79 | endif() 80 | if(MSVC90) 81 | set(TMP -vc90) 82 | endif() 83 | set(${PREFIX}_LIBNAMES ${basename}${TMP}) 84 | if(${ARGC} GREATER 2) 85 | set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2}) 86 | string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES}) 87 | set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP}) 88 | endif() 89 | find_library(${PREFIX}_LIBRARY 90 | NAMES ${${PREFIX}_LIBNAMES} 91 | PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS} 92 | ) 93 | endmacro() 94 | -------------------------------------------------------------------------------- /MPI.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2012-2013 Fabien Delalondre 3 | # Extension to support setting mpiwrappers as compilers 4 | # If not, relies on the findMPI.cmake script to set libs, includes and compile flags 5 | # Note: Improvement/evaluation must be made by comparing this script with: 6 | # 1) http://www.na-mic.org/svn/Slicer3-lib-mirrors/trunk/CMake/Modules/FindMPI.cmake 7 | # 2) http://www.openflipper.org/svnrepo/CoMISo/trunk/CoMISo/cmake/FindMPI.cmake 8 | 9 | # This module will set the following variables: 10 | # MPI_WRAPPER_FOUND TRUE if we have found MPI wrappers 11 | # MPI_FOUND TRUE if we have found MPI 12 | # MPI_COMPILE_FLAGS Compilation flags for MPI programs 13 | # MPI_INCLUDE_PATH Include path(s) for MPI header 14 | # MPI_LINK_FLAGS Linking flags for MPI programs 15 | # MPI_LIBRARY First MPI library to link against (cached) 16 | # MPI_EXTRA_LIBRARY Extra MPI libraries to link against (cached) 17 | # MPI_LIBRARIES All libraries to link MPI programs against 18 | 19 | 20 | # Start with the list of MPI wrappers. Acknowledgement to http://www.openflipper.org/svnrepo/CoMISo/trunk/CoMISo/cmake/FindMPI.cmake 21 | # Generic MPI compilers 22 | set(_MPI_C_COMPILER_NAMES "mpicc|mpcc|mpicc_r|mpcc_r") 23 | set(_MPI_CXX_COMPILER_NAMES "mpicxx|mpiCC|mpcxx|mpCC|mpic[++]|mpc[++]") 24 | # GNU compiler names 25 | set(_MPI_GNU_C_COMPILER_NAMES "mpigcc|mpgcc|mpigcc_r|mpgcc_r") 26 | set(_MPI_GNU_CXX_COMPILER_NAMES "mpig[++]|mpg[++]|mpig[++]_r|mpg[++]_r") 27 | # Intel MPI compiler names 28 | set(_MPI_Intel_C_COMPILER_NAMES "mpiicc") 29 | set(_MPI_Intel_CXX_COMPILER_NAMES "mpiicpc|mpiicxx|mpiic[++]|mpiiCC") 30 | # PGI compiler names 31 | set(_MPI_PGI_C_COMPILER_NAMES "mpipgcc|mppgcc") 32 | set(_MPI_PGI_CXX_COMPILER_NAMES "mpipgCC|mppgCC") 33 | # XLC MPI Compiler names 34 | set(_MPI_XL_C_COMPILER_NAMES "mpxlc|mpxlc_r|mpixlc|mpixlc_r") 35 | set(_MPI_XL_CXX_COMPILER_NAMES "mpixlcxx|mpixlC|mpixlc[++]|mpxlcxx|mpxlc[++]|mpixlc[++]|mpxlCC| 36 | mpixlcxx_r|mpixlC_r|mpixlc[++]_r|mpxlcxx_r|mpxlc[++]_r|mpixlc[++]_r|mpxlCC_r") 37 | 38 | # Find CC and CXX MPI wrappers 39 | string(REGEX MATCH "${_MPI_C_COMPILER_NAMES}|${_MPI_GNU_C_COMPILER_NAMES}|${_MPI_Intel_C_COMPILER_NAMES}| 40 | ${_MPI_PGI_C_COMPILER_NAMES}|${_MPI_XL_C_COMPILER_NAMES}" MPICC_COMPILER "${CMAKE_C_COMPILER}") 41 | string(REGEX MATCH "${_MPI_CXX_COMPILER_NAMES}|${_MPI_GNU_CXX_COMPILER_NAMES}|${_MPI_Intel_CXX_COMPILER_NAMES}| 42 | ${_MPI_PGI_CXX_COMPILER_NAMES}|${_MPI_XL_CXX_COMPILER_NAMES}" MPICXX_COMPILER "${CMAKE_CXX_COMPILER}") 43 | 44 | # If one did not set up mpi wrappers as default compilers, 45 | # trying to link to MPI libs 46 | if("${MPICC_COMPILER}" STREQUAL "" AND "${MPICXX_COMPILER}" STREQUAL "") 47 | message(STATUS "Could not find mpi wrappers in CMAKE_C_COMPILER or 48 | CMAKE_CXX_COMPILER. Trying to load mpi libs by default") 49 | set(MPI_WRAPPER_FOUND FALSE CACHE BOOL "Did not find the MPI Wrappers") 50 | find_package(MPI REQUIRED QUIET) 51 | # Add mpi linking flags 52 | if(MPI_LINK_FLAGS) 53 | LIST(APPEND LINK_FLAGS ${MPI_LINK_FLAGS}) 54 | endif() 55 | # Add mpi compilation flags 56 | if(MPI_COMPILE_FLAGS) 57 | LIST(APPEND CMAKE_C_FLAGS ${MPI_COMPILE_FLAGS}) 58 | LIST(APPEND CMAKE_CXX_FLAGS ${MPI_COMPILE_FLAGS}) 59 | endif() 60 | # Add MPI includes 61 | if(MPI_INCLUDE_PATH) 62 | INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH}) 63 | endif() 64 | else() 65 | # Setting wrappers and mpi found to true 66 | set(MPI_WRAPPER_FOUND TRUE CACHE BOOL "found the MPI Wrappers") 67 | set(MPI_FOUND TRUE CACHE BOOL "Found the MPI library") 68 | endif() 69 | 70 | if (MPI_INCLUDE_PATH AND MPI_LIBRARY) 71 | set(MPI_FOUND TRUE CACHE BOOL "Found the MPI library") 72 | else (MPI_INCLUDE_PATH AND MPI_LIBRARY) 73 | set(MPI_FOUND FALSE CACHE BOOL "Did not find the MPI library") 74 | endif (MPI_INCLUDE_PATH AND MPI_LIBRARY) 75 | -------------------------------------------------------------------------------- /MacPorts.cmake: -------------------------------------------------------------------------------- 1 | # generates MacPorts Portfiles 2 | 3 | if(NOT APPLE) 4 | return() 5 | endif() 6 | if(NOT CPACK_MACPORTS_CATEGORY) 7 | message("Missing CPACK_MACPORTS_CATEGORY for MacPorts generation") 8 | return() 9 | endif() 10 | 11 | include(GithubInfo) 12 | 13 | # Configurables 14 | if(NOT CMAKE_MACPORTS_NAME) 15 | set(CMAKE_MACPORTS_NAME ${PROJECT_NAME}) 16 | endif() 17 | if(NOT CPACK_MACPORTS_VERSION) 18 | set(CPACK_MACPORTS_VERSION ${PROJECT_VERSION}) 19 | endif() 20 | if(NOT MACPORTS_DIR) 21 | set(MACPORTS_DIR "${GIT_ORIGIN_org}Ports") 22 | endif() 23 | 24 | # format dependencies list into port:name string 25 | foreach(CPACK_MACPORTS_DEPEND ${CPACK_MACPORTS_DEPENDS}) 26 | if(${CPACK_MACPORTS_DEPEND} MATCHES "port:") 27 | set(CPACK_MACPORTS_TEMP "${CPACK_MACPORTS_TEMP} ${CPACK_MACPORTS_DEPEND}") 28 | else() 29 | set(CPACK_MACPORTS_TEMP 30 | "${CPACK_MACPORTS_TEMP} port:${CPACK_MACPORTS_DEPEND}") 31 | endif() 32 | endforeach() 33 | set(CPACK_MACPORTS_DEPENDS "${CPACK_MACPORTS_TEMP}") 34 | 35 | # Create and install Portfile 36 | set(PORTFILE_DIR "ports/${CPACK_MACPORTS_CATEGORY}/${CMAKE_MACPORTS_NAME}") 37 | set(PORTFILE_GH_DIR "${PROJECT_SOURCE_DIR}/../${MACPORTS_DIR}") 38 | set(PORTFILE "${PROJECT_BINARY_DIR}/${PORTFILE_DIR}/Portfile") 39 | set(PORTFILE_GH "${PORTFILE_GH_DIR}/${PORTFILE_DIR}/Portfile") 40 | 41 | configure_file(${CMAKE_CURRENT_LIST_DIR}/Portfile ${PORTFILE} @ONLY) 42 | install(FILES ${PORTFILE} DESTINATION ${PORTFILE_DIR} COMPONENT lib) 43 | install(CODE 44 | "execute_process(COMMAND /opt/local/bin/portindex ${CMAKE_INSTALL_PREFIX}/ports)" 45 | COMPONENT lib) 46 | 47 | file(WRITE ${PROJECT_BINARY_DIR}/MacPortfile.cmake 48 | "list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake)\n" 49 | "configure_file(${PORTFILE} ${PORTFILE_GH} COPYONLY)\n" 50 | "execute_process(COMMAND /opt/local/bin/portindex ${PORTFILE_GH_DIR}/ports)" 51 | ) 52 | 53 | add_custom_target(portfile_${PROJECT_NAME} 54 | COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/MacPortfile.cmake 55 | COMMENT "Updating ${MACPORTS_DIR}") 56 | -------------------------------------------------------------------------------- /OSG.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2013-2014, EPFL/Blue Brain Project 3 | # jhernando@fi.upm.es 4 | 5 | # This script finds the ABI version of a previously detected OpenSceneGraph 6 | # installation and exports the following variables: 7 | # 8 | # OPENSCENEGRAPH_SOVERSION - The ABI version parsed from osg/Version 9 | # OPENSCENEGRAPH_DEB_DEPENDENCIES - The .deb package name compatible with the 10 | # found version 11 | 12 | if(NOT OPENSCENEGRAPH_FOUND) 13 | return() 14 | endif() 15 | 16 | set(_osg_Version_file "${OSG_INCLUDE_DIR}/osg/Version") 17 | if(NOT EXISTS "${_osg_Version_file}") 18 | message(SEND_ERROR 19 | "OpenSceneGraph version header file not found: ${_osg_Version_file}") 20 | return() 21 | endif() 22 | 23 | file(STRINGS "${_osg_Version_file}" _osg_Version_contents 24 | REGEX "#define (OPENSCENEGRAPH_SOVERSION)[ \t]+[0-9]+") 25 | string(REGEX REPLACE ".*#define OPENSCENEGRAPH_SOVERSION[ \t]+([0-9]+).*" 26 | "\\1" _osg_SOVERSION ${_osg_Version_contents}) 27 | 28 | set(OPENSCENEGRAPH_SOVERSION ${_osg_SOVERSION}) 29 | set(OPENSCENEGRAPH_DEB_DEPENDENCIES "libopenscenegraph${_osg_SOVERSION} (>= ${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR})" 30 | CACHE INTERNAL "The binary debian package of the OSG version which was detected") 31 | 32 | 33 | -------------------------------------------------------------------------------- /OSSCPack.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Configures rules for publishing open source packages. 3 | 4 | # No support for subproject packaging 5 | if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) 6 | return() 7 | endif() 8 | 9 | include(UploadPPA) 10 | include(MacPorts) 11 | if(UPLOADPPA_FOUND) 12 | upload_ppas() 13 | endif() 14 | -------------------------------------------------------------------------------- /Portfile: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 2 | # $Id$ 3 | 4 | PortSystem 1.0 5 | PortGroup github 1.0 6 | PortGroup cmake 1.0 7 | 8 | github.setup @GIT_ORIGIN_ORG@ @CMAKE_PROJECT_NAME@ @CPACK_MACPORTS_VERSION@ release- 9 | 10 | name @CMAKE_MACPORTS_NAME@ 11 | categories @CPACK_MACPORTS_CATEGORY@ 12 | maintainers @CPACK_PACKAGE_CONTACT@ 13 | license @CPACK_PACKAGE_LICENSE@ 14 | description @CPACK_PACKAGE_DESCRIPTION_SUMMARY@ 15 | long_description @CPACK_PACKAGE_DESCRIPTION_SUMMARY@ 16 | 17 | depends_lib @CPACK_MACPORTS_DEPENDS@ 18 | 19 | supported_archs ppc ppc64 i386 x86_64 20 | universal_variant yes 21 | checksum {} 22 | -------------------------------------------------------------------------------- /ProjectInfo.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014 Stefan.Eilemann@epfl.ch 2 | # [DEPRECATED] Writes ProjectInfo.cmake for installed html docs. 3 | # 4 | # The generated ProjectInfo.cmake was used by Doxygit.cmake for the manual 5 | # generation of an html index page. Since Doxygit has been deprecated in favor 6 | # of a Jekyll-generated index page on github.io (GitHub pages) this file shall 7 | # be removed too at some later point. 8 | # 9 | # Input Variables: 10 | # * ${UPPER_PROJECT_NAME}_MATURITY EP, RD or RS 11 | # * ${UPPER_PROJECT_NAME}_PACKAGE_URL pointing to the package repository 12 | # * ${UPPER_PROJECT_NAME}_ISSUES_URL pointing to the ticket tracker 13 | 14 | include(GithubInfo) 15 | 16 | if(NOT ${UPPER_PROJECT_NAME}_MATURITY) 17 | set(${UPPER_PROJECT_NAME}_MATURITY EP) 18 | endif() 19 | if(DPUT_HOST AND NOT ${UPPER_PROJECT_NAME}_PACKAGE_URL) 20 | string(REPLACE "/" "/+archive/" ${UPPER_PROJECT_NAME}_PACKAGE_URL 21 | ${DPUT_HOST}) 22 | string(REPLACE "ppa:" "https://launchpad.net/~" 23 | ${UPPER_PROJECT_NAME}_PACKAGE_URL ${${UPPER_PROJECT_NAME}_PACKAGE_URL}) 24 | endif() 25 | 26 | configure_file(${CMAKE_CURRENT_LIST_DIR}/ProjectInfo.in.cmake 27 | ${PROJECT_BINARY_DIR}/ProjectInfo.cmake) 28 | 29 | add_custom_target(project_info_${PROJECT_NAME} 30 | ${CMAKE_COMMAND} -E copy_if_different 31 | ${PROJECT_BINARY_DIR}/ProjectInfo.cmake ${PROJECT_BINARY_DIR}/doc/html) 32 | set_target_properties(project_info_${PROJECT_NAME} PROPERTIES 33 | EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/zzphony) 34 | -------------------------------------------------------------------------------- /ProjectInfo.in.cmake: -------------------------------------------------------------------------------- 1 | set(${UPPER_PROJECT_NAME}_MATURITY "${${UPPER_PROJECT_NAME}_MATURITY}") 2 | set(${UPPER_PROJECT_NAME}_DESCRIPTION "${${UPPER_PROJECT_NAME}_DESCRIPTION}") 3 | set(${UPPER_PROJECT_NAME}_GIT_ROOT_URL "${GIT_ROOT_URL}") 4 | set(${UPPER_PROJECT_NAME}_PACKAGE_URL "${${UPPER_PROJECT_NAME}_PACKAGE_URL}") 5 | set(${UPPER_PROJECT_NAME}_CI_URL "${CI_ROOT_URL}") 6 | set(${UPPER_PROJECT_NAME}_CI_PNG "${CI_ROOT_PNG}") 7 | set(${UPPER_PROJECT_NAME}_ISSUES_URL "${${UPPER_PROJECT_NAME}_ISSUES_URL}") 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CMake Modules 2 | 3 | This repository contains common CMake modules and a collection of find scripts 4 | to locate non-CMake dependencies. The recommended way to use it is: 5 | 6 | ## As a git submodule 7 | 8 | In your project source dir, do: 9 | 10 | git submodule add https://github.com/Eyescale/CMake CMake/common 11 | 12 | And include it in the top-level CMakeLists.txt as follows: 13 | 14 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/common) 15 | include(Common) 16 | 17 | ## Documentation 18 | 19 | The following CMake modules can be included in your project: 20 | 21 | * [Common](Common.cmake) does a common CMake setup, and also includes: 22 | * [CommonLibrary](CommonLibrary.cmake) *common_library* function to build a 23 | (shared) library using a standard recipe and generates header files for 24 | the library (api.h, version.h). 25 | * [CommonApplication](CommonApplication.cmake) *common_application* 26 | function to build an application using a standard recipe. 27 | * [CommonFindPackage](CommonFindPackage.cmake) *common_find_package* for 28 | more convenience over find_package and *common_find_package_post* (must be 29 | last after all common_find_package calls) to generate defines.h and 30 | options.cmake for feature checking. 31 | * [CommonCompiler](CommonCompiler.cmake): Default compiler flags (including 32 | C++14) and useful default warnings can be set on given target to 33 | common_compile_options(); automatically applied for targets created with 34 | common_application() and common_library() 35 | * [CommonHelp](CommonHelp.cmake) *common_help* function to create a 36 | documentation page from an application's --help output. 37 | * [GitInfo](GitInfo.cmake) sets variables with information about the git 38 | source tree. 39 | * [GitTargets](GitTargets.cmake) *branch*, *cut*, *tag*, *erase*, *retag*, 40 | *tarball* targets. 41 | * [CommonCTest](CommonCTest.cmake) should be included from a tests subfolder. 42 | Does a common CTest setup, automatically adding all .cpp files in the 43 | current folder as unit tests to a *tests* target. It also includes: 44 | * [CommonCoverage](CommonCoverage.cmake) *coverage* target to generate a 45 | code coverage report as html, if COMMON_ENABLE_COVERAGE option is set. 46 | Additional compiler flags are set in that case, so it should be enabled 47 | only for debug builds. 48 | * [CommonCheckTargets](CommonCheckTargets.cmake) adds test targets for 49 | various static code checkers if the COMMON_ENABLE_STATIC_TESTS option is 50 | set. 51 | * [CommonCPPCheck](CommonCPPCheck.cmake): *cppcheck* target for 52 | static code analysis. Also adds all cppcheck targets to *tests* target. 53 | * [CommonClangCheck](CommonClangCheck.cmake): *clangcheck* target for 54 | clang-check code analysis. Adds all clangcheck targets to *tests* if 55 | COMMON_ENABLE_CLANGCHECK_TESTS is set. 56 | * [CommonPackageConfig](CommonPackageConfig.cmake) generates cmake package 57 | information files for the project. These files let other CMake-based projects 58 | locate it through find_package (in config mode, without the need for a finder 59 | script). Must be included at the end of the CMakeLists.txt, after all targets 60 | have been added via common_library() and common_application(). 61 | * [CommonCPack](CommonCPack.cmake) Configures the CPack package generator to 62 | redistribute the project as an installable package. Also includes 63 | CommonPackageConfig. 64 | * [DoxygenRule](DoxygenRule.cmake): *doxygen* target to build documentation into 65 | PROJECT_BINARY_DIR/doc. Optional *doxycopy* target to copy the results to 66 | ../GITHUB_ORGANIZATION/Project-M.m/. Must be included after all other targets. 67 | * [SubProject](SubProject.cmake): This module is automatically included in 68 | Common.cmake to build several CMake subprojects (which may depend on each 69 | other), which are declared in a .gitsubprojects file. 70 | To be compatible with the SubProject feature, (sub)projects might need to 71 | adapt their CMake scripts. Generally, CMAKE_BINARY_DIR should be changed to 72 | PROJECT_BINARY_DIR and CMAKE_SOURCE_DIR should be changed to 73 | PROJECT_SOURCE_DIR. See [SubProject](SubProject.cmake) documentation for 74 | more details. 75 | A simple example project can be found at 76 | https://github.com/Eyescale/Collage.git, and a more complex one at 77 | https://github.com/BlueBrain/Brayns.git. 78 | 79 | Additional features: 80 | * [InstallDependencies](InstallDependencies.cmake) lets users install known 81 | system packages during the initial configuration by doing 82 | "cmake -DINSTALL_PACKAGES=1". 83 | This is only implemented for Linux distributions using apt-get and yum 84 | package managers and MacPorts in OS X. The actual support depends on the 85 | project declaring its dependencies for each particular case. 86 | * [CommonGraph](CommonGraph.cmake) adds *graphs* target to generate .png tree 87 | view of dependencies, gathered by CommonFindPackage and SubProject. 88 | 89 | [Detailed Change Log](CHANGES.md) 90 | -------------------------------------------------------------------------------- /Sanitizer.cmake: -------------------------------------------------------------------------------- 1 | # Used to turn on certain sanitizers, if available: 2 | # 3 | # clang: 4 | # -dumpcompiler: 4.2.1 5 | # address 6 | # thread 7 | # undefined 8 | # gcc: 9 | # -dumpcompiler: 4.8.3 10 | # address 11 | # thread 12 | # 13 | # Note: This modifies CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS 14 | # Usage: add this when doing cmake configuration: -DSANITIZER=address 15 | 16 | if(NOT SANITIZER) 17 | return() 18 | endif() 19 | 20 | include(Compiler) 21 | 22 | #According to: http://clang.llvm.org/docs/AddressSanitizer.html#usage 23 | # the following compiler flags allow us to keep -O1 on, if desired, but 24 | # still get pretty call stacks 25 | set(_SANITIZER_COMPILE_OPTIONS "-g -fno-omit-frame-pointer -fno-optimize-sibling-calls") 26 | 27 | string(TOLOWER ${SANITIZER} SANITIZER) 28 | 29 | if(CMAKE_COMPILER_IS_GNUCXX_PURE) 30 | if(GCC_COMPILER_VERSION VERSION_GREATER 4.7) 31 | set(_GCC_SANITIZERS address thread) 32 | endif() 33 | list(FIND _GCC_SANITIZERS ${SANITIZER} _SANITIZER_FOUND) 34 | 35 | elseif(CMAKE_COMPILER_IS_CLANG) 36 | if(GCC_COMPILER_VERSION VERSION_GREATER 4.1) 37 | set(_CLANG_SANITIZERS address thread undefined) 38 | endif() 39 | list(FIND _CLANG_SANITIZERS ${SANITIZER} _SANITIZER_FOUND) 40 | 41 | endif() 42 | 43 | if(${_SANITIZER_FOUND} GREATER -1) 44 | set(_SANITIZER "-fsanitize=${SANITIZER}") 45 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_SANITIZER_COMPILE_OPTIONS} ${_SANITIZER}" ) 46 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_SANITIZER}") 47 | else() 48 | message(WARNING "Sanitizer '${SANITIZER}' not set, check compiler support") 49 | endif() 50 | -------------------------------------------------------------------------------- /StringifyShaders.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright (c) 2010 Daniel Pfeifer 3 | # 2014 Stefan.Eilemann@epfl.ch 4 | # 5 | # Returns source file names in SHADER_SOURCES 6 | ## 7 | 8 | set(STRINGIFY_SHADERS_DIR "${CMAKE_CURRENT_LIST_DIR}") 9 | 10 | function(STRINGIFY_SHADERS) 11 | set(OUTPUTS) 12 | foreach(FILE ${ARGV}) 13 | set(INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) 14 | set(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}) 15 | set(OUTPUT_FILES ${OUTPUT}.h ${OUTPUT}.cpp) 16 | 17 | add_custom_command(OUTPUT ${OUTPUT_FILES} 18 | COMMAND ${CMAKE_COMMAND} -DSTRINGIFY_SHADERS_PROCESSING_MODE=ON 19 | -DINPUT="${INPUT}" -DOUTPUT="${OUTPUT}" 20 | -P ${STRINGIFY_SHADERS_DIR}/StringifyShaders.cmake 21 | DEPENDS ${INPUT} 22 | ) 23 | list(APPEND OUTPUTS ${OUTPUT_FILES}) 24 | endforeach(FILE ${ARGN}) 25 | 26 | set_property(SOURCE ${OUTPUTS} PROPERTY SKIP_AUTOGEN ON) 27 | set(SHADER_SOURCES ${OUTPUTS} PARENT_SCOPE) 28 | endfunction() 29 | 30 | if(STRINGIFY_SHADERS_PROCESSING_MODE) 31 | get_filename_component(FILENAME ${INPUT} NAME) 32 | string(REGEX REPLACE "[.]" "_" NAME ${FILENAME}) 33 | 34 | file(STRINGS ${INPUT} LINES) 35 | 36 | file(WRITE ${OUTPUT}.h 37 | "/* Generated file, do not edit! */\n\n" 38 | "extern char const* const ${NAME};\n" 39 | ) 40 | 41 | file(WRITE ${OUTPUT}.cpp 42 | "/* Generated file, do not edit! */\n\n" 43 | "#include \"${FILENAME}.h\"\n\n" 44 | "char const* const ${NAME} = \n" 45 | ) 46 | 47 | foreach(LINE ${LINES}) 48 | string(REPLACE "\"" "\\\"" LINE "${LINE}") 49 | file(APPEND ${OUTPUT}.cpp " \"${LINE}\\n\"\n") 50 | endforeach(LINE) 51 | 52 | file(APPEND ${OUTPUT}.cpp " ;\n") 53 | endif() 54 | -------------------------------------------------------------------------------- /TestScriptUtils.cmake: -------------------------------------------------------------------------------- 1 | # @author Sam Yates 2 | 3 | # Utility functions for manipulating test labels and producing 4 | # tests from scripts: 5 | # 6 | # 1. add_test_class(label [label2 ...]) 7 | # 8 | # Create a target with name test-label (or test-label-label2 etc.) 9 | # which runs only those tests possessing all of the supplied labels. 10 | # 11 | # 12 | # 2. add_test_label(name label ...) 13 | # 14 | # Add the given labels to the test 'name'. 15 | # 16 | # 17 | # 3. add_test_script(name script interp) 18 | # 19 | # Add a test 'name' that runs the given script, using the 20 | # interpreter 'interp'. If no interpreter is supplied, 21 | # the script will be run with /bin/sh. 22 | # 23 | # Uses the following variables to customize the new test: 24 | # * TEST_LABEL, ${NAME}_TEST_LABEL 25 | # If defined, apply the label(s) in these variable to the 26 | # new test. 27 | # * TEST_ARGS, ${NAME}_TEST_ARGS 28 | # Additional arguments to pass to the script. 29 | # ${NAME}_TEST_ARGS takes priority over TEST_ARGS. 30 | # * TEST_ENVIRONMENT 31 | # Additional environment variables to define for the test; 32 | # added to test properties. 33 | # * TEST_PREFIX, ${NAME}_TEST_PREFIX 34 | # If defined, preface the interpreter with this prefix. 35 | # ${NAME}_TEST_PREFIX takes priority over TEST_PREFIX. 36 | 37 | function(add_test_label NAME) 38 | set_property(TEST ${NAME} APPEND PROPERTY LABELS ${ARGN}) 39 | # create test classes for each label 40 | foreach(L ${ARGN}) 41 | add_test_class(${L}) 42 | endforeach() 43 | endfunction() 44 | 45 | function(add_test_script NAME SCRIPT INTERP) 46 | set(RUN_PREFIX ${TEST_PREFIX}) 47 | if(${NAME}_TEST_PREFIX) 48 | set(RUN_PREFIX ${${NAME}_TEST_PREFIX}) 49 | endif() 50 | 51 | if(NOT INTERP) 52 | set(INTERP "/bin/sh") 53 | endif() 54 | 55 | set(RUN_ARGS ${TEST_ARGS}) 56 | if (${NAME}_TEST_ARGS) 57 | set(RUN_ARGS ${${NAME}_TEST_ARGS}) 58 | endif() 59 | 60 | set(SCRIPT_PATH "${SCRIPT}") 61 | if(NOT IS_ABSOLUTE "${SCRIPT_PATH}") 62 | set(SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_PATH}") 63 | endif() 64 | 65 | add_test(NAME ${NAME} 66 | COMMAND ${RUN_PREFIX} ${INTERP} "${SCRIPT_PATH}" ${RUN_ARGS} 67 | WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") 68 | 69 | # Add test labels 70 | set(TEST_LABELS ${TEST_LABEL} ${${NAME}_TEST_LABEL}) 71 | if (TEST_LABELS) 72 | add_test_label(${NAME} ${TEST_LABELS}) 73 | endif() 74 | 75 | if(TEST_ENVIRONMENT) 76 | set_property(TEST ${NAME} PROPERTY ENVIRONMENT ${TEST_ENVIRONMENT}) 77 | endif() 78 | endfunction() 79 | 80 | function(add_test_class) 81 | string(REPLACE ";" "-" TEST_SUFFIX "${ARGN}") 82 | string(REPLACE ";" "$$;-L;^" TEST_LOPTS "${ARGN}") 83 | 84 | if(NOT TARGET test-${TEST_SUFFIX}) 85 | add_custom_target("test-${TEST_SUFFIX}" 86 | COMMAND ${CMAKE_CTEST_COMMAND} -L ^${TEST_LOPTS}$$ 87 | WORKING_DIRECTORY ${${PROJECT_NAME}_BINARY_DIR} 88 | COMMENT "Running all ${ARGN} tests") 89 | endif() 90 | endfunction() 91 | 92 | -------------------------------------------------------------------------------- /Ubuntu.cmake: -------------------------------------------------------------------------------- 1 | # Sets currently active Ubuntu releases 2 | 3 | if(NOT UBUNTU_CODENAMES) 4 | set(UBUNTU_CODENAMES precise saucy trusty) 5 | endif() 6 | -------------------------------------------------------------------------------- /cdash.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set CMAKE="%PROGRAMFILES%\CMake 2.8\bin\cmake.exe" 4 | call "%VS90COMNTOOLS%vsvars32.bat" 5 | 6 | if not exist ..\cdash\NUL md cdash 7 | cd ..\cdash 8 | 9 | %CMAKE% -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" .. 10 | 11 | nmake Continuous 12 | -------------------------------------------------------------------------------- /cdash.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | equalizer.cdash 7 | WorkingDirectory 8 | /Users/eile/Equalizer 9 | ProgramArguments 10 | 11 | env 12 | CTEST_DROP_SITE=66.194.253.26 13 | /usr/bin/make 14 | -j2 15 | CTEST=/opt/local/bin/ctest 16 | cdash 17 | 18 | StartInterval 19 | 7200 20 | 21 | 22 | -------------------------------------------------------------------------------- /cpp/api.h: -------------------------------------------------------------------------------- 1 | // generated by CommonLibrary.cmake, do not edit. 2 | 3 | /** 4 | * @file include/@INCLUDE_NAME@/api.h 5 | * Defines export visibility macros for library @Name@. 6 | */ 7 | 8 | #ifndef @NAME@_API_H 9 | #define @NAME@_API_H 10 | 11 | #include <@PROJECT_INCLUDE_NAME@/defines.h> 12 | 13 | #if defined(_MSC_VER) || defined(__declspec) 14 | # define @NAMESPACE@_DLLEXPORT __declspec(dllexport) 15 | # define @NAMESPACE@_DLLIMPORT __declspec(dllimport) 16 | #else // _MSC_VER 17 | # define @NAMESPACE@_DLLEXPORT 18 | # define @NAMESPACE@_DLLIMPORT 19 | #endif // _MSC_VER 20 | 21 | #if defined(@NAME@_STATIC) 22 | # define @NAMESPACE@_API 23 | #elif defined(@NAME@_SHARED) 24 | # define @NAMESPACE@_API @NAMESPACE@_DLLEXPORT 25 | #else 26 | # define @NAMESPACE@_API @NAMESPACE@_DLLIMPORT 27 | #endif 28 | 29 | #if defined(@NAME@_SHARED_INL) 30 | # define @NAMESPACE@_INL @NAMESPACE@_DLLEXPORT 31 | #else 32 | # define @NAMESPACE@_INL @NAMESPACE@_DLLIMPORT 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /cpp/defines.h: -------------------------------------------------------------------------------- 1 | // generated by CommonFindPackage.cmake, do not edit. 2 | 3 | /** 4 | * @file include/@PROJECT_INCLUDE_NAME@/defines.h 5 | * Includes compile-time defines of @PROJECT_NAME@. 6 | */ 7 | 8 | #ifndef @UPPER_PROJECT_NAME@_DEFINES_H 9 | #define @UPPER_PROJECT_NAME@_DEFINES_H 10 | 11 | #ifdef __APPLE__ 12 | # include <@PROJECT_INCLUDE_NAME@/definesDarwin.h> 13 | #elif defined (__linux__) 14 | # include <@PROJECT_INCLUDE_NAME@/definesLinux.h> 15 | #elif defined (_WIN32) 16 | # include <@PROJECT_INCLUDE_NAME@/definesWin32.h> 17 | #else 18 | # error Unknown OS 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /cpp/version.cpp: -------------------------------------------------------------------------------- 1 | // generated by CommonLibrary.cmake, do not edit. 2 | 3 | #include <@INCLUDE_NAME@/version.h> 4 | 5 | namespace @namespace@ 6 | { 7 | 8 | int Version::getMajor() 9 | { 10 | return @NAMESPACE@_VERSION_MAJOR; 11 | } 12 | 13 | int Version::getMinor() 14 | { 15 | return @NAMESPACE@_VERSION_MINOR; 16 | } 17 | 18 | int Version::getPatch() 19 | { 20 | return @NAMESPACE@_VERSION_PATCH; 21 | } 22 | 23 | int Version::getABI() 24 | { 25 | return @NAMESPACE@_VERSION_ABI; 26 | } 27 | 28 | std::string Version::getString() 29 | { 30 | return @NAMESPACE@_VERSION_STRING; 31 | } 32 | 33 | unsigned long long Version::getRevision() 34 | { 35 | return @NAMESPACE@_VERSION_REVISION; 36 | } 37 | 38 | std::string Version::getRevString() 39 | { 40 | return @NAMESPACE@_REV_STRING; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /cpp/version.h: -------------------------------------------------------------------------------- 1 | // generated by CommonLibrary.cmake, do not edit. 2 | 3 | /** 4 | * @file include/@INCLUDE_NAME@/version.h 5 | * Defines version macros and class for library @Name@. 6 | */ 7 | 8 | #ifndef @NAME@_VERSION_H 9 | #define @NAME@_VERSION_H 10 | 11 | #include <@INCLUDE_NAME@/api.h> 12 | #include 13 | 14 | namespace @namespace@ 15 | { 16 | /** The current major version. */ 17 | # define @NAMESPACE@_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ 18 | 19 | /** The current minor version. */ 20 | # define @NAMESPACE@_VERSION_MINOR @PROJECT_VERSION_MINOR@ 21 | 22 | /** The current patch level. */ 23 | # define @NAMESPACE@_VERSION_PATCH @PROJECT_VERSION_PATCH@ 24 | 25 | /** The current SCM revision. */ 26 | # define @NAMESPACE@_VERSION_REVISION 0x@GIT_REVISION@ 27 | 28 | /** The current binary interface. */ 29 | # define @NAMESPACE@_VERSION_ABI @PROJECT_VERSION_ABI@ull 30 | 31 | /** The current major.minor.version as a string. */ 32 | # define @NAMESPACE@_VERSION_STRING \ 33 | "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" 34 | 35 | /** The current major.minor.version.revision as a string. */ 36 | # define @NAMESPACE@_REV_STRING \ 37 | "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0x@GIT_REVISION@" 38 | 39 | /** True if the current version is newer than the given one. */ 40 | # define @NAMESPACE@_VERSION_GT( MAJOR, MINOR, PATCH ) \ 41 | ( (@NAMESPACE@_VERSION_MAJOR>MAJOR) || \ 42 | (@NAMESPACE@_VERSION_MAJOR==MAJOR && (@NAMESPACE@_VERSION_MINOR>MINOR || \ 43 | (@NAMESPACE@_VERSION_MINOR==MINOR && @NAMESPACE@_VERSION_PATCH>PATCH)))) 44 | 45 | /** True if the current version is equal or newer to the given. */ 46 | # define @NAMESPACE@_VERSION_GE( MAJOR, MINOR, PATCH ) \ 47 | ( (@NAMESPACE@_VERSION_MAJOR>MAJOR) || \ 48 | (@NAMESPACE@_VERSION_MAJOR==MAJOR && (@NAMESPACE@_VERSION_MINOR>MINOR || \ 49 | (@NAMESPACE@_VERSION_MINOR==MINOR && @NAMESPACE@_VERSION_PATCH>=PATCH)))) 50 | 51 | /** True if the current version is older than the given one. */ 52 | # define @NAMESPACE@_VERSION_LT( MAJOR, MINOR, PATCH ) \ 53 | ( (@NAMESPACE@_VERSION_MAJOR