├── .cmake-format ├── .gitignore ├── .gitlab-ci.yml ├── CHANGELOG.rst ├── CMakeLists.txt ├── CODEOWNERS ├── LICENSE ├── README.md ├── ci_templates ├── CMakeLists.txt ├── catkin_project_template.yml ├── default_catkin_project.yml └── gbp_project.yml ├── cmake ├── Modules │ ├── CatkinMockForConan.cmake │ ├── ExportPackage.cmake │ ├── FindANN.cmake │ ├── FindAravis.cmake │ ├── FindAutoDeps.cmake │ ├── FindBoostPython.cmake │ ├── FindCTensorflow.cmake │ ├── FindCairo.cmake │ ├── FindCereal.cmake │ ├── FindClangTidy.cmake │ ├── FindFLANN.cmake │ ├── FindGeographicLib.cmake │ ├── FindGlog.cmake │ ├── FindIGL.cmake │ ├── FindIpopt.cmake │ ├── FindJsonCpp.cmake │ ├── FindLeptonica.cmake │ ├── FindMetis.cmake │ ├── FindMrtCUDA.cmake │ ├── FindMrtOpenGL.cmake │ ├── FindMrtPCL.cmake │ ├── FindMrtProj.cmake │ ├── FindMrtQt4.cmake │ ├── FindMrtQt5.cmake │ ├── FindMrtVTK.cmake │ ├── FindPNG++.cmake │ ├── FindSDL2.cmake │ ├── FindSqlite3.cmake │ ├── FindSuiteSparse.cmake │ ├── FindTBB.cmake │ ├── FindTensorflow.cmake │ ├── FindTesseract.cmake │ ├── FindTinyXML.cmake │ ├── FindTinyXML2.cmake │ ├── FindZeroMQ.cmake │ ├── Findebus-sdk.cmake │ ├── Findgtest.cmake │ ├── Findnlopt.cmake │ ├── Findpugixml.cmake │ ├── GatherDeps.cmake │ ├── MrtTesting.cmake │ ├── UseMrtAutoTarget.cmake │ └── UseMrtStdCompilerFlags.cmake ├── README.md ├── Templates │ ├── CTestCustom.cmake.in │ ├── __init__.py.in │ ├── packageConfig.cmake.in │ ├── python_api_install.py.in │ ├── setup.py.in │ └── test_utility.hpp.in ├── mrt_cmake_modules-extras.cmake.in └── mrt_cmake_modules-macros.cmake ├── doc ├── .buildinfo ├── _sources │ └── generated_cmake_api.txt ├── _static │ ├── ajax-loader.gif │ ├── basic.css │ ├── comment-bright.png │ ├── comment-close.png │ ├── comment.png │ ├── contents.png │ ├── doctools.js │ ├── documentation_options.js │ ├── down-pressed.png │ ├── down.png │ ├── file.png │ ├── graphviz.css │ ├── jquery-3.2.1.js │ ├── jquery.js │ ├── language_data.js │ ├── minus.png │ ├── mrt.png │ ├── navigation.png │ ├── plus.png │ ├── pygments.css │ ├── searchtools.js │ ├── sphinxdoc.css │ ├── underscore-1.3.1.js │ ├── underscore.js │ ├── up-pressed.png │ ├── up.png │ └── websupport.js ├── generate_doc │ ├── Makefile │ ├── conf.py │ ├── generate_cmake_rst.py │ └── mrt.png ├── generated_cmake_api.html ├── genindex.html ├── objects.inv ├── search.html └── searchindex.js ├── package.xml ├── rosdoc.yaml ├── scripts ├── eval_coverage.py ├── generate_cmake_dependency_file.py ├── generate_cmakelists.py ├── init_coverage.py └── run_test.py └── yaml └── cmake.yaml /.cmake-format: -------------------------------------------------------------------------------- 1 | tab_size: 4 2 | line_width: 120 3 | enable_markup: False 4 | additional_commands: 5 | mrt_add_executable: 6 | pargs: 1 7 | kwargs: 8 | FOLDER: "*" 9 | FILES: "*" 10 | DEPENDS: "*" 11 | LIBRARIES: "*" 12 | mrt_add_links: 13 | pargs: 1 14 | flags: [CUDA, NO_SANITIZER, TEST] 15 | _mrt_export_package: 16 | kwargs: 17 | EXPORTS: "*" 18 | TARGETS: "*" 19 | LIBRARIES: "*" 20 | mrt_add_nodelet: 21 | pargs: 1 22 | kwargs: 23 | FOLDER: "*" 24 | TARGETNAME: "*" 25 | DEPENDS: "*" 26 | LIBRARIES: "*" 27 | mrt_add_library: 28 | pargs: 1 29 | kwargs: 30 | INCLUDES: "*" 31 | SOURCES: "*" 32 | DEPENDS: "*" 33 | LIBRARIES: "*" 34 | _mrt_export_package: 35 | kwargs: 36 | EXPORTS: "*" 37 | TARGETS: "*" 38 | LIBRARIES: "*" 39 | _mrt_run_test: 40 | pargs: 3 41 | flags: [REDIRECT_STDERR] 42 | kwargs: 43 | COMMAND: "*" 44 | COVERAGE_DIR: "*" 45 | configure_package_config_file: 46 | pargs: 2 47 | flags: [NO_SET_AND_CHECK_MACRO, NO_CHECK_REQUIRED_COMPONENTS_MACRO] 48 | kwargs: 49 | INSTALL_DESTINATION: "*" 50 | 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | CMakeLists.txt.user 3 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | #version=1.5 2 | include: 3 | - local: '/ci_templates/default_catkin_project.yml' 4 | 5 | code_quality: 6 | before_script: [] 7 | script: 8 | - ls 9 | 10 | cmake_format: 11 | # check for formatting issues in cmake files 12 | stage: test 13 | dependencies: [] 14 | only: [master, merge_requests] 15 | cache: {} 16 | variables: 17 | GIT_STRATEGY: fetch 18 | before_script: [] 19 | script: 20 | - sudo apt update && sudo apt install -y python3-pip && pip3 install --user cmake_format pyyaml 21 | - env PATH=~/.local/bin:$PATH find . -name "*.cmake" -exec cmake-format --check {} + || (echo "CMake formatting issues found. Please fix them first!"; $(exit 1)) 22 | 23 | deps: 24 | script: 25 | # test only a few dependencies. There are too many 26 | - mrt ci test_deps -f --no-status --release -i example_package_ros_tool --only $CI_PROJECT_NAME 27 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package mrt_cmake_modules 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.11 (2024-09-20) 6 | ------------------- 7 | * Merge pull request #38 from nobleo/fix/find-flann-cmake-module 8 | fix(FindFLANN): set(FLANN_FOUND ON) if target already defined 9 | * Contributors: keroe 10 | 11 | 1.0.10 (2024-07-26) 12 | ------------------- 13 | * FindGeographicLib: Fix for GeographicLib 2.* and Windows 14 | Since GeographicLib version 2, the library name changed from `libGeographic.so` to `libGeographicLib.so`, see https://github.com/geographiclib/geographiclib/blob/5e4425da84a46eb70e59656d71b4c99732a570ec/NEWS#L208 . 15 | To ensure that GeographicLib 2.* is found correcty, I think we should add also `GeographicLib` to the names used by `find_library`. 16 | Furthermore, on Windows the import library is called `GeographicLib-i.lib` (see https://github.com/geographiclib/geographiclib/blob/v2.3/src/CMakeLists.txt#L119), so to find the library correctly on Windows we also look for GeographicLib-i . 17 | * add ortools 18 | * Revert "mrt_add_library now adds a compilation tests for all headers used by the library" 19 | This reverts commit b05cac0200ce6b8de8e8a18789dbd58cd9d8d1eb. 20 | * Merge branch 'master' into HEAD 21 | * Changes how the check for formatting is done. 22 | Now the CI job uses the --check flag provided by cmake_format instead of 23 | the `git diff` check, because git caused some problems in this repo. 24 | * format 25 | * mrt_add_library now adds a compilation tests for all headers used by the library 26 | * Add ZeroMQ 27 | * Add zxing-cpp to cmake.yaml. 28 | * hard coded ignore files which start with "mocs_compilation and delete the corresponding gcda file, because otherwise our current coverage pipeline fails. 29 | * Contributors: Fabian Poggenhans, Jan-Hendrik Pauls, Johannes Beck, Kevin Rösch, Mrt Builder, Yinzhe Shen 30 | 31 | 1.0.9 (2021-11-26) 32 | ------------------ 33 | * Set python version 34 | * Set PYTHON_EXECUTABLE for rolling 35 | * Add find script and cmake.yml entry for proj. 36 | * Update FLANN find script to work with newer versions. 37 | * add boost iostreams component 38 | * Removed debug message. 39 | * Fix find boost python for cmake 3.20. 40 | * add xerces and curl to camke.yaml 41 | * Fix warnings in CUDA code. 42 | * Remove cmake 3.20-only syntax 43 | * Headers from dependencies are no longer marked as system, except from overlayed workspaces 44 | * Set the ccache base dir as environment variable of the compiler command 45 | * add pangolin 46 | * Fix formatting of test failures on python3 47 | * Fix recovering from sanitizer issues by making sure the flag is set only once 48 | resolves MRT/draft/simulation_adenauerring#34 49 | * fix action build 50 | * Use mrt_cgal again (brings a newer version than ubuntu) 51 | * Adding or-tools to cmake.yaml. 52 | * Sanitizers: enable recovering form nullptr issues even in no_recover mode 53 | this fixes otherwise unfixable issues e.g. in boost::serialization using this 54 | * Update/remove old maintainer emails 55 | * Improve evaluation of conditions in package.xml 56 | in order to make it more compliant with REP149 57 | * Increase character limits for conditions specified package.xml 58 | This is necessary so that conditions that are based on ROS_DISTRO can be specified 59 | * Add cmake entry for libnlopt-cpp-dev, new for focal 60 | * Fix python script installation 61 | (shebang replacement) 62 | * Add mrt_casadi to cmake.yaml 63 | * Add mrt_hpipm to cmake.yaml 64 | * Add mrt_blasfeo to cmake.yaml 65 | * Add a small Readme pointing to cmake-format 66 | * change name to match internal name 67 | * add mrt-osqp-eigen 68 | * add osqp 69 | * Fix aravis find script. 70 | * Switch to use aravis 0.8. 71 | * Contributors: Fabian Poggenhans, Ilia Baltashov, Johannes Beck, Kevin Rösch, Maximilian Naumann, Piotr Orzechowski, Bernd Kröper, wep21 72 | 73 | 1.0.8 (2020-09-30) 74 | ------------------ 75 | * Fix finding boost python on versions with old cmake but new boost 76 | * Contributors: Fabian Poggenhans 77 | 78 | 1.0.7 (2020-09-30) 79 | ------------------ 80 | * Fix versioning of sofiles 81 | * Ensure unittests use the right gtest include dir 82 | * Contributors: Fabian Poggenhans 83 | 84 | 1.0.6 (2020-09-30) 85 | ------------------ 86 | * Fix boost python building for python3 87 | * Contributors: Fabian Poggenhans 88 | 89 | 1.0.5 (2020-09-29) 90 | ------------------ 91 | * Fix build for ROS2, gtest should no longer be installed in ROS2 mode 92 | * Improve python nosetest info 93 | * Update boost-python depend message 94 | * Fix python module setup 95 | * Packages can now have both a python module and a python api 96 | * Add qtbase5-dev key 97 | * Contributors: Fabian Poggenhans, Kevin Rösch, Maximilian Naumann 98 | 99 | 1.0.4 (2020-08-12) 100 | ------------------ 101 | * Deleted deprecated configuration files 102 | * Fix cuda host compiler used for cuda 11 103 | * Fix __init__.py template for python3 104 | * Fix target handling for ros2 105 | * Fix build failures on ROS1 106 | * Fix the conan support 107 | * Add a dependency on ros_environment to ensure ROS_VERSION is set 108 | * Default to building shared libraries 109 | * Add QtScript to the list of qt components 110 | * Change license to BSD 111 | * Remove traces of GPL-licensed libgps 112 | * Remove unnecessary includes of cuda files 113 | * Update tensorflow c findscript to set new tensorflow include paths 114 | * Add cuda support for node and nodelet. 115 | * Remove usage of ast package for evaulating package.xml conditions 116 | * Fix crash if eval_coverage.py runs with python3 117 | * Ensure that coverage is also generated for cpp code called from plain rostests 118 | * Contributors: Fabian Poggenhans, Ilia Baltashov, Sven Richter 119 | 120 | 1.0.3 (2020-05-25) 121 | ------------------ 122 | * Replace deprecated platform.distro call with distro module 123 | * Raise required CMake version to 3.0.2 to suppress warning with Noetic 124 | * Remove boost signals component that is no longer part of boost 125 | * Fixed c++14 test path include. 126 | * Fix installation of python api files 127 | * Update README.md 128 | * Reformat with new version of cmake-format 129 | * Add lcov as dependency again 130 | * Fix FindBoostPython.cmake for cmake below 3.11 and python3 131 | * Fix multiple include of MrtPCL 132 | * Contributors: Christian-Eike Framing, Fabian Poggenhans, Johannes Beck, Johannes Janosovits, Moritz Cremer 133 | 134 | 1.0.2 (2020-03-24) 135 | ------------------ 136 | * Fix PCL findscript, disable precompiling 137 | * added jsoncpp 138 | * Make sure packages search for mrt_cmake_modules in their package config 139 | * Fix resolution of packages in underlaying workspaces 140 | * Mention rosdoc.yaml in package.xml 141 | * Contributors: Fabian Poggenhans, Johannes Beck, Johannes Janosovits 142 | 143 | 1.0.1 (2020-03-11) 144 | ------------------ 145 | * Update maintainer 146 | * Update generate_dependency_file to search CMAKE_PREFIX_PATH for packages instead of ROS_PACKAGE_PATH 147 | * Update package xml to contain ROS urls and use format 3 to specify python version specific deps 148 | * Add a rosdoc file so that ros can build the cmake api 149 | * Contributors: Fabian Poggenhans 150 | 151 | 1.0.0 (2020-02-24) 152 | ------------------ 153 | * Initial release for ROS 154 | * Contributors: Andre-Marcel Hellmund, Claudio Bandera, Fabian Poggenhans, Johannes Beck, Johannes Graeter, Niels Ole Salscheider, Piotr Orzechowski 155 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(mrt_cmake_modules) 3 | 4 | if($ENV{ROS_VERSION} EQUAL 1) 5 | find_package(catkin REQUIRED) 6 | catkin_package(CFG_EXTRAS mrt_cmake_modules-extras.cmake) 7 | else() 8 | cmake_policy(SET CMP0057 NEW) 9 | set(CATKIN_PACKAGE_SHARE_DESTINATION share/${PROJECT_NAME}) 10 | set(CATKIN_PACKAGE_BIN_DESTINATION bin) 11 | find_package(ament_cmake_core REQUIRED) 12 | ament_package(CONFIG_EXTRAS cmake/mrt_cmake_modules-extras.cmake.in) 13 | endif() 14 | 15 | # Install all cmake files 16 | install(DIRECTORY cmake DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 17 | install(PROGRAMS scripts/generate_cmake_dependency_file.py scripts/init_coverage.py scripts/eval_coverage.py 18 | scripts/run_test.py DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/scripts) 19 | install(PROGRAMS scripts/generate_cmakelists.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) 20 | install(FILES yaml/cmake.yaml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/yaml) 21 | install(FILES ci_templates/CMakeLists.txt DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) 22 | 23 | # Make sure the same test targets exist as in other projects. This is so that "catkin run_tests" works, etc. 24 | if(CATKIN_ENABLE_TESTING) 25 | if(NOT TARGET tests) 26 | add_custom_target(tests) 27 | endif() 28 | if(NOT TARGET run_tests) 29 | # usually catkin does that for us 30 | add_custom_target(run_tests) 31 | enable_testing() 32 | endif() 33 | if(NOT TARGET run_tests_${PROJECT_NAME}) 34 | add_custom_target(run_tests_${PROJECT_NAME}) 35 | add_dependencies(run_tests run_tests_${PROJECT_NAME}) 36 | endif() 37 | endif() 38 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @roesch @poggenhans @beck 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Karlsruhe Institute of Technology, Institute for Measurement and Control Systems 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MRT CMake Modules (Massively Reduced Time writing CMake Modules(*)) 2 | 3 | Maintainer status: maintained 4 | - Maintainer: Kevin Rösch, Fabian Poggenhans 5 | - Author: Johannes Beck, Claudio Bandera, Fabian Poggenhans 6 | - License: BSD, some files MIT 7 | - Bug / feature tracker: https://gitlab.mrt.uni-karlsruhe.de/MRT/mrt_cmake_modules/issues 8 | - Source: git https://gitlab.mrt.uni-karlsruhe.de/MRT/mrt_cmake_modules.git (branch: master) 9 | 10 | Imagine you whould never have to write a **CMakeLists.txt** file again. Never forget to install everything, no need to update it whenever you add a file, not time lost for figuring out how to call and use `find_package` for your dependencies, etc. 11 | 12 | Well, this is exactly what `mrt_cmake_modules` do for you! The only thing you have to do is: 13 | - Keep your files in a [fixed structure](#package-structure), 14 | - keep library and executable code in separate packages and 15 | - make sure the package.xml actually contains all the packages you depend on. 16 | 17 | If you don't want to agree to this, there are [ways to get this done as well](#cmake-api). This will require you to modify our template file a bit. 18 | 19 | On the other hand, you get a lot of things for free: 20 | - Resolution of your [dependencies in CMake](#how-dependency-resolution-works-in-detail) 21 | - Automatic generation of Nodes/Nodelets 22 | - Supports C++ and Python(2/3) 23 | - Python bindings for pybind11/boost-python 24 | - Automated unittest detection and execution (including ROS tests) 25 | - Automated [code coverage generation](#generating-code-coverage) 26 | - Support for [sanitizers](#sanitizing-your-code) 27 | - Support for [running clang-tidy](#using-clang-tidy) 28 | - Automated install of your scripts/launchfiles/executables/libraries... to the correct location 29 | - experimental support for **ROS2** and Conan builds 30 | 31 | *) Actually MRT stands for *Institut für Mess- und Regelungstechnik*, the institute that develops this package. 32 | 33 | ## Building 34 | `mrt_cmake_modules` is kept as leightweight as possible. It just contains a few CMake (and python) scripts. Its only dependency is `catkin` and `lcov` (for code coverage). 35 | 36 | ## Getting started 37 | 38 | Interested? In order to get the CMake template file, you have to run a small script: `rosrun mrt_cmake_modules generate_cmakelists.py [--ros] [--exe]`. 39 | This will create a CMakeLists.txt file ready to be used in your project. We distinguish four different types of packages (this the `--ros` and `--exe` flags): 40 | - **Library package**: They have no dependency to ros (except catkin). Their goal is to either build a `lib.so`, contain only headers, contain a python module, contain python bindings. Or a mixture of these. And unittests, of course. 41 | - **Ros library package (--ros)**: Similar to the above, but can also contain message, action or configuration files 42 | - **Executable package (--exe)**: Provides either a number of executables, scripts or python modules for these scripts. And unittests of course. 43 | - **Node/Nodelet package (--ros --exe)**: Provides a number of nodes or nodelets, python nodes and launchfiles. And rostests of course. 44 | 45 | ## Package structure 46 | 47 | The best way to understand how packages have to be layed out is to have a look at the tree of an example package, and what it implies on the build. 48 | 49 | ### Libraries 50 | 51 | Here is the structure of a package called `example_package`. It works out of the box with a *CMakeLists.txt* created with `generate_cmakelists.py example_package --ros`: 52 | ```bash 53 | . 54 | ├── CMakeLists.txt # The generated CMakeLists 55 | ├── include # The headers of this package. Available in the whole package 56 | │ └── example_package # It is a ROS convention to keep them within include/ 57 | │ ├── a_header.hpp 58 | │ └── internal # Headers here are only to be used within cpp files of this package 59 | │ └── internal_header.hpp 60 | ├── msg 61 | │ └── a_message.msg # Messages files that will be automatically generated (only available for --ros) 62 | ├── package.xml # You should know that. Should contain at least pybind11-dev for the bindings 63 | ├── python_api # Folder for python bindings. Every file here becoms a module 64 | │ ├── python_bindings.cpp # Will be available as "import example_package.python_bindings" 65 | │ └── more_python_bindings.cpp # Refer to the pybind11 doc for the content of this file 66 | ├── README.md # The readme 67 | ├── src # Every cpp file in this filder will become part of libexample_package.so 68 | │ ├── examplefile.cpp 69 | │ ├── onemorefile.cpp 70 | │ └── example_package # Python modules have to go to src/ 71 | │ ├── pythonmodule.py # Will be available as "import example_package.pythonmodule" 72 | │ └── __init__.py 73 | └── test # Contains the unittests. Will be executed when running the test or run_tests target 74 | ├── test_example_package.cpp # Every file here will be a separate unittest executable 75 | └── test_pyapi.py # Every py file that matches the testMatch regular expression will be executed 76 | # using nosetest. Executables are ignored. See https://nose.readthedocs.io/ 77 | ``` 78 | 79 | Note that everything in this structure is optional and can be left away if you don't need it (except for the CMakeLists.txt of course). 80 | 81 | ### Executables, Nodes and Nodelets 82 | 83 | Here is the structure of a package called `example_package_ros_tool`. 84 | It works out of the box with a *CMakeLists.txt* created with `generate_cmakelists.py example_package_ros_tool --exe --ros`: 85 | 86 | ```bash 87 | . 88 | ├── CMakeLists.txt 89 | ├── cfg 90 | │ └── ConfigFile.cfg # Files to be passed to dynamic_reconfigure 91 | ├── launch # Contains launch files provided by this package 92 | │ ├── some_node.launch 93 | │ ├── some_nodelet.launch 94 | │ ├── some_python_node.launch 95 | │ └── params # Contains parameter files that will be installed 96 | │ ├── some_parameters.yaml 97 | │ └── some_python_parameters.yaml 98 | ├── nodelet_plugins.xml # Should reference the nodelet library at lib/lib--nodelet 99 | ├── package.xml # The manifest. It should reference the nodelet_plugins.xml 100 | ├── README.md 101 | ├── scripts # Executable scripts that will be installed. These can be python nodes as well 102 | │ ├── bias_python_node.py 103 | │ └── bias_script.sh 104 | ├── src # Every folder in here will be a node/nodelet or both 105 | │ ├── nodename # nodename is the name of the node/nodelet 106 | │ │ ├── somefile.cpp # Files compiled into the node and the nodelet 107 | │ │ ├── somefile.hpp 108 | │ │ ├── some_node.cpp # files ending with _node will end up being compiled into the node executable 109 | │ │ └── a_nodelet.cpp # files ending whth _nodelet will end up as part of the nodelet library 110 | │ └── example_package_ros_tool # python modules have to go to src/. 111 | │ ├── node_module_python.py # These files can provide the node implementation for the scripts 112 | │ └── __init__.py 113 | └── test # The unittests 114 | ├── test_node.cpp # Every pair of .cpp and .test files represents one rostest 115 | ├── test_node.test 116 | ├── test.cpp # A cpp file without a matching .test a normal unittest and launched without ROS 117 | ├── node_python_test.py # Same for .py and .test files with the same name. The .py file must be executable! 118 | └── node_python_test.test 119 | ``` 120 | 121 | For a normal, non-ros executable the structure is similar, but simpler. Every folder in the src file will become the name of an executable, and all cpp files within it will be part of the executable. 122 | 123 | ## Generating code coverage 124 | By default, your project is compiled without code coverage information. This can be changed by setting the cmake parameter `MRT_ENABLE_COVERAGE` (e.g. by configuring cmake with `-DMRT_ENABLE_COVERAGE=true`). 125 | Setting this requires a recompilation of the project. 126 | If this is set, running the `run_tests` target will run the unittests and afterwards automatically generate an html coverage report. 127 | The location is printed in the command line. If you set `MRT_ENABLE_COVERAGE=2`, it will also be opened in firefox afterwards. 128 | 129 | ## Sanitizing your code 130 | The Sanitizers [Asan](https://clang.llvm.org/docs/AddressSanitizer.html), [Tsan](https://clang.llvm.org/docs/ThreadSanitizer.html) and [UBsan](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) are great ways of detecting bugs at runtime. 131 | Sadly, you cannot enable them all as once, because Tsan cannot be used together with Asan and UBsan. 132 | You can enable them similarly to the code coverage by setting the `MRT_SANITIZER` cmake variable. It has two possible values: 133 | - checks (enables Asan and UBsan) 134 | - check_race (enables tsan) 135 | 136 | If one of the sanitzers discovers an error at runtime, it will be printed to cerr. 137 | 138 | ## Using clang-tidy 139 | Clang-tidy checks your code statically at compile time for patterns of unsave or wrong code. Using this feature requires clang-tidy to be installed. 140 | You might also want to provide a .clang-tidy file within your project that enables the checks of your choice. Refere to clang-tidys documentation for details. 141 | You can enable clang-tidy by setting the CMake variable `MRT_CLANG_TIDY`. 142 | 143 | If you set it to "check", clang-tidy will be run at compile time alongside the normal compiler and print all issues as compiler errors. 144 | If you set it to "fix" the recommended fixes will be applied directly to your code. 145 | **Careful**: Not all fixes ensure that the code compiles. 146 | Also the "fix" mode of clang-tidy is not thread safe, meaning that if you compile with multiple threads, multiple clang-tidy instances might try to fix the same file at the same time. 147 | 148 | ## How dependency resolution works in detail 149 | The *mrt_cmake_modules* parse your manifest file (i.e. `package.xml`) in order to figure out your dependencies. The following lines in the `CMakeLists.txt` are responsible for this: 150 | ```cmake 151 | find_package(mrt_cmake_modules REQUIRED) # finds this module 152 | include(UseMrtStdCompilerFlags) # sets some generally useful compiler/warning flags 153 | include(GatherDeps) # collects your dependencies and writes them into DEPENDEND_PACKAGES 154 | find_package(AutoDeps REQUIRED COMPONENTS ${DEPENDEND_PACKAGES}) # resolves your dependencies by calling find_package appropriately. 155 | ``` 156 | AutoDeps then figures out, which includes, libraries and targets are needed in order to build this package. 157 | The result is written into `MRT_INCLUDE_DIRS`, `MRT_LIBRARIES` and `MRT_LIBRARY_DIRS`. These variables should be passed to the cmake targets. 158 | 159 | The magic that happens under the hood can be understood by looking at the [cmake.yaml](yaml/cmake.yaml) within this project. It defines, for which dependency in the package.xml which findscript has to be searched and what variables 160 | it will set by the script if successful. These will then be appended to the `MRT_*` variables. 161 | 162 | ## CMake API 163 | This package contains a lot of useful cmake functions that are automatically available in all packages using the _mrt_cmake_modules_ as dependency, e.g. `mrt_install()`, `mrt_add_node_and_nodelet()`, `mrt_add_library()`, etc. 164 | The automatically generated file already makes use of them, but you can also use them in your custom CMakeLists. 165 | See [here](http://htmlpreview.github.io/?https://github.com/KIT-MRT/mrt_cmake_modules/blob/master/doc/generated_cmake_api.html) for a full documentation. 166 | 167 | ## Findscripts 168 | This package also contains a collection of [find-scripts](cmake/Modules) for thirdparty dependencies that are usually not shipped with a findscript. These are required by __AutoDeps__. 169 | 170 | ## Going further 171 | After you have saved time writing cmake boilerplate, it is now time to also save time writing ROS boilerplate. You might want to look into the [rosinterface_handler](https://github.com/KIT-MRT/rosinterface_handler) as well. It is already intergrated in the CMakeLists template. 172 | All you have to do is write a `.rosif` file, and this project will automatically handle reading parameters from the parameter server, creating subscribers and publishers and handling reconfigure callbacks for you! 173 | -------------------------------------------------------------------------------- /ci_templates/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | @ | @ # This file contains the different versions for which file stuff is used 2 | @ | @ # for ros, non-ros and header only library, library or executable 3 | @ | @ # 4 | @ | @ # The mask is as follows 5 | @ | @ # @12|34@ 6 | @ | @ # pos1: non ros package 7 | @ | @ # pos2: ros package 8 | @ | @ # pos3: library 9 | @ | @ # pos4: executable 10 | @ | @ # 11 | @ | @ # Put a "x" at the position to enable this line 12 | @ | @ # E.g a non-ros library has the following mask: @x |x @ 13 | @xx|xx@ set(MRT_PKG_VERSION 4.0.0) 14 | @xx|xx@ # Modify only if you know what you are doing! 15 | @xx|xx@ cmake_minimum_required(VERSION 3.5.1) 16 | @xx|xx@ project(${CMAKE_PACKAGE_NAME}) 17 | @xx|xx@ 18 | @xx|xx@ ################### 19 | @xx|xx@ ## Find packages ## 20 | @xx|xx@ ################### 21 | @xx|xx@ find_package(mrt_cmake_modules REQUIRED) 22 | @xx|xx@ include(UseMrtStdCompilerFlags) 23 | @xx|xx@ include(GatherDeps) 24 | @xx|xx@ 25 | @xx|xx@ # You can add a custom.cmake in order to add special handling for this package. E.g. you can do: 26 | @xx|xx@ # list(REMOVE_ITEM DEPENDEND_PACKAGES ...) 27 | @xx|xx@ # To remove libs which cannot be found automatically. You can also "find_package" other, custom dependencies there. 28 | @xx|xx@ # You can also set PROJECT_INSTALL_FILES to install files that are not installed by default. 29 | @ x|xx@ # For packages that generate ROS messages, you can do e.g. the following to ensure messages are found: 30 | @ x|xx@ # set(PROJECT_MESSAGE_DEPENDS std_msgs geometry_msgs) 31 | @xx|xx@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/custom.cmake") 32 | @xx|xx@ include("${CMAKE_CURRENT_SOURCE_DIR}/custom.cmake") 33 | @xx|xx@ endif() 34 | @xx|xx@ 35 | @xx|xx@ find_package(AutoDeps REQUIRED COMPONENTS ${DEPENDEND_PACKAGES}) 36 | @xx|xx@ 37 | @xx|xx@ mrt_parse_package_xml() 38 | @xx|xx@ 39 | @xx|xx@ ######################## 40 | @xx|xx@ ## Add python modules ## 41 | @xx|xx@ ######################## 42 | @xx|xx@ # This adds a python module if located under src/{PROJECT_NAME) 43 | @xx|xx@ mrt_python_module_setup() 44 | @xx|xx@ 45 | @xx|x @ mrt_glob_files(PROJECT_PYTHON_SOURCE_FILES_SRC "python_api/*.cpp") 46 | @xx|x @ if (PROJECT_PYTHON_SOURCE_FILES_SRC) 47 | @xx|x @ # Add a cpp-python api library. Make sure there are no name collisions with python modules in this project 48 | @xx|x @ mrt_add_python_api( ${PROJECT_NAME} 49 | @xx|x @ FILES ${PROJECT_PYTHON_SOURCE_FILES_SRC} 50 | @xx|x @ ) 51 | @xx|x @ endif() 52 | @xx|x @ 53 | @ x|xx@ ################################################ 54 | @ x|xx@ ## Declare ROS messages, services and actions ## 55 | @ x|xx@ ################################################ 56 | @ x|xx@ 57 | @ x|xx@ # Add message, service and action files 58 | @ x|xx@ mrt_add_message_files(msg) 59 | @ x|xx@ mrt_add_service_files(srv) 60 | @ x|xx@ mrt_add_action_files(action) 61 | @ x|xx@ 62 | @ x|xx@ # Generate added messages and services with any dependencies listed here 63 | @ x|xx@ if (ROS_GENERATE_MESSAGES) 64 | @ x|xx@ generate_messages( 65 | @ x|xx@ DEPENDENCIES ${PROJECT_MESSAGE_DEPENDS} 66 | @ x|xx@ ) 67 | @ x|xx@ endif() 68 | @ x|xx@ 69 | @ x|xx@ # Generate dynamic reconfigure options 70 | @ x|xx@ mrt_glob_files(PARAMS_FILES "cfg/*.params" "cfg/*.cfg" "cfg/*.mrtcfg" "cfg/*.rosif") 71 | @ x|xx@ if (PARAMS_FILES) 72 | @ x|xx@ generate_ros_parameter_files(${PARAMS_FILES}) 73 | @ x|xx@ generate_ros_interface_files(${PARAMS_FILES}) 74 | @ x|xx@ endif() 75 | @ x|xx@ 76 | @xx|x @ ############################ 77 | @xx|x @ ## Read source code files ## 78 | @xx|x @ ############################ 79 | @xx|x @ mrt_glob_files_recurse(PROJECT_HEADER_FILES_INC "include/*.h" "include/*.hpp" "include/*.cuh") 80 | @xx|x @ mrt_glob_files(PROJECT_SOURCE_FILES_INC "src/*.h" "src/*.hpp" "src/*.cuh") 81 | @xx|x @ mrt_glob_files(PROJECT_SOURCE_FILES_SRC "src/*.cpp" "src/*.cu") 82 | @xx|xx@ 83 | @xx|xx@ ########### 84 | @xx|xx@ ## Build ## 85 | @xx|xx@ ########### 86 | @xx|x @ # Declare a cpp library 87 | @xx|x @ mrt_add_library(${PROJECT_NAME} 88 | @xx|x @ INCLUDES ${PROJECT_HEADER_FILES_INC} ${PROJECT_SOURCE_FILES_INC} 89 | @xx|x @ SOURCES ${PROJECT_SOURCE_FILES_SRC} 90 | @xx|x @ ) 91 | @xx| x@ mrt_glob_folders(SRC_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/src") 92 | @xx| x@ if (SRC_DIRECTORIES) 93 | @xx| x@ # Found subfolders, add executable for each subfolder 94 | @xx| x@ foreach(SRC_DIR ${SRC_DIRECTORIES}) 95 | @x | x@ mrt_add_executable(${SRC_DIR} FOLDER "src/${SRC_DIR}") 96 | @ x| x@ mrt_add_node_and_nodelet(${SRC_DIR} FOLDER "src/${SRC_DIR}") 97 | @xx| x@ endforeach() 98 | @xx| x@ else() 99 | @xx| x@ # No subfolder found, add executable and python modules for src folder 100 | @x | x@ mrt_add_executable(${PROJECT_NAME} FOLDER "src") 101 | @ x| x@ mrt_add_node_and_nodelet(${PROJECT_NAME} FOLDER "src") 102 | @xx| x@ endif() 103 | @xx|xx@ 104 | @xx|xx@ ############# 105 | @xx|xx@ ## Install ## 106 | @xx|xx@ ############# 107 | @xx|xx@ # Install all targets, headers by default and scripts and other files if specified (folders or files). 108 | @xx|xx@ # This command also exports libraries and config files for dependent packages and this supersedes catkin_package. 109 | @ x|xx@ mrt_install(PROGRAMS scripts FILES launch rviz maps res data nodelet_plugins.xml plugin_description.xml ${PROJECT_INSTALL_FILES}) 110 | @x |xx@ mrt_install(PROGRAMS scripts FILES res data ${PROJECT_INSTALL_FILES}) 111 | @xx|xx@ 112 | @xx|xx@ ############# 113 | @xx|xx@ ## Testing ## 114 | @xx|xx@ ############# 115 | @xx|xx@ # Add test targets for cpp and python tests 116 | @xx|xx@ if (CATKIN_ENABLE_TESTING) 117 | @ x| x@ # Include header in src folder via src//.h 118 | @ x|xx@ mrt_add_ros_tests(test) 119 | @ x|x @ mrt_add_tests(test) 120 | @x |xx@ mrt_add_tests(test) 121 | @xx|xx@ mrt_add_nosetests(test) 122 | @xx|xx@ endif() 123 | -------------------------------------------------------------------------------- /ci_templates/catkin_project_template.yml: -------------------------------------------------------------------------------- 1 | #version=1.6 2 | include: 3 | - project: 'pub/mrt_build_config' 4 | ref: master 5 | file: '/ci_templates/default_catkin_project.yml' 6 | -------------------------------------------------------------------------------- /ci_templates/default_catkin_project.yml: -------------------------------------------------------------------------------- 1 | #version=1.6 2 | include: 3 | - project: 'pub/mrt_build_config' 4 | ref: master 5 | file: '/ci_templates/default_catkin_project.yml' 6 | 7 | -------------------------------------------------------------------------------- /ci_templates/gbp_project.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - project: 'pub/mrt_build_config' 3 | ref: master 4 | file: '/ci_templates/gbp_project.yml' 5 | -------------------------------------------------------------------------------- /cmake/Modules/CatkinMockForConan.cmake: -------------------------------------------------------------------------------- 1 | # This file lets a conan build look like a catkin build for the rest of the tools. This is done by defining all 2 | # the variables that the rest of the build system would expect 3 | set(catkin_FOUND TRUE) 4 | message(STATUS "testing: ${CATKIN_ENABLE_TESTING}") 5 | 6 | conan_define_targets() 7 | target_link_libraries(${PROJECT_NAME}::auto_deps_export INTERFACE ${CONAN_TARGETS}) 8 | if(CONAN_USER_PYTHON_DEV_CONFIG_python_exec) 9 | set(PYTHON_VERSION ${CONAN_USER_PYTHON_DEV_CONFIG_python_version}) 10 | set(PYTHON_EXECUTABLE ${CONAN_USER_PYTHON_DEV_CONFIG_python_exec}) 11 | endif() 12 | 13 | set(CATKIN_DEVEL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}) 14 | set(${PROJECT_NAME}_CATKIN_PACKAGE True) # avoids that export cmake files are generated, conan does this 15 | 16 | function(catkin_package_xml) 17 | 18 | endfunction() 19 | -------------------------------------------------------------------------------- /cmake/Modules/ExportPackage.cmake: -------------------------------------------------------------------------------- 1 | function(_mrt_export_package) 2 | cmake_parse_arguments(ARG "" "" "EXPORTS;LIBRARIES;TARGETS" ${ARGN}) 3 | message(STATUS "Generating cmake exports for ${PROJECT_NAME} to ${CATKIN_DEVEL_PREFIX}/share") 4 | 5 | # deduplicate targets (e.g. contained by multiple variables) 6 | if(ARG_TARGETS) 7 | list(REMOVE_DUPLICATES ARG_TARGETS) 8 | endif() 9 | # handle extras file 10 | set(extras_base_name ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}-extras.cmake) 11 | if(EXISTS ${extras_base_name}) 12 | message(STATUS "Installing extras file '${PROJECT_NAME}-extras.cmake'") 13 | configure_file(${extras_base_name} 14 | ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}-extras.cmake COPYONLY) 15 | install(FILES ${extras_base_name} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) 16 | # _mrt_extras_file is expected by the config.cmake 17 | set(_mrt_extras_file ${PROJECT_NAME}-extras.cmake) 18 | elseif(EXISTS ${extras_base_name}.in) 19 | message(STATUS "Installing and configuring extras file '${PROJECT_NAME}-extras.cmake.in'") 20 | set(DEVELSPACE TRUE) 21 | set(INSTALLSPACE FALSE) 22 | set(PROJECT_SPACE_DIR ${CATKIN_DEVEL_PREFIX}) 23 | set(PKG_CMAKE_DIR ${PROJECT_SPACE_DIR}/share/${PROJECT_NAME}/cmake) 24 | set(PKG_INCLUDE_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}) 25 | configure_file(${extras_base_name}.in 26 | ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}-extras.cmake @ONLY) 27 | set(DEVELSPACE FALSE) 28 | set(INSTALLSPACE TRUE) 29 | set(PROJECT_SPACE_DIR ${CMAKE_INSTALL_PREFIX}) 30 | set(PKG_CMAKE_DIR "\${${PROJECT_NAME}_DIR}") 31 | set(PKG_INCLUDE_PREFIX "\\\${prefix}") 32 | configure_file(${extras_base_name}.in 33 | ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}-extras.cmake @ONLY) 34 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}-extras.cmake 35 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) 36 | set(_mrt_extras_file ${PROJECT_NAME}-extras.cmake) 37 | elseif(EXISTS ${extras_base_name}.em) 38 | message( 39 | FATAL_ERROR 40 | "The project contains a ${extras_base_name}.em file. These are not supported by mrt_cmake_modules. Please use ${extras_base_name}.in!" 41 | ) 42 | endif() 43 | 44 | # if we dont export something but still have messages or action files that generate a header, we build a dummy 45 | # target and export that instead 46 | if(NOT ARG_EXPORTS AND (ROS_GENERATE_ACTION OR ROS_GENERATE_MESSAGES)) 47 | add_library(project_generated_headers INTERFACE) 48 | mrt_add_links(project_generated_headers) 49 | set(ARG_LIBRARIES project_generated_headers) 50 | if(TARGET ${PROJECT_NAME}_compiler_flags) 51 | list(APPEND ARG_LIBRARIES ${PROJECT_NAME}_compiler_flags) 52 | endif() 53 | install(TARGETS ${ARG_LIBRARIES} EXPORT generated_headers_exports) 54 | set(ARG_EXPORTS generated_headers_exports) 55 | endif() 56 | 57 | if(ARG_EXPORTS) 58 | # these are expected by the config file 59 | set(_mrt_libraries) 60 | foreach(lib ${ARG_LIBRARIES}) 61 | list(APPEND _mrt_libraries ${PROJECT_NAME}::${lib}) 62 | endforeach() 63 | set(_mrt_targets ${ARG_TARGETS}) 64 | export( 65 | EXPORT ${ARG_EXPORTS} 66 | FILE ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}Targets.cmake 67 | NAMESPACE ${PROJECT_NAME}::) 68 | install( 69 | EXPORT ${ARG_EXPORTS} 70 | FILE ${PROJECT_NAME}Targets.cmake 71 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake 72 | NAMESPACE ${PROJECT_NAME}::) 73 | # create alias targets for multi-project builds 74 | foreach(lib ${ARG_LIBRARIES}) 75 | add_library(${PROJECT_NAME}::${lib} ALIAS ${lib}) 76 | endforeach() 77 | endif() 78 | 79 | include(CMakePackageConfigHelpers) 80 | # generate the config file that includes the exports 81 | configure_package_config_file( 82 | ${MCM_TEMPLATE_DIR}/packageConfig.cmake.in 83 | "${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}Config.cmake" 84 | INSTALL_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake" 85 | NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO) 86 | # generate the version file for the config file 87 | write_basic_package_version_file( 88 | "${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}ConfigVersion.cmake" 89 | VERSION "${${PROJECT_NAME}_VERSION}" 90 | COMPATIBILITY AnyNewerVersion) 91 | install(FILES "${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}ConfigVersion.cmake" 92 | DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake") 93 | 94 | # "install" the autodeps file to the devel folder 95 | configure_file(${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/auto_dep_vars.cmake 96 | ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/auto_dep_vars.cmake COPYONLY) 97 | # "install" AutoDepsConfig file to the devel folder 98 | configure_file(${MRT_CMAKE_MODULES_CMAKE_PATH}/Modules/FindAutoDeps.cmake 99 | ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}AutoDepsConfig.cmake COPYONLY) 100 | 101 | # install the configuration and dependency file file 102 | install( 103 | FILES "${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}Config.cmake" 104 | "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/auto_dep_vars.cmake" 105 | "${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}AutoDepsConfig.cmake" 106 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) 107 | 108 | # install cmake files 109 | if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 110 | install( 111 | DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ 112 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake 113 | PATTERN "${PROJECT_NAME}-extras.cmake*" EXCLUDE) 114 | endif() 115 | 116 | # install package.xml 117 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}) 118 | endfunction() 119 | -------------------------------------------------------------------------------- /cmake/Modules/FindANN.cmake: -------------------------------------------------------------------------------- 1 | set(PACKAGE_HEADER_FILES "ANN/ANN.h") 2 | set(PACKAGE_LIBRARIES ANN ann) 3 | 4 | find_path(ANN_INCLUDE_DIR NAMES ${PACKAGE_HEADER_FILES}) 5 | find_library(ANN_LIBRARIES NAMES ${PACKAGE_LIBRARIES}) 6 | 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args( 9 | ANN 10 | FOUND_VAR ANN_FOUND 11 | REQUIRED_VARS ANN_INCLUDE_DIR ANN_LIBRARIES) 12 | -------------------------------------------------------------------------------- /cmake/Modules/FindAravis.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig REQUIRED) 2 | include(FindPkgConfig) 3 | pkg_check_modules(PC_ARAVIS REQUIRED aravis-0.8) 4 | 5 | set(Aravis_INCLUDE_DIRS ${PC_ARAVIS_INCLUDE_DIRS}) 6 | 7 | # Convert library paths to absolute ones. 8 | foreach(LIB ${PC_ARAVIS_LIBRARIES}) 9 | find_library(LIBRARY_ABS_${LIB} ${LIB} PATHS ${PC_ARAVIS_LIBRARY_DIRS}) 10 | list(APPEND Aravis_LIBRARIES "${LIBRARY_ABS_${LIB}}") 11 | endforeach() 12 | 13 | include(FindPackageHandleStandardArgs) 14 | find_package_handle_standard_args(Aravis DEFAULT_MSG PC_ARAVIS_LIBRARIES PC_ARAVIS_INCLUDE_DIRS) 15 | 16 | mark_as_advanced(Aravis_LIBRARIES Aravis_INCLUDE_DIRS) 17 | -------------------------------------------------------------------------------- /cmake/Modules/FindBoostPython.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the a valid boost+python combination 2 | # Once done this will define 3 | # 4 | # BoostPython_FOUND - system has a valid boost+python combination 5 | # BoostPython_INCLUDE_DIRS - the include directory for boost+python 6 | # BoostPython_LIBRARIES - the needed libs for boost+python 7 | 8 | if(PYTHON_VERSION) 9 | set(_python_version ${PYTHON_VERSION}) 10 | else() 11 | set(_python_version 2.7) 12 | endif() 13 | if(_python_version VERSION_EQUAL 3 AND CMAKE_VERSION VERSION_GREATER 3.15) 14 | # we also need the subversion 15 | find_package(Python3 REQUIRED) 16 | 17 | if(CMAKE_VERSION VERSION_GREATER 3.19) 18 | set(_python_version "${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}") 19 | else() 20 | set(_python_version ${Python3_VERSION}) 21 | endif() 22 | endif() 23 | 24 | # this only works with a recent cmake/boost combination 25 | if(CMAKE_VERSION VERSION_GREATER 3.11) 26 | find_package(Boost COMPONENTS python${_python_version} numpy${_python_version}) 27 | # ...unless we are dealing with boost 1.70 and above where we can only hope this finds the right version 28 | if(NOT Boost_PYTHON${_python_version}_FOUND) 29 | set(Boost_PYTHON_VERSION ${_python_version}) 30 | find_package(Boost COMPONENTS python numpy) 31 | set(Boost_PYTHON${_python_version}_FOUND ${Boost_PYTHON_FOUND}) 32 | set(Boost_PYTHON${_python_version}_LIBRARY ${Boost_PYTHON_LIBRARY}) 33 | set(Boost_NUMPY${_python_version}_LIBRARY ${Boost_NUMPY_LIBRARY}) 34 | endif() 35 | endif() 36 | 37 | if(NOT (Boost_PYTHON${_python_version}_FOUND OR Boost_python_FOUND)) 38 | # on older cmake versions, "python" finds python2, otherwise python3 39 | set(_search_version) 40 | if(NOT _python_version VERSION_LESS 3) 41 | set(_search_version ${_python_version}) 42 | endif() 43 | find_package(Boost REQUIRED COMPONENTS python${_search_version}) 44 | find_package(Boost QUIET COMPONENTS numpy${_search_version}) # numpy is not available on some boost versions 45 | set(Python_ADDITIONAL_VERSIONS ${_python_version}) 46 | find_package(PythonLibs REQUIRED) 47 | set(BoostPython_INCLUDE_DIRS ${Boost_INCLUDE_DIR} ${PYTHON_INCLUDE_DIR}) 48 | set(BoostPython_LIBRARIES ${Boost_PYTHON${_search_version}_LIBRARIES} ${Boost_NUMPY${_search_version}_LIBRARIES} 49 | ${PYTHON_LIBRARIES}) 50 | elseif(_python_version VERSION_LESS 3) 51 | find_package(Python2 REQUIRED COMPONENTS Development) 52 | set(BoostPython_INCLUDE_DIRS ${Boost_INCLUDE_DIR} ${Python2_INCLUDE_DIRS}) 53 | set(BoostPython_LIBRARIES ${Boost_PYTHON${_python_version}_LIBRARY} ${Boost_NUMPY${_python_version}_LIBRARY} 54 | ${Python2_LIBRARIES}) 55 | else() 56 | find_package(Python3 REQUIRED COMPONENTS Development) 57 | set(BoostPython_INCLUDE_DIRS ${Boost_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}) 58 | set(BoostPython_LIBRARIES ${Boost_PYTHON${_python_version}_LIBRARY} ${Boost_NUMPY${_python_version}_LIBRARY} 59 | ${Python3_LIBRARIES}) 60 | endif() 61 | 62 | find_package_handle_standard_args(BoostPython DEFAULT_MSG BoostPython_LIBRARIES BoostPython_INCLUDE_DIRS) 63 | -------------------------------------------------------------------------------- /cmake/Modules/FindCTensorflow.cmake: -------------------------------------------------------------------------------- 1 | # try to find tensorflow 2 | find_package(PkgConfig) 3 | find_path(TENSORFLOW_C_INCLUDE_DIR tensorflow/tensorflow/c/c_api.h PATH_SUFFIXES tensorflow) 4 | 5 | set(TENSORFLOW_C_INCLUDE_DIR ${TENSORFLOW_C_INCLUDE_DIR} ${TENSORFLOW_C_INCLUDE_DIR}/tensorflow) 6 | 7 | find_library(TENSORFLOW_C_LIBRARY NAMES tensorflow) 8 | find_library(TENSORFLOW_FRAMEWORK_LIBRARY NAMES tensorflow_framework) 9 | 10 | if(TENSORFLOW_FRAMEWORK_LIBRARY) 11 | set(TENSORFLOW_LIBRARY ${TENSORFLOW_C_LIBRARY} ${TENSORFLOW_FRAMEWORK_LIBRARY}) 12 | else() 13 | set(TENSORFLOW_LIBRARY ${TENSORFLOW_C_LIBRARY}) 14 | endif(TENSORFLOW_FRAMEWORK_LIBRARY) 15 | 16 | include(FindPackageHandleStandardArgs) 17 | find_package_handle_standard_args(CTensorflow DEFAULT_MSG TENSORFLOW_LIBRARY TENSORFLOW_C_INCLUDE_DIR) 18 | 19 | mark_as_advanced(TENSORFLOW_LIBRARY TENSORFLOW_C_INCLUDE_DIR) 20 | set(TENSORFLOW_LIBRARIES ${TENSORFLOW_LIBRARY}) 21 | set(TENSORFLOW_C_INCLUDE_DIRS ${TENSORFLOW_C_INCLUDE_DIR}) 22 | -------------------------------------------------------------------------------- /cmake/Modules/FindCairo.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the cairo library 2 | # Once done this will define 3 | # 4 | # CAIRO_FOUND - system has cairo 5 | # CAIRO_INCLUDE_DIRS - the cairo include directory 6 | # CAIRO_LIBRARIES - Link these to use cairo 7 | # 8 | # Define CAIRO_MIN_VERSION for which version desired. 9 | # 10 | 11 | include(FindPkgConfig) 12 | 13 | if(Cairo_FIND_REQUIRED) 14 | set(_pkgconfig_REQUIRED "REQUIRED") 15 | else(Cairo_FIND_REQUIRED) 16 | set(_pkgconfig_REQUIRED "") 17 | endif(Cairo_FIND_REQUIRED) 18 | 19 | if(CAIRO_MIN_VERSION) 20 | pkg_search_module(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION}) 21 | else(CAIRO_MIN_VERSION) 22 | pkg_search_module(CAIRO ${_pkgconfig_REQUIRED} cairo) 23 | endif(CAIRO_MIN_VERSION) 24 | 25 | if(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) 26 | find_path(CAIRO_INCLUDE_DIRS cairo.h) 27 | find_library(CAIRO_LIBRARIES cairo) 28 | 29 | # Report results 30 | if(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) 31 | set(CAIRO_FOUND 1) 32 | if(NOT Cairo_FIND_QUIETLY) 33 | message(STATUS "Found Cairo: ${CAIRO_LIBRARIES}") 34 | endif(NOT Cairo_FIND_QUIETLY) 35 | else(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) 36 | if(Cairo_FIND_REQUIRED) 37 | message(SEND_ERROR "Could not find Cairo") 38 | else(Cairo_FIND_REQUIRED) 39 | if(NOT Cairo_FIND_QUIETLY) 40 | message(STATUS "Could not find Cairo") 41 | endif(NOT Cairo_FIND_QUIETLY) 42 | endif(Cairo_FIND_REQUIRED) 43 | endif(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) 44 | endif(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) 45 | 46 | # Hide advanced variables from CMake GUIs 47 | mark_as_advanced(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS) 48 | -------------------------------------------------------------------------------- /cmake/Modules/FindCereal.cmake: -------------------------------------------------------------------------------- 1 | set(PACKAGE_HEADER_FILES cereal/cereal.hpp) 2 | 3 | find_path(Cereal_INCLUDE_DIR NAMES ${PACKAGE_HEADER_FILES}) 4 | 5 | include(FindPackageHandleStandardArgs) 6 | find_package_handle_standard_args( 7 | Cereal 8 | FOUND_VAR Cereal_FOUND 9 | REQUIRED_VARS Cereal_INCLUDE_DIR) 10 | 11 | add_definitions(-DHAS_CEREAL) 12 | -------------------------------------------------------------------------------- /cmake/Modules/FindClangTidy.cmake: -------------------------------------------------------------------------------- 1 | find_program( 2 | ClangTidy_EXE 3 | NAMES "clang-tidy" 4 | DOC "Path to clang-tidy executable") 5 | 6 | include(FindPackageHandleStandardArgs) 7 | find_package_handle_standard_args( 8 | ClangTidy 9 | FOUND_VAR ClangTidy_FOUND 10 | REQUIRED_VARS ClangTidy_EXE) 11 | mark_as_advanced(CLANG_TIDY_EXE) 12 | -------------------------------------------------------------------------------- /cmake/Modules/FindFLANN.cmake: -------------------------------------------------------------------------------- 1 | #.rst: 2 | # FindFLANN 3 | # -------- 4 | # 5 | # Try to find FLANN library and headers. This module supports both old released versions 6 | # of FLANN ≤ 1.9.1 and newer development versions that ship with a modern config file. 7 | # 8 | # IMPORTED Targets 9 | # ^^^^^^^^^^^^^^^^ 10 | # 11 | # This module defines the :prop_tgt:`IMPORTED` targets: 12 | # 13 | # ``FLANN::FLANN`` 14 | # Defined if the system has FLANN. 15 | # 16 | # Result Variables 17 | # ^^^^^^^^^^^^^^^^ 18 | # 19 | # This module sets the following variables: 20 | # 21 | # :: 22 | # 23 | # FLANN_FOUND True in case FLANN is found, otherwise false 24 | # FLANN_ROOT Path to the root of found FLANN installation 25 | # 26 | # Example usage 27 | # ^^^^^^^^^^^^^ 28 | # 29 | # :: 30 | # 31 | # find_package(FLANN REQUIRED) 32 | # 33 | # add_executable(foo foo.cc) 34 | # target_link_libraries(foo FLANN::FLANN) 35 | # 36 | 37 | # Early return if FLANN target is already defined. This makes it safe to run 38 | # this script multiple times. 39 | if(TARGET FLANN::FLANN) 40 | set(FLANN_FOUND ON) 41 | return() 42 | endif() 43 | 44 | # First try to locate FLANN using modern config 45 | find_package(flann NO_MODULE ${FLANN_FIND_VERSION} QUIET) 46 | if(flann_FOUND) 47 | unset(flann_FOUND) 48 | set(FLANN_FOUND ON) 49 | # Create interface library that effectively becomes an alias for the appropriate (static/dynamic) imported FLANN target 50 | add_library(FLANN::FLANN INTERFACE IMPORTED) 51 | if(FLANN_USE_STATIC) 52 | set_property( 53 | TARGET FLANN::FLANN 54 | APPEND 55 | PROPERTY INTERFACE_LINK_LIBRARIES flann::flann_cpp_s) 56 | else() 57 | set_property( 58 | TARGET FLANN::FLANN 59 | APPEND 60 | PROPERTY INTERFACE_LINK_LIBRARIES flann::flann_cpp) 61 | endif() 62 | # Determine FLANN installation root based on the path to the processed Config file 63 | get_filename_component(_config_dir "${flann_CONFIG}" DIRECTORY) 64 | get_filename_component(FLANN_ROOT "${_config_dir}/../../.." ABSOLUTE) 65 | unset(_config_dir) 66 | return() 67 | endif() 68 | 69 | # Second try to locate FLANN using pkgconfig 70 | find_package(PkgConfig QUIET) 71 | if(FLANN_FIND_VERSION) 72 | pkg_check_modules(PC_FLANN flann>=${FLANN_FIND_VERSION}) 73 | else() 74 | pkg_check_modules(PC_FLANN flann) 75 | endif() 76 | 77 | find_path( 78 | FLANN_INCLUDE_DIR 79 | NAMES flann/flann.hpp 80 | HINTS ${PC_FLANN_INCLUDE_DIRS} ${FLANN_ROOT} $ENV{FLANN_ROOT} 81 | PATHS $ENV{PROGRAMFILES}/Flann $ENV{PROGRAMW6432}/Flann 82 | PATH_SUFFIXES include) 83 | 84 | if(FLANN_USE_STATIC) 85 | set(FLANN_RELEASE_NAME flann_cpp_s) 86 | set(FLANN_DEBUG_NAME flann_cpp_s-gd) 87 | set(FLANN_LIBRARY_TYPE STATIC) 88 | else() 89 | set(FLANN_RELEASE_NAME flann_cpp) 90 | set(FLANN_DEBUG_NAME flann_cpp-gd) 91 | set(FLANN_LIBRARY_TYPE SHARED) 92 | endif() 93 | 94 | find_library( 95 | FLANN_LIBRARY 96 | NAMES ${FLANN_RELEASE_NAME} 97 | HINTS ${PC_FLANN_LIBRARY_DIRS} ${FLANN_ROOT} $ENV{FLANN_ROOT} 98 | PATHS $ENV{PROGRAMFILES}/Flann $ENV{PROGRAMW6432}/Flann 99 | PATH_SUFFIXES lib) 100 | 101 | find_library( 102 | FLANN_LIBRARY_DEBUG 103 | NAMES ${FLANN_DEBUG_NAME} 104 | HINTS ${PC_FLANN_LIBRARY_DIRS} ${FLANN_ROOT} $ENV{FLANN_ROOT} 105 | PATHS $ENV{PROGRAMFILES}/Flann $ENV{PROGRAMW6432}/Flann 106 | PATH_SUFFIXES lib) 107 | 108 | include(FindPackageHandleStandardArgs) 109 | find_package_handle_standard_args(FLANN DEFAULT_MSG FLANN_LIBRARY FLANN_INCLUDE_DIR) 110 | 111 | if(FLANN_FOUND) 112 | add_library(FLANN::FLANN ${FLANN_LIBRARY_TYPE} IMPORTED) 113 | set_target_properties(FLANN::FLANN PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FLANN_INCLUDE_DIR}") 114 | set_target_properties(FLANN::FLANN PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${PC_FLANN_CFLAGS_OTHER}") 115 | set_property( 116 | TARGET FLANN::FLANN 117 | APPEND 118 | PROPERTY IMPORTED_CONFIGURATIONS "RELEASE") 119 | set_target_properties(FLANN::FLANN PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX") 120 | if(WIN32 AND NOT FLANN_USE_STATIC) 121 | set_target_properties(FLANN::FLANN PROPERTIES IMPORTED_IMPLIB_RELEASE "${FLANN_LIBRARY}") 122 | else() 123 | set_target_properties(FLANN::FLANN PROPERTIES IMPORTED_LOCATION_RELEASE "${FLANN_LIBRARY}") 124 | endif() 125 | if(FLANN_LIBRARY_DEBUG) 126 | set_property( 127 | TARGET FLANN::FLANN 128 | APPEND 129 | PROPERTY IMPORTED_CONFIGURATIONS "DEBUG") 130 | set_target_properties(FLANN::FLANN PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX") 131 | if(WIN32 AND NOT FLANN_USE_STATIC) 132 | set_target_properties(FLANN::FLANN PROPERTIES IMPORTED_IMPLIB_DEBUG "${FLANN_LIBRARY_DEBUG}") 133 | else() 134 | set_target_properties(FLANN::FLANN PROPERTIES IMPORTED_LOCATION_DEBUG "${FLANN_LIBRARY_DEBUG}") 135 | endif() 136 | endif() 137 | # Pkgconfig may specify additional link libraries besides from FLANN itself 138 | # in PC_FLANN_LIBRARIES, add them to the target link interface. 139 | foreach(_library ${PC_FLANN_LIBRARIES}) 140 | if(NOT _library MATCHES "flann") 141 | set_property( 142 | TARGET FLANN::FLANN 143 | APPEND 144 | PROPERTY INTERFACE_LINK_LIBRARIES "${_library}") 145 | endif() 146 | endforeach() 147 | get_filename_component(FLANN_ROOT "${FLANN_INCLUDE_DIR}" PATH) 148 | endif() 149 | -------------------------------------------------------------------------------- /cmake/Modules/FindGeographicLib.cmake: -------------------------------------------------------------------------------- 1 | # Look for GeographicLib 2 | # 3 | # Set 4 | # GEOGRAPHICLIB_FOUND = TRUE 5 | # GeographicLib_INCLUDE_DIRS = /usr/local/include 6 | # GeographicLib_LIBRARIES = /usr/local/lib/libGeographic.so 7 | # GeographicLib_LIBRARY_DIRS = /usr/local/lib 8 | 9 | find_package(PkgConfig) 10 | find_path(GeographicLib_INCLUDE_DIR GeographicLib/Config.h PATH_SUFFIXES GeographicLib) 11 | set(GeographicLib_INCLUDE_DIRS ${GeographicLib_INCLUDE_DIR}) 12 | 13 | find_library(GeographicLib_LIBRARIES NAMES Geographic GeographicLib GeographicLib-i) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(GeographicLib DEFAULT_MSG GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) 17 | mark_as_advanced(GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) 18 | -------------------------------------------------------------------------------- /cmake/Modules/FindIGL.cmake: -------------------------------------------------------------------------------- 1 | # libigl must be set up manually in src-folder of workspace via: 2 | # git clone https://github.com/libigl/libigl.git 3 | # cd libigl 4 | # git submodule update --init --recursive 5 | # mkdir build 6 | # cd build 7 | # cmake .. 8 | set(IGL_FOUND FALSE) 9 | 10 | find_path( 11 | LIBIGL_INCLUDE_DIR igl/readOBJ.h 12 | PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../libigl 13 | PATH_SUFFIXES include) 14 | 15 | if(${LIBIGL_INCLUDE_DIR} STREQUAL "LIBIGL_INCLUDE_DIR-NOTFOUND") 16 | return() 17 | endif() 18 | 19 | option(LIBIGL_USE_STATIC_LIBRARY "Use libigl as static library" OFF) 20 | option(LIBIGL_WITH_CGAL "Use CGAL" OFF) 21 | option(LIBIGL_WITH_COMISO "Use CoMiso" OFF) 22 | option(LIBIGL_WITH_CORK "Use Cork" OFF) 23 | option(LIBIGL_WITH_EMBREE "Use Embree" OFF) 24 | option(LIBIGL_WITH_MATLAB "Use Matlab" OFF) 25 | option(LIBIGL_WITH_MOSEK "Use MOSEK" OFF) 26 | option(LIBIGL_WITH_OPENGL "Use OpenGL" ON) 27 | option(LIBIGL_WITH_OPENGL_GLFW "Use GLFW" ON) 28 | option(LIBIGL_WITH_OPENGL_GLFW_IMGUI "Use ImGui" OFF) 29 | option(LIBIGL_WITH_PNG "Use PNG" ON) 30 | option(LIBIGL_WITH_TETGEN "Use Tetgen" OFF) 31 | option(LIBIGL_WITH_TRIANGLE "Use Triangle" OFF) 32 | option(LIBIGL_WITH_XML "Use XML" OFF) 33 | option(LIBIGL_WITH_PYTHON "Use Python" OFF) 34 | option(LIBIGL_WITHOUT_COPYLEFT "Disable Copyleft libraries" OFF) 35 | 36 | list(APPEND CMAKE_MODULE_PATH "${LIBIGL_INCLUDE_DIR}/../cmake") 37 | include(libigl) 38 | 39 | set(IGL_LIBRARIES igl::core igl::opengl_glfw igl::png) 40 | set(IGL_FOUND TRUE) 41 | -------------------------------------------------------------------------------- /cmake/Modules/FindIpopt.cmake: -------------------------------------------------------------------------------- 1 | # try to find ipopt 2 | find_package(PkgConfig) 3 | find_path(IPOPT_INCLUDE_DIRS IpIpoptApplication.hpp PATH_SUFFIXES coin) 4 | 5 | find_library(IPOPT_LIBRARIES NAMES ipopt) 6 | add_definitions(-DHAVE_STDDEF_H) 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args(Ipopt DEFAULT_MSG IPOPT_LIBRARIES IPOPT_INCLUDE_DIRS) 9 | 10 | mark_as_advanced(IPOPT_LIBRARIES IPOPT_INCLUDE_DIRS) 11 | -------------------------------------------------------------------------------- /cmake/Modules/FindLeptonica.cmake: -------------------------------------------------------------------------------- 1 | set(PACKAGE_HEADER_FILES leptonica/allheaders.h) 2 | set(PACKAGE_LIBRARIES lept) 3 | 4 | find_path(Leptonica_INCLUDE_DIR NAMES ${PACKAGE_HEADER_FILES}) 5 | find_library(Leptonica_LIBRARIES NAMES ${PACKAGE_LIBRARIES}) 6 | 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args( 9 | Leptonica 10 | FOUND_VAR Leptonica_FOUND 11 | REQUIRED_VARS Leptonica_INCLUDE_DIR Leptonica_LIBRARIES) 12 | -------------------------------------------------------------------------------- /cmake/Modules/FindMetis.cmake: -------------------------------------------------------------------------------- 1 | set(PACKAGE_HEADER_FILES metis.h) 2 | set(PACKAGE_LIBRARIES metis) 3 | 4 | find_path(Metis_INCLUDE_DIR NAMES ${PACKAGE_HEADER_FILES}) 5 | find_library(Metis_LIBRARIES NAMES ${PACKAGE_LIBRARIES}) 6 | 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args( 9 | Metis 10 | FOUND_VAR Metis_FOUND 11 | REQUIRED_VARS Metis_INCLUDE_DIR Metis_LIBRARIES) 12 | -------------------------------------------------------------------------------- /cmake/Modules/FindMrtCUDA.cmake: -------------------------------------------------------------------------------- 1 | find_package(CUDA REQUIRED) 2 | 3 | if(${CUDA_VERSION_STRING} VERSION_LESS 10.0) 4 | set(_CUDA_HOST_COMPILER "g++-6") 5 | elseif(${CUDA_VERSION_STRING} VERSION_LESS 10.2) 6 | set(_CUDA_HOST_COMPILER "g++-7") 7 | elseif(${CUDA_VERSION_STRING} VERSION_LESS 11.0) 8 | set(_CUDA_HOST_COMPILER "g++-8") 9 | else() 10 | set(_CUDA_HOST_COMPILER "g++-9") 11 | endif() 12 | 13 | if(POLICY CMP0104) 14 | cmake_policy(SET CMP0104 NEW) 15 | endif() 16 | 17 | if(NOT TARGET cuda_compiler_flags) 18 | add_library(cuda_compiler_flags INTERFACE IMPORTED) 19 | if(${CMAKE_VERSION} VERSION_LESS "3.9.0") 20 | set(CUDA_HOST_COMPILER "${_CUDA_HOST_COMPILER}") 21 | 22 | target_compile_options( 23 | cuda_compiler_flags 24 | INTERFACE -Wno-deprecated-gpu-targets;-std=c++14 $<$:-lineinfo;-g;--compiler-options;-fPIC> 25 | $<$>-O3;--compiler-options;-fPIC>) 26 | target_compile_definitions(cuda_compiler_flags $<$>NDEBUG>) 27 | set(CUDA_PROPAGATE_HOST_FLAGS OFF) 28 | else() 29 | set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc") 30 | set(CMAKE_CUDA_HOST_COMPILER "${_CUDA_HOST_COMPILER}") 31 | enable_language(CUDA) 32 | 33 | target_compile_options(cuda_compiler_flags 34 | INTERFACE $<$:-lineinfo;--expt-relaxed-constexpr>) 35 | # in cmake 3.17 apparently there should by cuda_std_14 as compile feature 36 | target_compile_features(cuda_compiler_flags INTERFACE cxx_std_14) 37 | target_include_directories(cuda_compiler_flags INTERFACE "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}") 38 | endif() 39 | endif() 40 | -------------------------------------------------------------------------------- /cmake/Modules/FindMrtOpenGL.cmake: -------------------------------------------------------------------------------- 1 | # only required to silence cmake warnings 2 | set(OpenGL_GL_PREFERENCE GLVND) 3 | if(MrtOpenGL_FIND_REQUIRED) 4 | find_package(OpenGL QUIET REQUIRED) 5 | elseif(MrtOpenGL_FIND_QUIETLY) 6 | find_package(OpenGL QUIET) 7 | else() 8 | find_package(OpenGL QUIET) 9 | endif() 10 | set(MrtOpenGL_FOUND ${OpenGL_FOUND}) 11 | -------------------------------------------------------------------------------- /cmake/Modules/FindMrtPCL.cmake: -------------------------------------------------------------------------------- 1 | # protect agains multiple inclusion 2 | if(TARGET mrt_pcl::pcl) 3 | return() 4 | endif() 5 | 6 | cmake_policy(PUSH) 7 | if(POLICY CMP0074) 8 | cmake_policy(SET CMP0074 NEW) 9 | endif() 10 | 11 | # find package component 12 | if(Mrtpcl_FIND_REQUIRED) 13 | find_package(PCL QUIET REQUIRED) 14 | elseif(Mrtpcl_FIND_QUIETLY) 15 | find_package(PCL QUIET) 16 | else() 17 | find_package(PCL QUIET) 18 | endif() 19 | 20 | add_library(mrt_pcl::pcl INTERFACE IMPORTED) 21 | 22 | # Copied from FindAutoDeps.cmake 23 | function(_cleanup_libraries var_name_libs) 24 | # replace "debug", "general" and "optimized" keywords in the libraries list with generator expressions 25 | list(LENGTH ${var_name_libs} size) 26 | foreach(idx RANGE ${size}) 27 | if(${idx} EQUAL ${size}) 28 | continue() 29 | endif() 30 | list(GET ${var_name_libs} ${idx} statement) 31 | if(${statement} STREQUAL "debug") 32 | math(EXPR next ${idx}+1) 33 | list(GET ${var_name_libs} ${next} lib) 34 | list(REMOVE_AT ${var_name_libs} ${next}) 35 | list(INSERT ${var_name_libs} ${next} "$<$:${lib}>") 36 | elseif(${statement} STREQUAL "optimized") 37 | math(EXPR next ${idx}+1) 38 | list(GET ${var_name_libs} ${next} lib) 39 | list(REMOVE_AT ${var_name_libs} ${next}) 40 | list(INSERT ${var_name_libs} ${next} "$<$>:${lib}>") 41 | endif() 42 | endforeach() 43 | if(size) 44 | list(REMOVE_ITEM ${var_name_libs} debug optimized general) 45 | endif() 46 | set(${var_name_libs} 47 | ${${var_name_libs}} 48 | PARENT_SCOPE) 49 | endfunction() 50 | 51 | _cleanup_libraries(PCL_LIBRARIES) 52 | 53 | # Add PCL_NO_PRECOMPILE as this resolves Eigen issues. 54 | set_target_properties( 55 | mrt_pcl::pcl 56 | PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PCL_INCLUDE_DIRS}" 57 | INTERFACE_LINK_DIRECTORIES "${PCL_LIBRARY_DIRS}" 58 | INTERFACE_LINK_LIBRARIES "${PCL_LIBRARIES}" 59 | INTERFACE_COMPILE_DEFINITIONS "PCL_NO_PRECOMPILE") 60 | 61 | cmake_policy(POP) 62 | -------------------------------------------------------------------------------- /cmake/Modules/FindMrtProj.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig REQUIRED) 2 | pkg_check_modules(proj REQUIRED proj) 3 | -------------------------------------------------------------------------------- /cmake/Modules/FindMrtQt4.cmake: -------------------------------------------------------------------------------- 1 | find_package(Qt4 REQUIRED ${MrtQt4_FIND_COMPONENTS}) 2 | message(STATUS "Qt Components: " ${MrtQt4_FIND_COMPONENTS}) 3 | include(${QT_USE_FILE}) 4 | -------------------------------------------------------------------------------- /cmake/Modules/FindMrtQt5.cmake: -------------------------------------------------------------------------------- 1 | if(NOT MrtQt5_FIND_COMPONENTS) 2 | set(_components 3 | QtCore 4 | QtDBus 5 | QtGui 6 | QtNetwork 7 | QtTest 8 | QtWidgets 9 | QtXml) 10 | else() 11 | set(_components ${MrtQt5_FIND_COMPONENTS}) 12 | endif() 13 | 14 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 15 | set(CMAKE_AUTOMOC ON) 16 | set(CMAKE_AUTOUIC ON) 17 | 18 | foreach(_component ${_components}) 19 | set(_libname Qt5${_component}) 20 | if(MrtQt5_FIND_REQUIRED) 21 | find_package(${_libname} REQUIRED) 22 | else() 23 | find_package(${_libname} QUIET) 24 | endif() 25 | 26 | if(${_libname}_FOUND) 27 | message(STATUS " Found ${_libname}") 28 | list(APPEND QT_INCLUDES ${${_libname}_INCLUDE_DIRS}) 29 | list(APPEND QT_LIBRARIES "Qt5::${_component}") 30 | endif() 31 | endforeach() 32 | -------------------------------------------------------------------------------- /cmake/Modules/FindMrtVTK.cmake: -------------------------------------------------------------------------------- 1 | # find package component 2 | if(MrtVTK_FIND_REQUIRED) 3 | find_package(VTK REQUIRED) 4 | elseif(MrtVTK_FIND_QUIETLY) 5 | find_package(VTK QUIET) 6 | else() 7 | find_package(VTK) 8 | endif() 9 | 10 | # Wrap all VTK_DEFINITIONS so that they are not used in CUDA code. This will prevent 11 | # warnings generated by nvcc. 12 | set(NEW_VTK_DEFINITION) 13 | foreach(VTK_DEFINITION ${VTK_DEFINITIONS}) 14 | list(APPEND NEW_VTK_DEFINITION "$<$>:${VTK_DEFINITION}>") 15 | endforeach() 16 | set(VTK_DEFINITIONS ${NEW_VTK_DEFINITION}) 17 | unset(NEW_VTK_DEFINITION) 18 | 19 | include(${VTK_USE_FILE}) 20 | -------------------------------------------------------------------------------- /cmake/Modules/FindPNG++.cmake: -------------------------------------------------------------------------------- 1 | # - Find the PNG++ includes 2 | # 3 | # This module searches libpng++, the library for working with PNG images. 4 | # 5 | # It defines the following variables 6 | # PNG++_INCLUDE_DIRS 7 | # PNG_FOUND, If false, do not try to use PNG. 8 | # PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8) 9 | # 10 | # Since PNG depends on the ZLib compression library, none of the above will be 11 | # defined unless ZLib can be found. 12 | 13 | #============================================================================= 14 | # Copyright 2002-2009 Kitware, Inc. 15 | # 16 | # Distributed under the OSI-approved BSD License (the "License"); 17 | # see accompanying file Copyright.txt for details. 18 | # 19 | # This software is distributed WITHOUT ANY WARRANTY; without even the 20 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 | # See the License for more information. 22 | #============================================================================= 23 | # (To distribute this file outside of CMake, substitute the full 24 | # License text for the above reference.) 25 | 26 | if(PNG_FIND_QUIETLY) 27 | set(_FIND_ZLIB_ARG QUIET) 28 | endif() 29 | find_package(ZLIB ${_FIND_ZLIB_ARG}) 30 | find_package(PNG REQUIRED) 31 | 32 | if(ZLIB_FOUND) 33 | find_path(PNG++_INCLUDE_DIR png.hpp /usr/local/include/png++ /usr/include/png++) 34 | 35 | set(PNG++_LIBRARIES ${PNG_LIBRARIES}) 36 | 37 | if(PNG++_INCLUDE_DIR) 38 | set(PNG++_INCLUDE_DIRS ${PNG++_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}) 39 | unset(PNG++_INCLUDE_DIR) 40 | endif() 41 | endif() 42 | 43 | # handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if 44 | include(FindPackageHandleStandardArgs) 45 | find_package_handle_standard_args(PNG++ REQUIRED_VARS PNG++_INCLUDE_DIRS) 46 | mark_as_advanced(PNG++_INCLUDE_DIRS) 47 | -------------------------------------------------------------------------------- /cmake/Modules/FindSDL2.cmake: -------------------------------------------------------------------------------- 1 | # From: https://trenki2.github.io/blog/2017/06/02/using-sdl2-with-cmake/ 2 | # This FindScript is used because the one provided by cmake causes the 3 | # following error: 4 | # "-L/usr/lib/x86_64-linux-gnu -lSDL2 " which has leading or trailing 5 | # whitespace. This is now an error according to policy CMP0004. 6 | 7 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 8 | # file Copyright.txt or https://cmake.org/licensing for details. 9 | 10 | #.rst: 11 | # FindSDL2 12 | # ------- 13 | # 14 | # Locate SDL2 library 15 | # 16 | # This module defines 17 | # 18 | # :: 19 | # 20 | # SDL2_LIBRARY, the name of the library to link against 21 | # SDL2_FOUND, if false, do not try to link to SDL 22 | # SDL2_INCLUDE_DIR, where to find SDL.h 23 | # SDL2_VERSION_STRING, human-readable string containing the version of SDL 24 | # 25 | # 26 | # 27 | # This module responds to the flag: 28 | # 29 | # :: 30 | # 31 | # SDL2_BUILDING_LIBRARY 32 | # If this is defined, then no SDL2_main will be linked in because 33 | # only applications need main(). 34 | # Otherwise, it is assumed you are building an application and this 35 | # module will attempt to locate and set the proper link flags 36 | # as part of the returned SDL2_LIBRARY variable. 37 | # 38 | # 39 | # 40 | # Don't forget to include SDLmain.h and SDLmain.m your project for the 41 | # OS X framework based version. (Other versions link to -lSDLmain which 42 | # this module will try to find on your behalf.) Also for OS X, this 43 | # module will automatically add the -framework Cocoa on your behalf. 44 | # 45 | # 46 | # 47 | # Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your 48 | # configuration and no SDL2_LIBRARY, it means CMake did not find your SDL 49 | # library (SDL.dll, libsdl.so, SDL.framework, etc). Set 50 | # SDL2_LIBRARY_TEMP to point to your SDL library, and configure again. 51 | # Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this 52 | # value as appropriate. These values are used to generate the final 53 | # SDL2_LIBRARY variable, but when these values are unset, SDL2_LIBRARY 54 | # does not get created. 55 | # 56 | # 57 | # 58 | # $SDLDIR is an environment variable that would correspond to the 59 | # ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02 60 | # 61 | # Modified by Eric Wing. Added code to assist with automated building 62 | # by using environmental variables and providing a more 63 | # controlled/consistent search behavior. Added new modifications to 64 | # recognize OS X frameworks and additional Unix paths (FreeBSD, etc). 65 | # Also corrected the header search path to follow "proper" SDL 66 | # guidelines. Added a search for SDLmain which is needed by some 67 | # platforms. Added a search for threads which is needed by some 68 | # platforms. Added needed compile switches for MinGW. 69 | # 70 | # On OSX, this will prefer the Framework version (if found) over others. 71 | # People will have to manually change the cache values of SDL2_LIBRARY to 72 | # override this selection or set the CMake environment 73 | # CMAKE_INCLUDE_PATH to modify the search paths. 74 | # 75 | # Note that the header path has changed from SDL/SDL.h to just SDL.h 76 | # This needed to change because "proper" SDL convention is #include 77 | # "SDL.h", not . This is done for portability reasons 78 | # because not all systems place things in SDL/ (see FreeBSD). 79 | 80 | if(NOT SDL2_DIR) 81 | set(SDL2_DIR 82 | "" 83 | CACHE PATH "SDL2 directory") 84 | endif() 85 | 86 | find_path( 87 | SDL2_INCLUDE_DIR SDL.h 88 | HINTS ENV SDLDIR ${SDL2_DIR} 89 | PATH_SUFFIXES 90 | SDL2 91 | # path suffixes to search inside ENV{SDLDIR} 92 | include/SDL2 include) 93 | 94 | if(CMAKE_SIZEOF_VOID_P EQUAL 8) 95 | set(VC_LIB_PATH_SUFFIX lib/x64) 96 | else() 97 | set(VC_LIB_PATH_SUFFIX lib/x86) 98 | endif() 99 | 100 | # SDL-1.1 is the name used by FreeBSD ports... 101 | # don't confuse it for the version number. 102 | find_library( 103 | SDL2_LIBRARY_TEMP 104 | NAMES SDL2 105 | HINTS ENV SDLDIR ${SDL2_DIR} 106 | PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}) 107 | 108 | # Hide this cache variable from the user, it's an internal implementation 109 | # detail. The documented library variable for the user is SDL2_LIBRARY 110 | # which is derived from SDL2_LIBRARY_TEMP further below. 111 | set_property(CACHE SDL2_LIBRARY_TEMP PROPERTY TYPE INTERNAL) 112 | 113 | if(NOT SDL2_BUILDING_LIBRARY) 114 | if(NOT SDL2_INCLUDE_DIR MATCHES ".framework") 115 | # Non-OS X framework versions expect you to also dynamically link to 116 | # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms 117 | # seem to provide SDLmain for compatibility even though they don't 118 | # necessarily need it. 119 | find_library( 120 | SDL2MAIN_LIBRARY 121 | NAMES SDL2main 122 | HINTS ENV SDLDIR ${SDL2_DIR} 123 | PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} 124 | PATHS /sw /opt/local /opt/csw /opt) 125 | endif() 126 | endif() 127 | 128 | # SDL may require threads on your system. 129 | # The Apple build may not need an explicit flag because one of the 130 | # frameworks may already provide it. 131 | # But for non-OSX systems, I will use the CMake Threads package. 132 | if(NOT APPLE) 133 | find_package(Threads) 134 | endif() 135 | 136 | # MinGW needs an additional link flag, -mwindows 137 | # It's total link flags should look like -lmingw32 -lSDLmain -lSDL -mwindows 138 | if(MINGW) 139 | set(MINGW32_LIBRARY 140 | mingw32 "-mwindows" 141 | CACHE STRING "link flags for MinGW") 142 | endif() 143 | 144 | if(SDL2_LIBRARY_TEMP) 145 | # For SDLmain 146 | if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY) 147 | list(FIND SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX) 148 | if(_SDL2_MAIN_INDEX EQUAL -1) 149 | set(SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARY_TEMP}) 150 | endif() 151 | unset(_SDL2_MAIN_INDEX) 152 | endif() 153 | 154 | # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa. 155 | # CMake doesn't display the -framework Cocoa string in the UI even 156 | # though it actually is there if I modify a pre-used variable. 157 | # I think it has something to do with the CACHE STRING. 158 | # So I use a temporary variable until the end so I can set the 159 | # "real" variable in one-shot. 160 | if(APPLE) 161 | set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") 162 | endif() 163 | 164 | # For threads, as mentioned Apple doesn't need this. 165 | # In fact, there seems to be a problem if I used the Threads package 166 | # and try using this line, so I'm just skipping it entirely for OS X. 167 | if(NOT APPLE) 168 | set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) 169 | endif() 170 | 171 | # For MinGW library 172 | if(MINGW) 173 | set(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP}) 174 | endif() 175 | 176 | # Set the final string here so the GUI reflects the final state. 177 | set(SDL2_LIBRARY 178 | ${SDL2_LIBRARY_TEMP} 179 | CACHE STRING "Where the SDL Library can be found") 180 | endif() 181 | 182 | if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL2_version.h") 183 | file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MAJOR_LINE 184 | REGEX "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+[0-9]+$") 185 | file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MINOR_LINE 186 | REGEX "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+[0-9]+$") 187 | file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_PATCH_LINE 188 | REGEX "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+[0-9]+$") 189 | string(REGEX REPLACE "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR 190 | "${SDL2_VERSION_MAJOR_LINE}") 191 | string(REGEX REPLACE "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR 192 | "${SDL2_VERSION_MINOR_LINE}") 193 | string(REGEX REPLACE "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH 194 | "${SDL2_VERSION_PATCH_LINE}") 195 | set(SDL2_VERSION_STRING ${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH}) 196 | unset(SDL2_VERSION_MAJOR_LINE) 197 | unset(SDL2_VERSION_MINOR_LINE) 198 | unset(SDL2_VERSION_PATCH_LINE) 199 | unset(SDL2_VERSION_MAJOR) 200 | unset(SDL2_VERSION_MINOR) 201 | unset(SDL2_VERSION_PATCH) 202 | endif() 203 | 204 | set(SDL2_LIBRARIES ${SDL2_LIBRARY}) 205 | set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR}) 206 | 207 | find_package_handle_standard_args( 208 | SDL 209 | REQUIRED_VARS SDL2_LIBRARIES SDL2_INCLUDE_DIRS 210 | VERSION_VAR SDL2_VERSION_STRING) 211 | 212 | mark_as_advanced(SDL2_LIBRARY SDL2_INCLUDE_DIR) 213 | -------------------------------------------------------------------------------- /cmake/Modules/FindSqlite3.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find Sqlite3 2 | # Once done this will define 3 | # 4 | # SQLITE3_FOUND - system has Sqlite3 5 | # SQLITE3_INCLUDE_DIRS - the Sqlite3 include directory 6 | # SQLITE3_LIBRARIES - Link these to use Sqlite3 7 | # SQLITE3_DEFINITIONS - Compiler switches required for using Sqlite3 8 | # 9 | # Copyright (c) 2008 Andreas Schneider 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 | if(SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) 17 | # in cache already 18 | set(SQLITE3_FOUND TRUE) 19 | else(SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) 20 | # use pkg-config to get the directories and then use these values 21 | # in the FIND_PATH() and FIND_LIBRARY() calls 22 | if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) 23 | include(UsePkgConfig) 24 | pkgconfig(sqlite3 _SQLITE3_INCLUDEDIR _SQLITE3_LIBDIR _SQLITE3_LDFLAGS _SQLITE3_CFLAGS) 25 | else(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) 26 | find_package(PkgConfig) 27 | if(PKG_CONFIG_FOUND) 28 | pkg_check_modules(_SQLITE3 sqlite3) 29 | endif(PKG_CONFIG_FOUND) 30 | endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) 31 | find_path( 32 | SQLITE3_INCLUDE_DIR 33 | NAMES sqlite3.h 34 | PATHS ${_SQLITE3_INCLUDEDIR} /usr/include /usr/local/include /opt/local/include /sw/include) 35 | 36 | find_library( 37 | SQLITE3_LIBRARY 38 | NAMES sqlite3 39 | PATHS ${_SQLITE3_LIBDIR} /usr/lib /usr/local/lib /opt/local/lib /sw/lib) 40 | 41 | if(SQLITE3_LIBRARY) 42 | set(SQLITE3_FOUND TRUE) 43 | endif(SQLITE3_LIBRARY) 44 | 45 | set(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR}) 46 | 47 | if(SQLITE3_FOUND) 48 | set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARIES} ${SQLITE3_LIBRARY}) 49 | endif(SQLITE3_FOUND) 50 | 51 | if(SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES) 52 | set(SQLITE3_FOUND TRUE) 53 | endif(SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES) 54 | 55 | if(SQLITE3_FOUND) 56 | if(NOT Sqlite3_FIND_QUIETLY) 57 | message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES}") 58 | endif(NOT Sqlite3_FIND_QUIETLY) 59 | else(SQLITE3_FOUND) 60 | if(Sqlite3_FIND_REQUIRED) 61 | message(FATAL_ERROR "Could not find Sqlite3") 62 | endif(Sqlite3_FIND_REQUIRED) 63 | endif(SQLITE3_FOUND) 64 | 65 | # show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view 66 | mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES) 67 | 68 | endif(SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) 69 | -------------------------------------------------------------------------------- /cmake/Modules/FindTBB.cmake: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2015 Justus Calvin 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | 23 | # 24 | # FindTBB 25 | # ------- 26 | # 27 | # Find TBB include directories and libraries. 28 | # 29 | # Usage: 30 | # 31 | # find_package(TBB [major[.minor]] [EXACT] 32 | # [QUIET] [REQUIRED] 33 | # [[COMPONENTS] [components...]] 34 | # [OPTIONAL_COMPONENTS components...]) 35 | # 36 | # where the allowed components are tbbmalloc and tbb_preview. Users may modify 37 | # the behavior of this module with the following variables: 38 | # 39 | # * TBB_ROOT_DIR - The base directory the of TBB installation. 40 | # * TBB_INCLUDE_DIR - The directory that contains the TBB headers files. 41 | # * TBB_LIBRARY - The directory that contains the TBB library files. 42 | # * TBB__LIBRARY - The path of the TBB the corresponding TBB library. 43 | # These libraries, if specified, override the 44 | # corresponding library search results, where 45 | # may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug, 46 | # tbb_preview, or tbb_preview_debug. 47 | # * TBB_USE_DEBUG_BUILD - The debug version of tbb libraries, if present, will 48 | # be used instead of the release version. 49 | # 50 | # Users may modify the behavior of this module with the following environment 51 | # variables: 52 | # 53 | # * TBB_INSTALL_DIR 54 | # * TBBROOT 55 | # * LIBRARY_PATH 56 | # 57 | # This module will set the following variables: 58 | # 59 | # * TBB_FOUND - Set to false, or undefined, if we haven’t found, or 60 | # don’t want to use TBB. 61 | # * TBB__FOUND - If False, optional part of TBB sytem is 62 | # not available. 63 | # * TBB_VERSION - The full version string 64 | # * TBB_VERSION_MAJOR - The major version 65 | # * TBB_VERSION_MINOR - The minor version 66 | # * TBB_INTERFACE_VERSION - The interface version number defined in 67 | # tbb/tbb_stddef.h. 68 | # * TBB__LIBRARY_RELEASE - The path of the TBB release version of 69 | # , where may be tbb, tbb_debug, 70 | # tbbmalloc, tbbmalloc_debug, tbb_preview, or 71 | # tbb_preview_debug. 72 | # * TBB__LIBRARY_DEGUG - The path of the TBB release version of 73 | # , where may be tbb, tbb_debug, 74 | # tbbmalloc, tbbmalloc_debug, tbb_preview, or 75 | # tbb_preview_debug. 76 | # 77 | # The following varibles should be used to build and link with TBB: 78 | # 79 | # * TBB_INCLUDE_DIRS - The include directory for TBB. 80 | # * TBB_LIBRARIES - The libraries to link against to use TBB. 81 | # * TBB_LIBRARIES_RELEASE - The release libraries to link against to use TBB. 82 | # * TBB_LIBRARIES_DEBUG - The debug libraries to link against to use TBB. 83 | # * TBB_DEFINITIONS - Definitions to use when compiling code that uses 84 | # TBB. 85 | # * TBB_DEFINITIONS_RELEASE - Definitions to use when compiling release code that 86 | # uses TBB. 87 | # * TBB_DEFINITIONS_DEBUG - Definitions to use when compiling debug code that 88 | # uses TBB. 89 | # 90 | # This module will also create the "tbb" target that may be used when building 91 | # executables and libraries. 92 | 93 | include(FindPackageHandleStandardArgs) 94 | 95 | if(NOT TBB_FOUND) 96 | 97 | ################################## 98 | # Check the build type 99 | ################################## 100 | 101 | if(NOT DEFINED TBB_USE_DEBUG_BUILD) 102 | if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug|RelWithDebInfo|RELWITHDEBINFO|relwithdebinfo)") 103 | set(TBB_BUILD_TYPE DEBUG) 104 | else() 105 | set(TBB_BUILD_TYPE RELEASE) 106 | endif() 107 | elseif(TBB_USE_DEBUG_BUILD) 108 | set(TBB_BUILD_TYPE DEBUG) 109 | else() 110 | set(TBB_BUILD_TYPE RELEASE) 111 | endif() 112 | 113 | ################################## 114 | # Set the TBB search directories 115 | ################################## 116 | 117 | # Define search paths based on user input and environment variables 118 | set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT}) 119 | 120 | # Define the search directories based on the current platform 121 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 122 | set(TBB_DEFAULT_SEARCH_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB") 123 | 124 | # Set the target architecture 125 | if(CMAKE_SIZEOF_VOID_P EQUAL 8) 126 | set(TBB_ARCHITECTURE "intel64") 127 | else() 128 | set(TBB_ARCHITECTURE "ia32") 129 | endif() 130 | 131 | # Set the TBB search library path search suffix based on the version of VC 132 | if(WINDOWS_STORE) 133 | set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11_ui") 134 | elseif(MSVC14) 135 | set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc14") 136 | elseif(MSVC12) 137 | set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc12") 138 | elseif(MSVC11) 139 | set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11") 140 | elseif(MSVC10) 141 | set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc10") 142 | endif() 143 | 144 | # Add the library path search suffix for the VC independent version of TBB 145 | list(APPEND TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc_mt") 146 | 147 | elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") 148 | # OS X 149 | set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") 150 | 151 | # TODO: Check to see which C++ library is being used by the compiler. 152 | if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0) 153 | # The default C++ library on OS X 10.9 and later is libc++ 154 | set(TBB_LIB_PATH_SUFFIX "lib/libc++" "lib") 155 | else() 156 | set(TBB_LIB_PATH_SUFFIX "lib") 157 | endif() 158 | elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") 159 | # Linux 160 | set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") 161 | 162 | # TODO: Check compiler version to see the suffix should be /gcc4.1 or 163 | # /gcc4.1. For now, assume that the compiler is more recent than 164 | # gcc 4.4.x or later. 165 | if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") 166 | set(TBB_LIB_PATH_SUFFIX "lib/intel64/gcc4.4") 167 | elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") 168 | set(TBB_LIB_PATH_SUFFIX "lib/ia32/gcc4.4") 169 | endif() 170 | endif() 171 | 172 | ################################## 173 | # Find the TBB include dir 174 | ################################## 175 | 176 | find_path( 177 | TBB_INCLUDE_DIRS tbb/tbb.h 178 | HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR} 179 | PATHS ${TBB_DEFAULT_SEARCH_DIR} 180 | PATH_SUFFIXES include) 181 | 182 | ################################## 183 | # Set version strings 184 | ################################## 185 | 186 | if(TBB_INCLUDE_DIRS) 187 | file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) 188 | string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" TBB_VERSION_MAJOR "${_tbb_version_file}") 189 | string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" TBB_VERSION_MINOR "${_tbb_version_file}") 190 | string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION 191 | "${_tbb_version_file}") 192 | set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}") 193 | endif() 194 | 195 | ################################## 196 | # Find TBB components 197 | ################################## 198 | 199 | if(TBB_VERSION VERSION_LESS 4.3) 200 | set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb) 201 | else() 202 | set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb) 203 | endif() 204 | 205 | # Find each component 206 | foreach(_comp ${TBB_SEARCH_COMPOMPONENTS}) 207 | if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};") 208 | 209 | # Search for the libraries 210 | find_library( 211 | TBB_${_comp}_LIBRARY_RELEASE ${_comp} 212 | HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} 213 | PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH 214 | PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) 215 | 216 | find_library( 217 | TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug 218 | HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} 219 | PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH 220 | PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) 221 | 222 | if(TBB_${_comp}_LIBRARY_DEBUG) 223 | list(APPEND TBB_LIBRARIES_DEBUG "${TBB_${_comp}_LIBRARY_DEBUG}") 224 | endif() 225 | if(TBB_${_comp}_LIBRARY_RELEASE) 226 | list(APPEND TBB_LIBRARIES_RELEASE "${TBB_${_comp}_LIBRARY_RELEASE}") 227 | endif() 228 | if(TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE} AND NOT TBB_${_comp}_LIBRARY) 229 | set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE}}") 230 | endif() 231 | 232 | if(TBB_${_comp}_LIBRARY AND EXISTS "${TBB_${_comp}_LIBRARY}") 233 | set(TBB_${_comp}_FOUND TRUE) 234 | else() 235 | set(TBB_${_comp}_FOUND FALSE) 236 | endif() 237 | 238 | # Mark internal variables as advanced 239 | mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE) 240 | mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG) 241 | mark_as_advanced(TBB_${_comp}_LIBRARY) 242 | 243 | endif() 244 | endforeach() 245 | 246 | ################################## 247 | # Set compile flags and libraries 248 | ################################## 249 | 250 | set(TBB_DEFINITIONS_RELEASE "") 251 | set(TBB_DEFINITIONS_DEBUG "-DTBB_USE_DEBUG=1") 252 | 253 | if(TBB_LIBRARIES_${TBB_BUILD_TYPE}) 254 | set(TBB_DEFINITIONS "${TBB_DEFINITIONS_${TBB_BUILD_TYPE}}") 255 | set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}") 256 | elseif(TBB_LIBRARIES_RELEASE) 257 | set(TBB_DEFINITIONS "${TBB_DEFINITIONS_RELEASE}") 258 | set(TBB_LIBRARIES "${TBB_LIBRARIES_RELEASE}") 259 | elseif(TBB_LIBRARIES_DEBUG) 260 | set(TBB_DEFINITIONS "${TBB_DEFINITIONS_DEBUG}") 261 | set(TBB_LIBRARIES "${TBB_LIBRARIES_DEBUG}") 262 | endif() 263 | 264 | find_package_handle_standard_args( 265 | TBB 266 | REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES 267 | HANDLE_COMPONENTS 268 | VERSION_VAR TBB_VERSION) 269 | 270 | ################################## 271 | # Create targets 272 | ################################## 273 | 274 | if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND) 275 | add_library(tbb SHARED IMPORTED) 276 | set_target_properties(tbb PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS} IMPORTED_LOCATION 277 | ${TBB_LIBRARIES}) 278 | if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG) 279 | set_target_properties( 280 | tbb 281 | PROPERTIES INTERFACE_COMPILE_DEFINITIONS 282 | "$<$,$>:TBB_USE_DEBUG=1>" 283 | IMPORTED_LOCATION_DEBUG ${TBB_LIBRARIES_DEBUG} 284 | IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_DEBUG} 285 | IMPORTED_LOCATION_RELEASE ${TBB_LIBRARIES_RELEASE} 286 | IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE}) 287 | elseif(TBB_LIBRARIES_RELEASE) 288 | set_target_properties(tbb PROPERTIES IMPORTED_LOCATION ${TBB_LIBRARIES_RELEASE}) 289 | else() 290 | set_target_properties(tbb PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS_DEBUG}" 291 | IMPORTED_LOCATION ${TBB_LIBRARIES_DEBUG}) 292 | endif() 293 | endif() 294 | 295 | mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES) 296 | 297 | unset(TBB_ARCHITECTURE) 298 | unset(TBB_BUILD_TYPE) 299 | unset(TBB_LIB_PATH_SUFFIX) 300 | unset(TBB_DEFAULT_SEARCH_DIR) 301 | 302 | endif() 303 | -------------------------------------------------------------------------------- /cmake/Modules/FindTensorflow.cmake: -------------------------------------------------------------------------------- 1 | # try to find tensorflow 2 | find_package(PkgConfig) 3 | find_path(TENSORFLOW_INCLUDE_DIR tensorflow/core/public/session.h PATH_SUFFIXES tensorflow) 4 | 5 | set(TENSORFLOW_INCLUDE_DIR ${TENSORFLOW_INCLUDE_DIR} ${TENSORFLOW_INCLUDE_DIR}/src) 6 | 7 | find_library(TENSORFLOW_CC_LIBRARY NAMES tensorflow_cc) 8 | find_library(TENSORFLOW_FRAMEWORK_LIBRARY NAMES tensorflow_framework) 9 | 10 | set(TENSORFLOW_LIBRARY ${TENSORFLOW_CC_LIBRARY}) 11 | if(TENSORFLOW_FRAMEWORK_LIBRARY) 12 | set(TENSORFLOW_LIBRARY ${TENSORFLOW_LIBRARY} ${TENSORFLOW_FRAMEWORK_LIBRARY}) 13 | endif(TENSORFLOW_FRAMEWORK_LIBRARY) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(MrtTensorflow DEFAULT_MSG TENSORFLOW_LIBRARY TENSORFLOW_INCLUDE_DIR) 17 | 18 | mark_as_advanced(TENSORFLOW_LIBRARY TENSORFLOW_INCLUDE_DIR) 19 | set(TENSORFLOW_LIBRARIES ${TENSORFLOW_LIBRARY}) 20 | set(TENSORFLOW_INCLUDE_DIRS ${TENSORFLOW_INCLUDE_DIR}) 21 | -------------------------------------------------------------------------------- /cmake/Modules/FindTesseract.cmake: -------------------------------------------------------------------------------- 1 | set(PACKAGE_HEADER_FILES tesseract/apitypes.h) 2 | set(PACKAGE_LIBRARIES tesseract) 3 | 4 | find_path(Tesseract_INCLUDE_DIR NAMES ${PACKAGE_HEADER_FILES}) 5 | find_library(Tesseract_LIBRARIES NAMES ${PACKAGE_LIBRARIES}) 6 | 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args( 9 | Tesseract 10 | FOUND_VAR Tesseract_FOUND 11 | REQUIRED_VARS Tesseract_INCLUDE_DIR Tesseract_LIBRARIES) 12 | -------------------------------------------------------------------------------- /cmake/Modules/FindTinyXML.cmake: -------------------------------------------------------------------------------- 1 | # - Find TinyXML 2 | # Find the native TinyXML includes and library 3 | # 4 | # TINYXML_FOUND - True if TinyXML found. 5 | # TINYXML_INCLUDE_DIR - where to find tinyxml.h, etc. 6 | # TINYXML_LIBRARIES - List of libraries when using TinyXML. 7 | # 8 | 9 | if(TINYXML_INCLUDE_DIR) 10 | # Already in cache, be silent 11 | set(TinyXML_FIND_QUIETLY TRUE) 12 | endif(TINYXML_INCLUDE_DIR) 13 | 14 | find_path(TINYXML_INCLUDE_DIR "tinyxml.h" PATH_SUFFIXES "tinyxml") 15 | 16 | find_library( 17 | TINYXML_LIBRARIES 18 | NAMES "tinyxml" 19 | PATH_SUFFIXES "tinyxml") 20 | 21 | # handle the QUIETLY and REQUIRED arguments and set TINYXML_FOUND to TRUE if 22 | # all listed variables are TRUE 23 | include(FindPackageHandleStandardArgs) 24 | find_package_handle_standard_args("TinyXML" DEFAULT_MSG TINYXML_INCLUDE_DIR TINYXML_LIBRARIES) 25 | 26 | mark_as_advanced(TINYXML_INCLUDE_DIR TINYXML_LIBRARIES) 27 | -------------------------------------------------------------------------------- /cmake/Modules/FindTinyXML2.cmake: -------------------------------------------------------------------------------- 1 | # Find headers and libraries 2 | find_path( 3 | TinyXML2_INCLUDE_DIR 4 | NAMES tinyxml2.h 5 | PATH_SUFFIXES "tinyxml2" ${TinyXML2_INCLUDE_PATH}) 6 | find_library( 7 | TinyXML2_LIBRARY 8 | NAMES tinyxml2 9 | PATH_SUFFIXES "tinyxml2" ${TinyXML2_LIBRARY_PATH}) 10 | 11 | mark_as_advanced(TinyXML2_INCLUDE_DIR TinyXML2_LIBRARY) 12 | 13 | # Output variables generation 14 | include(FindPackageHandleStandardArgs) 15 | find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TinyXML2_LIBRARY TinyXML2_INCLUDE_DIR) 16 | 17 | set(TinyXML2_FOUND ${TINYXML2_FOUND}) # Enforce case-correctness: Set appropriately cased variable... 18 | unset(TINYXML2_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args 19 | 20 | if(TinyXML2_FOUND) 21 | set(TinyXML2_INCLUDE_DIRS ${TinyXML2_INCLUDE_DIR}) 22 | set(TinyXML2_LIBRARIES ${TinyXML2_LIBRARY}) 23 | endif() 24 | -------------------------------------------------------------------------------- /cmake/Modules/FindZeroMQ.cmake: -------------------------------------------------------------------------------- 1 | find_path(ZMQ_INCLUDE_DIR zmq.h) 2 | find_library(ZMQ_LIBRARY NAMES zmq) 3 | 4 | set(ZMQ_LIBRARIES ${ZMQ_LIBRARY}) 5 | set(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR}) 6 | 7 | include(FindPackageHandleStandardArgs) 8 | 9 | # handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE if all listed variables are TRUE 10 | find_package_handle_standard_args(ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR) 11 | -------------------------------------------------------------------------------- /cmake/Modules/Findebus-sdk.cmake: -------------------------------------------------------------------------------- 1 | set(PACKAGE_HEADER_FILES PvBase.h) 2 | # log4cxx 3 | 4 | set(PACKAGE_LIBRARIES 5 | PvPersistence 6 | PtUtilsLib 7 | PtConvertersLib 8 | PvAppUtils 9 | PvCameraBridge 10 | EbTransportLayerLib 11 | PvGenICam 12 | PvBase 13 | PvSystem 14 | PvDevice 15 | PvVirtualDevice 16 | EbUtilsLib 17 | PvStream 18 | PvTransmitter 19 | XmlParser_gcc421_v3_0 20 | NodeMapData_gcc421_v3_0 21 | log4cpp_gcc421_v3_0 22 | Log_gcc421_v3_0 23 | MathParser_gcc421_v3_0 24 | GCBase_gcc421_v3_0 25 | GenApi_gcc421_v3_0 26 | PvSerial 27 | PvBuffer 28 | SimpleImagingLib) 29 | 30 | set(PACKAGE_PATH /opt/pleora/ebus_sdk/Ubuntu-x86_64) 31 | set(PACKAGE_PATH_GENI /opt/pleora/ebus_sdk/Ubuntu-x86_64/lib/genicam/bin/Linux64_x64) 32 | 33 | set(ebus-sdk_INCLUDE_DIR "") 34 | set(ebus-sdk_INCLUDE_DIR_VAR_NAMES "") 35 | foreach(header_file ${PACKAGE_HEADER_FILES}) 36 | find_path( 37 | ${header_file}_INCLUDE_DIR 38 | NAMES ${header_file} 39 | PATHS "${PACKAGE_PATH}/include") 40 | list(APPEND ebus-sdk_INCLUDE_DIR ${${header_file}_INCLUDE_DIR}) 41 | list(APPEND ebus-sdk_INCLUDE_DIR_VAR_NAMES ${header_file}_INCLUDE_DIR) 42 | endforeach() 43 | 44 | set(ebus-sdk_LIBRARIES "") 45 | set(ebus-sdk_LIBRARY_VAR_NAMES "") 46 | foreach(library ${PACKAGE_LIBRARIES}) 47 | find_library( 48 | ${library}_LIBRARY 49 | NAMES ${library} 50 | PATHS "${PACKAGE_PATH}/lib" "${PACKAGE_PATH_GENI}") 51 | list(APPEND ebus-sdk_LIBRARIES ${${library}_LIBRARY}) 52 | list(APPEND ebus-sdk_LIBRARY_VAR_NAMES ${library}_LIBRARY) 53 | endforeach() 54 | 55 | include(FindPackageHandleStandardArgs) 56 | find_package_handle_standard_args( 57 | ebus-sdk 58 | FOUND_VAR ebus-sdk_FOUND 59 | REQUIRED_VARS ${ebus-sdk_INCLUDE_DIR_VAR_NAMES} ${ebus-sdk_LIBRARY_VAR_NAMES}) 60 | mark_as_advanced(${ebus-sdk_INCLUDE_DIR_VAR_NAMES} ${ebus-sdk_LIBRARY_VAR_NAMES}) 61 | -------------------------------------------------------------------------------- /cmake/Modules/Findgtest.cmake: -------------------------------------------------------------------------------- 1 | if(CATKIN_ENABLE_TESTING) 2 | #just add gtest and gtest_main to link to 3 | #those files are generated during catkin test ny building gtest 4 | set(gtest_INCLUDE_DIRS "") 5 | set(gtest_LIBRARIES gtest) 6 | else() 7 | message(FATAL_ERROR "CMake script only implemented for gtest as test_depend") 8 | endif() 9 | -------------------------------------------------------------------------------- /cmake/Modules/Findnlopt.cmake: -------------------------------------------------------------------------------- 1 | # - Find NLopt 2 | # Find the native NLopt includes and library 3 | # 4 | # nlopt_INCLUDE_DIR - where to find nlopt.h, etc. 5 | # nlopt_LIBRARIES - List of libraries when using nlopt. 6 | # nlopt_FOUND - True if nlopt found. 7 | 8 | if(nlopt_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(nlopt_FIND_QUIETLY TRUE) 11 | endif(nlopt_INCLUDE_DIR) 12 | 13 | find_path(nlopt_INCLUDE_DIR nlopt.h) 14 | 15 | set(nlopt_NAMES nlopt nlopt_cxx) 16 | find_library(nlopt_LIBRARY NAMES ${nlopt_NAMES}) 17 | 18 | # handle the QUIETLY and REQUIRED arguments and set nlopt_FOUND to TRUE if 19 | # all listed variables are TRUE 20 | include(FindPackageHandleStandardArgs) 21 | find_package_handle_standard_args(nlopt DEFAULT_MSG nlopt_LIBRARY nlopt_INCLUDE_DIR) 22 | 23 | if(nlopt_FOUND) 24 | set(nlopt_LIBRARIES ${nlopt_LIBRARY}) 25 | else(nlopt_FOUND) 26 | set(nlopt_LIBRARIES) 27 | endif(nlopt_FOUND) 28 | 29 | mark_as_advanced(nlopt_LIBRARY nlopt_INCLUDE_DIR) 30 | -------------------------------------------------------------------------------- /cmake/Modules/Findpugixml.cmake: -------------------------------------------------------------------------------- 1 | find_library(PUGIXML_LIBRARIES NAMES pugixml) 2 | find_path( 3 | PUGIXML_INCLUDE_DIRS 4 | NAMES pugixml.hpp 5 | PATH_SUFFIXES pugixml) 6 | 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args(pugixml DEFAULT_MSG PUGIXML_LIBRARIES PUGIXML_INCLUDE_DIRS) 9 | -------------------------------------------------------------------------------- /cmake/Modules/GatherDeps.cmake: -------------------------------------------------------------------------------- 1 | # Detect Conan builds. In this case we don't have to do anything, conan already did the work for us. 2 | if(CONAN_PACKAGE_NAME OR EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) 3 | return() 4 | endif() 5 | 6 | #Add "watch" to package.xml. This is achieved by using configure_file. This is not necessary for catkin_make but 7 | #if eclipse is used and the make target is used directly 8 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/package.xml" 9 | "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/package.xml" COPYONLY) 10 | 11 | #gather dependencies from package.xml. The command runs in python with the ros environemnt 12 | #variable set. This is used, because the python script is calling some ros tools to distinguish 13 | #between catkin and non catkin packages. 14 | set(_gather_cmd 15 | ${MRT_CMAKE_ENV} ${PYTHON_EXECUTABLE} ${MRT_CMAKE_MODULES_ROOT_PATH}/scripts/generate_cmake_dependency_file.py 16 | "${CMAKE_CURRENT_SOURCE_DIR}/package.xml" "${MRT_CMAKE_MODULES_ROOT_PATH}/yaml/cmake.yaml" 17 | "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/auto_dep_vars.cmake") 18 | execute_process( 19 | COMMAND ${_gather_cmd} 20 | RESULT_VARIABLE _GEN_DEPS_RES_ 21 | ERROR_VARIABLE _GEN_DEPS_ERROR_) 22 | 23 | if(NOT _GEN_DEPS_RES_ EQUAL 0) 24 | message(FATAL_ERROR "Gather depenencies failed: ${_GEN_DEPS_ERROR_}") 25 | elseif(_GEN_DEPS_ERROR_) 26 | message(WARNING ${_GEN_DEPS_ERROR_}) 27 | endif() 28 | 29 | #include the generated variable cmake file 30 | include("${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/auto_dep_vars.cmake") 31 | -------------------------------------------------------------------------------- /cmake/Modules/UseMrtAutoTarget.cmake: -------------------------------------------------------------------------------- 1 | # No longer needed but kept for backwards compatibilty. 2 | -------------------------------------------------------------------------------- /cmake/Modules/UseMrtStdCompilerFlags.cmake: -------------------------------------------------------------------------------- 1 | # this file creates the target ${PROJECT_NAME}_${PROJECT_NAME}_compiler_flags and ${PROJECT_NAME}_${PROJECT_NAME}_private_compiler_flags that will be used by all targets created by mrt_cmake_modules. It also sets some basic configurations that generally make sens with cmake and ROS. 2 | 3 | # export compile commands 4 | set(CMAKE_EXPORT_COMPILE_COMMANDS YES) 5 | 6 | # default to building shared libraries. This can be changed by passing "-DBUILD_SHARED_LIBS=Off" to cmake. 7 | option(BUILD_SHARED_LIBS "Build libraries as shared libraries by default." ON) 8 | 9 | add_library(${PROJECT_NAME}_compiler_flags INTERFACE) 10 | add_library(${PROJECT_NAME}_private_compiler_flags INTERFACE) 11 | 12 | # At least c++14 is required. This can be increased in a file referenced by MRT_CMAKE_CONFIG_FILE. 13 | if(CMAKE_VERSION VERSION_LESS "3.8") 14 | target_compile_options(${PROJECT_NAME}_compiler_flags INTERFACE -std=c++14) 15 | else() 16 | target_compile_features(${PROJECT_NAME}_compiler_flags INTERFACE cxx_std_14) 17 | endif() 18 | 19 | # Add _DEBUG and _GLIBCXX_ASSERTIONS for debug configuration. This enables e.g. assertions in OpenCV and the STL. 20 | if(CMAKE_VERSION VERSION_GREATER "3.12") 21 | target_compile_definitions(${PROJECT_NAME}_private_compiler_flags INTERFACE $<$:_DEBUG> 22 | $<$:_GLIBCXX_ASSERTIONS>) 23 | endif() 24 | 25 | # Add support for std::filesystem. For GCC version <= 8 one needs to link against -lstdc++fs. 26 | target_link_libraries(${PROJECT_NAME}_compiler_flags 27 | INTERFACE $<$,$,9.0>>:stdc++fs>) 28 | 29 | # add OpenMP if present 30 | # it would be great to have this in package.xmls instead, but catkin cannot handle setting the required cmake flags for dependencies 31 | find_package(OpenMP) 32 | if(OpenMP_FOUND) 33 | if(TARGET OpenMP::OpenMP_CXX) 34 | target_link_libraries(${PROJECT_NAME}_compiler_flags INTERFACE OpenMP::OpenMP_CXX) 35 | else() 36 | target_compile_options(${PROJECT_NAME}_compiler_flags INTERFACE $<$:${OpenMP_CXX_FLAGS}> 37 | $<$:${OpenMP_C_FLAGS}>) 38 | if(CMAKE_VERSION VERSION_LESS "3.10") 39 | target_link_libraries(${PROJECT_NAME}_compiler_flags INTERFACE ${OpenMP_CXX_FLAGS}) 40 | else() 41 | target_link_libraries( 42 | ${PROJECT_NAME}_compiler_flags INTERFACE $<$:${OpenMP_CXX_FLAGS}> 43 | $<$:${OpenMP_C_FLAGS}>) 44 | endif() 45 | endif() 46 | endif() 47 | 48 | # add gcov flags 49 | set(gcc_like_cxx "$,$>") 50 | set(gcc_cxx "$,$>") 51 | set(gcc_like_c "$,$>") 52 | if(MRT_ENABLE_COVERAGE) 53 | target_compile_options(${PROJECT_NAME}_private_compiler_flags INTERFACE $<${gcc_like_cxx}:-g;--coverage> 54 | $<${gcc_like_c}:-g;--coverage>) 55 | if(CMAKE_VERSION VERSION_LESS "3.13") 56 | target_link_libraries(${PROJECT_NAME}_private_compiler_flags INTERFACE --coverage) 57 | else() 58 | target_link_options(${PROJECT_NAME}_private_compiler_flags INTERFACE $<${gcc_like_cxx}:--coverage> 59 | $<${gcc_like_c}:--coverage>) 60 | endif() 61 | endif() 62 | 63 | # Set ccache basedir if ccache is available to enable cache hits across multiple workspaces. 64 | # But still leave it to the user to activate ccache (e.g. with `export PATH=/usr/lib/ccache:$PATH` in `~/.bashrc`) 65 | find_program(CCACHE_FOUND ccache) 66 | if(CCACHE_FOUND AND CCACHE_BASEDIR) 67 | set(CMAKE_CXX_COMPILER_LAUNCHER CCACHE_BASEDIR=${CCACHE_BASEDIR}) 68 | endif() 69 | 70 | # Include config file if set. This is done last so that the target ${PROJECT_NAME}_compiler_flags can be further modified 71 | # The config file is supposed to contain system-specific configurations (basically like a cmake toolchain file) and personal preferences (e.g. warning options) 72 | if(MRT_CMAKE_CONFIG_FILE) 73 | message(STATUS "MRT CMake configuration file found: ${MRT_CMAKE_CONFIG_FILE}") 74 | include(${MRT_CMAKE_CONFIG_FILE}) 75 | elseif(DEFINED ENV{MRT_CMAKE_CONFIG_FILE}) 76 | message(STATUS "MRT CMake configuration file found: $ENV{MRT_CMAKE_CONFIG_FILE}") 77 | include($ENV{MRT_CMAKE_CONFIG_FILE}) 78 | endif() 79 | -------------------------------------------------------------------------------- /cmake/README.md: -------------------------------------------------------------------------------- 1 | # Contributing cmake find scripts 2 | 3 | Please make sure to format your `FindMyNewLibrary.cmake` files with `cmake-format` from the [cmakelang python package](https://pypi.org/project/cmakelang/), before creating merge requests. 4 | -------------------------------------------------------------------------------- /cmake/Templates/CTestCustom.cmake.in: -------------------------------------------------------------------------------- 1 | # This file configures ctest and has been generated by mrt_cmake_modules. 2 | # Don't change this file, it will be overwritten by the next cmake run. 3 | set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 0) 4 | set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 0) 5 | #set(CTEST_CUSTOM_PRE_TEST "@pre_test_cmd@") 6 | set(CTEST_CUSTOM_POST_TEST "@post_test_cmd@") 7 | -------------------------------------------------------------------------------- /cmake/Templates/__init__.py.in: -------------------------------------------------------------------------------- 1 | # Autogenerated by mrt_cmake_modules for python api 2 | 3 | from os.path import dirname 4 | from pkgutil import iter_modules 5 | 6 | # automatically import all files in this module 7 | __all__ = [name for _, name, _ in iter_modules([dirname(__file__)])] 8 | 9 | for module_name in __all__: 10 | from importlib import import_module 11 | module = import_module(__name__ + "." + module_name) 12 | if len(__all__) == 1: 13 | globals().update(module.__dict__) 14 | del module 15 | -------------------------------------------------------------------------------- /cmake/Templates/packageConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # File was automatically generated by mrt_cmake_modules 2 | # 3 | # This file exports the following variables: 4 | # @PROJECT_NAME@_LIBRARIES: Library targets that should be linked against 5 | # @PROJECT_NAME@_EXPORTED_TARGETS: As required by catkin 6 | # @PROJECT_NAME@_EXPORTS_TARGETS: To indicate this package exports targets instead of plain libraries 7 | 8 | @PACKAGE_INIT@ 9 | 10 | set(@PROJECT_NAME@_LIBRARIES @_mrt_libraries@) # things that dependend packages should link against 11 | 12 | # catkin wants this. Don't bother with it. 13 | set(@PROJECT_NAME@_EXPORTED_TARGETS) 14 | 15 | # mark this as a catkin project 16 | set(@PROJECT_NAME@_FOUND_CATKIN_PROJECT TRUE) 17 | set(@PROJECT_NAME@_EXPORTS_TARGETS TRUE) 18 | 19 | macro(_init_package_dependencies) 20 | # gets all targets that this package export_depends on and sets var to the name of these targets. 21 | # because this config file might be used recursively we have to be extra careful that variables set here do not affect each other 22 | if(TARGET @PROJECT_NAME@::auto_deps_export) 23 | return() 24 | endif() 25 | if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/auto_dep_vars.cmake") 26 | message(FATAL_ERROR "Project @PROJECT_NAME@ did not export its dependencies properly! No auto_dep file was found.") 27 | endif() 28 | # Resolve deps in the same style they were resolved when this project was built 29 | include("${CMAKE_CURRENT_LIST_DIR}/auto_dep_vars.cmake") # sets _@PROJECT_NAME@_EXPORT_PACKAGES_ 30 | 31 | set(@PROJECT_NAME@AutoDeps_PREFIX "@PROJECT_NAME@") 32 | set(@PROJECT_NAME@AutoDeps_NO_CATKIN_EXPORT TRUE) # disable variable export because catkin is not listening here 33 | if(NOT mrt_cmake_modules_FOUND) 34 | # We need the mrt_cmake_modules because they provide extra CMake Modules for finding thirdparty stuff 35 | find_package(mrt_cmake_modules REQUIRED) 36 | endif() 37 | find_package(@PROJECT_NAME@AutoDeps REQUIRED 38 | COMPONENTS ${_@PROJECT_NAME@_EXPORT_PACKAGES_} 39 | PATHS ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH 40 | ) 41 | if(NOT OpenMP_FOUND) 42 | find_package(OpenMP) # openmp is by default always a dependency 43 | endif() 44 | unset(@PROJECT_NAME@AutoDeps_PREFIX) 45 | unset(@PROJECT_NAME@AutoDeps_NO_CATKIN_EXPORT) 46 | endmacro() 47 | 48 | if(@PROJECT_NAME@_LIBRARIES) 49 | _init_package_dependencies() 50 | endif() 51 | 52 | # add the targets 53 | if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 54 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 55 | endif() 56 | 57 | # add dependencies to other things generated by this package 58 | set(@PROJECT_NAME@_targets @_mrt_targets@) 59 | if(@PROJECT_NAME@_targets AND NOT TARGET @PROJECT_NAME@::mrt_exported_targets) 60 | set(namespaced_exported_targets) 61 | foreach(t ${@PROJECT_NAME@_targets}) 62 | if(NOT TARGET ${target}) 63 | add_library(@PROJECT_NAME@::${t} INTERFACE IMPORTED) 64 | list(APPEND namespaced_exported_targets @PROJECT_NAME@::${t}) 65 | else() 66 | list(APPEND namespaced_exported_targets ${t}) 67 | endif() 68 | endforeach() 69 | add_library(@PROJECT_NAME@::mrt_exported_targets INTERFACE IMPORTED) 70 | add_dependencies(@PROJECT_NAME@::mrt_exported_targets ${namespaced_exported_targets}) 71 | list(APPEND @PROJECT_NAME@_LIBRARIES @PROJECT_NAME@::mrt_exported_targets) 72 | unset(namespaced_exported_targets) 73 | endif() 74 | 75 | set(@PROJECT_NAME@_EXTRAS_FILE @_mrt_extras_file@) 76 | if(@PROJECT_NAME@_EXTRAS_FILE) 77 | include(${CMAKE_CURRENT_LIST_DIR}/${@PROJECT_NAME@_EXTRAS_FILE}) 78 | endif() 79 | unset(@PROJECT_NAME@_EXTRAS_FILE) 80 | unset(@PROJECT_NAME@_targets) 81 | -------------------------------------------------------------------------------- /cmake/Templates/python_api_install.py.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # this file is taken and converted from a bash script from catkin to correctly install python modules 3 | import os 4 | import sys 5 | import subprocess 6 | 7 | python_interpreter = "@PYTHON_EXECUTABLE@" 8 | if not python_interpreter: 9 | python_interpreter = "python" 10 | 11 | if "DESTDIR" in os.environ: 12 | if not os.path.isabs(os.environ["DESTDIR"]): 13 | print("DESTDIR argument must be absolute...\notherwise python's distutils will bork things.") 14 | sys.exit(1) 15 | destdir_arg = ["--root={}".format(os.environ["DESTDIR"])] 16 | else: 17 | destdir_arg = [] 18 | 19 | 20 | def print_and_run(cmd, env): 21 | print(" ".join(cmd)) 22 | subprocess.check_call(cmd, env=env) 23 | 24 | os.chdir("@CMAKE_CURRENT_BINARY_DIR@") 25 | install_dir = "$DESTDIR@CMAKE_INSTALL_PREFIX@/@PYTHON_INSTALL_DIR@" 26 | print("Creating {}".format(install_dir)) 27 | try: 28 | os.makedirs(install_dir) 29 | except OSError: 30 | pass 31 | 32 | env = os.environ.copy() 33 | env["PYTHONPATH"] = "@CMAKE_INSTALL_PREFIX@/@PYTHON_INSTALL_DIR@:@CMAKE_BINARY_DIR@/@PYTHON_INSTALL_DIR@:{}".format(env.get("PYTHONPATH", "")) 34 | env["CATKIN_BINARY_DIR"] = "@CMAKE_BINARY_DIR@" 35 | setuptools_arg = "@SETUPTOOLS_ARG_EXTRA@" 36 | setuptools_arg = [setuptools_arg] if setuptools_arg else [] 37 | cmd = [python_interpreter, "@CMAKE_CURRENT_BINARY_DIR@/setup.py", "build", "--build-base", "@CMAKE_CURRENT_BINARY_DIR@", "install"] + destdir_arg + \ 38 | setuptools_arg + ["--prefix=@CMAKE_INSTALL_PREFIX@", "--install-scripts=@CMAKE_INSTALL_PREFIX@/@CATKIN_GLOBAL_BIN_DESTINATION@"] 39 | 40 | print_and_run(cmd, env) 41 | -------------------------------------------------------------------------------- /cmake/Templates/setup.py.in: -------------------------------------------------------------------------------- 1 | ## THIS FILE HAS BEEN AUTOGENERATED FOR USE WITH CATKIN AND IS NOT SUPPOSED TO BE TRACKED BY GIT! 2 | ## DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD 3 | 4 | from setuptools import setup 5 | from catkin_pkg.python_setup import generate_distutils_setup 6 | 7 | # fetch values from package.xml 8 | setup_args = generate_distutils_setup(package_xml_path='@PROJECT_SOURCE_DIR@', 9 | packages=['@PKG_PYTHON_MODULE@'], 10 | package_data={'': ['@PACKAGE_DATA@']}, 11 | package_dir={'': '@PACKAGE_DIR@'}) 12 | 13 | setup(**setup_args) 14 | -------------------------------------------------------------------------------- /cmake/Templates/test_utility.hpp.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TEST_PATH_USE_STD_FILESYSTEM 3 | 4 | #if __cplusplus >= 201703L && defined(__has_include) 5 | #if __has_include() 6 | #define TEST_PATH_USE_STD_FILESYSTEM 1 7 | #endif 8 | #endif 9 | #ifndef TEST_PATH_USE_STD_FILESYSTEM 10 | #define TEST_PATH_USE_STD_FILESYSTEM 0 11 | #endif 12 | 13 | #if TEST_PATH_USE_STD_FILESYSTEM 14 | #include 15 | #else 16 | #include 17 | #endif 18 | 19 | namespace @PROJECT_NAME@ { 20 | namespace test{ 21 | 22 | #if TEST_PATH_USE_STD_FILESYSTEM 23 | static const std::filesystem::path projectRootDir{"@PROJECT_SOURCE_DIR@"}; 24 | #else 25 | static const boost::filesystem::path projectRootDir{"@PROJECT_SOURCE_DIR@"}; 26 | #endif 27 | 28 | } // namespace test 29 | } // namespace @PROJECT_NAME@ 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /cmake/mrt_cmake_modules-extras.cmake.in: -------------------------------------------------------------------------------- 1 | # Generated from: mrt_cmake_modules/cmake/mrt_cmake_modules-extra.cmake.in 2 | if(_MRT_CMAKE_MODULES_EXTRAS_INCLUDED_) 3 | return() 4 | endif() 5 | set(_MRT_CMAKE_MODULES_EXTRAS_INCLUDED_ TRUE) 6 | 7 | # Check cmakelists version 8 | set(_MRT_RECOMMENDED_VERSION 4.0) 9 | if(MRT_PKG_VERSION AND MRT_PKG_VERSION VERSION_LESS _MRT_RECOMMENDED_VERSION ) 10 | message(WARNING "Current CMakeLists.txt version is less than the recommended version ${_MRT_RECOMMENDED_VERSION}. If you are the maintainer, please update it with\n'mrt maintenance update_cmakelists ${PROJECT_NAME}'.") 11 | endif() 12 | 13 | # Set the cmake install path 14 | if(@DEVELSPACE@) 15 | # cmake dir in develspace 16 | set(MRT_CMAKE_MODULES_ROOT_PATH "@PROJECT_SOURCE_DIR@") 17 | set(MRT_CMAKE_MODULES_CMAKE_PATH "@PROJECT_SOURCE_DIR@/cmake") 18 | else() 19 | # cmake dir in installspace 20 | set(MRT_CMAKE_MODULES_ROOT_PATH "${mrt_cmake_modules_DIR}/..") 21 | set(MRT_CMAKE_MODULES_CMAKE_PATH "${mrt_cmake_modules_DIR}") 22 | endif() 23 | 24 | list(APPEND CMAKE_MODULE_PATH "${MRT_CMAKE_MODULES_CMAKE_PATH}/Modules") 25 | set(MCM_TEMPLATE_DIR "${MRT_CMAKE_MODULES_CMAKE_PATH}/Templates") 26 | include(${MRT_CMAKE_MODULES_CMAKE_PATH}/mrt_cmake_modules-macros.cmake) 27 | -------------------------------------------------------------------------------- /doc/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: c3bf84308d83e2422afc0c82cb6cb23c 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /doc/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/ajax-loader.gif -------------------------------------------------------------------------------- /doc/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap : break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox input[type="text"] { 85 | width: 170px; 86 | } 87 | 88 | img { 89 | border: 0; 90 | max-width: 100%; 91 | } 92 | 93 | /* -- search page ----------------------------------------------------------- */ 94 | 95 | ul.search { 96 | margin: 10px 0 0 20px; 97 | padding: 0; 98 | } 99 | 100 | ul.search li { 101 | padding: 5px 0 5px 20px; 102 | background-image: url(file.png); 103 | background-repeat: no-repeat; 104 | background-position: 0 7px; 105 | } 106 | 107 | ul.search li a { 108 | font-weight: bold; 109 | } 110 | 111 | ul.search li div.context { 112 | color: #888; 113 | margin: 2px 0 0 30px; 114 | text-align: left; 115 | } 116 | 117 | ul.keywordmatches li.goodmatch a { 118 | font-weight: bold; 119 | } 120 | 121 | /* -- index page ------------------------------------------------------------ */ 122 | 123 | table.contentstable { 124 | width: 90%; 125 | margin-left: auto; 126 | margin-right: auto; 127 | } 128 | 129 | table.contentstable p.biglink { 130 | line-height: 150%; 131 | } 132 | 133 | a.biglink { 134 | font-size: 1.3em; 135 | } 136 | 137 | span.linkdescr { 138 | font-style: italic; 139 | padding-top: 5px; 140 | font-size: 90%; 141 | } 142 | 143 | /* -- general index --------------------------------------------------------- */ 144 | 145 | table.indextable { 146 | width: 100%; 147 | } 148 | 149 | table.indextable td { 150 | text-align: left; 151 | vertical-align: top; 152 | } 153 | 154 | table.indextable ul { 155 | margin-top: 0; 156 | margin-bottom: 0; 157 | list-style-type: none; 158 | } 159 | 160 | table.indextable > tbody > tr > td > ul { 161 | padding-left: 0em; 162 | } 163 | 164 | table.indextable tr.pcap { 165 | height: 10px; 166 | } 167 | 168 | table.indextable tr.cap { 169 | margin-top: 10px; 170 | background-color: #f2f2f2; 171 | } 172 | 173 | img.toggler { 174 | margin-right: 3px; 175 | margin-top: 3px; 176 | cursor: pointer; 177 | } 178 | 179 | div.modindex-jumpbox { 180 | border-top: 1px solid #ddd; 181 | border-bottom: 1px solid #ddd; 182 | margin: 1em 0 1em 0; 183 | padding: 0.4em; 184 | } 185 | 186 | div.genindex-jumpbox { 187 | border-top: 1px solid #ddd; 188 | border-bottom: 1px solid #ddd; 189 | margin: 1em 0 1em 0; 190 | padding: 0.4em; 191 | } 192 | 193 | /* -- domain module index --------------------------------------------------- */ 194 | 195 | table.modindextable td { 196 | padding: 2px; 197 | border-collapse: collapse; 198 | } 199 | 200 | /* -- general body styles --------------------------------------------------- */ 201 | 202 | div.body p, div.body dd, div.body li, div.body blockquote { 203 | -moz-hyphens: auto; 204 | -ms-hyphens: auto; 205 | -webkit-hyphens: auto; 206 | hyphens: auto; 207 | } 208 | 209 | a.headerlink { 210 | visibility: hidden; 211 | } 212 | 213 | h1:hover > a.headerlink, 214 | h2:hover > a.headerlink, 215 | h3:hover > a.headerlink, 216 | h4:hover > a.headerlink, 217 | h5:hover > a.headerlink, 218 | h6:hover > a.headerlink, 219 | dt:hover > a.headerlink, 220 | caption:hover > a.headerlink, 221 | p.caption:hover > a.headerlink, 222 | div.code-block-caption:hover > a.headerlink { 223 | visibility: visible; 224 | } 225 | 226 | div.body p.caption { 227 | text-align: inherit; 228 | } 229 | 230 | div.body td { 231 | text-align: left; 232 | } 233 | 234 | .first { 235 | margin-top: 0 !important; 236 | } 237 | 238 | p.rubric { 239 | margin-top: 30px; 240 | font-weight: bold; 241 | } 242 | 243 | img.align-left, .figure.align-left, object.align-left { 244 | clear: left; 245 | float: left; 246 | margin-right: 1em; 247 | } 248 | 249 | img.align-right, .figure.align-right, object.align-right { 250 | clear: right; 251 | float: right; 252 | margin-left: 1em; 253 | } 254 | 255 | img.align-center, .figure.align-center, object.align-center { 256 | display: block; 257 | margin-left: auto; 258 | margin-right: auto; 259 | } 260 | 261 | .align-left { 262 | text-align: left; 263 | } 264 | 265 | .align-center { 266 | text-align: center; 267 | } 268 | 269 | .align-right { 270 | text-align: right; 271 | } 272 | 273 | /* -- sidebars -------------------------------------------------------------- */ 274 | 275 | div.sidebar { 276 | margin: 0 0 0.5em 1em; 277 | border: 1px solid #ddb; 278 | padding: 7px 7px 0 7px; 279 | background-color: #ffe; 280 | width: 40%; 281 | float: right; 282 | } 283 | 284 | p.sidebar-title { 285 | font-weight: bold; 286 | } 287 | 288 | /* -- topics ---------------------------------------------------------------- */ 289 | 290 | div.topic { 291 | border: 1px solid #ccc; 292 | padding: 7px 7px 0 7px; 293 | margin: 10px 0 10px 0; 294 | } 295 | 296 | p.topic-title { 297 | font-size: 1.1em; 298 | font-weight: bold; 299 | margin-top: 10px; 300 | } 301 | 302 | /* -- admonitions ----------------------------------------------------------- */ 303 | 304 | div.admonition { 305 | margin-top: 10px; 306 | margin-bottom: 10px; 307 | padding: 7px; 308 | } 309 | 310 | div.admonition dt { 311 | font-weight: bold; 312 | } 313 | 314 | div.admonition dl { 315 | margin-bottom: 0; 316 | } 317 | 318 | p.admonition-title { 319 | margin: 0px 10px 5px 0px; 320 | font-weight: bold; 321 | } 322 | 323 | div.body p.centered { 324 | text-align: center; 325 | margin-top: 25px; 326 | } 327 | 328 | /* -- tables ---------------------------------------------------------------- */ 329 | 330 | table.docutils { 331 | border: 0; 332 | border-collapse: collapse; 333 | } 334 | 335 | table.align-center { 336 | margin-left: auto; 337 | margin-right: auto; 338 | } 339 | 340 | table caption span.caption-number { 341 | font-style: italic; 342 | } 343 | 344 | table caption span.caption-text { 345 | } 346 | 347 | table.docutils td, table.docutils th { 348 | padding: 1px 8px 1px 5px; 349 | border-top: 0; 350 | border-left: 0; 351 | border-right: 0; 352 | border-bottom: 1px solid #aaa; 353 | } 354 | 355 | table.footnote td, table.footnote th { 356 | border: 0 !important; 357 | } 358 | 359 | th { 360 | text-align: left; 361 | padding-right: 5px; 362 | } 363 | 364 | table.citation { 365 | border-left: solid 1px gray; 366 | margin-left: 1px; 367 | } 368 | 369 | table.citation td { 370 | border-bottom: none; 371 | } 372 | 373 | /* -- figures --------------------------------------------------------------- */ 374 | 375 | div.figure { 376 | margin: 0.5em; 377 | padding: 0.5em; 378 | } 379 | 380 | div.figure p.caption { 381 | padding: 0.3em; 382 | } 383 | 384 | div.figure p.caption span.caption-number { 385 | font-style: italic; 386 | } 387 | 388 | div.figure p.caption span.caption-text { 389 | } 390 | 391 | /* -- field list styles ----------------------------------------------------- */ 392 | 393 | table.field-list td, table.field-list th { 394 | border: 0 !important; 395 | } 396 | 397 | .field-list ul { 398 | margin: 0; 399 | padding-left: 1em; 400 | } 401 | 402 | .field-list p { 403 | margin: 0; 404 | } 405 | 406 | .field-name { 407 | -moz-hyphens: manual; 408 | -ms-hyphens: manual; 409 | -webkit-hyphens: manual; 410 | hyphens: manual; 411 | } 412 | 413 | /* -- other body styles ----------------------------------------------------- */ 414 | 415 | ol.arabic { 416 | list-style: decimal; 417 | } 418 | 419 | ol.loweralpha { 420 | list-style: lower-alpha; 421 | } 422 | 423 | ol.upperalpha { 424 | list-style: upper-alpha; 425 | } 426 | 427 | ol.lowerroman { 428 | list-style: lower-roman; 429 | } 430 | 431 | ol.upperroman { 432 | list-style: upper-roman; 433 | } 434 | 435 | dl { 436 | margin-bottom: 15px; 437 | } 438 | 439 | dd p { 440 | margin-top: 0px; 441 | } 442 | 443 | dd ul, dd table { 444 | margin-bottom: 10px; 445 | } 446 | 447 | dd { 448 | margin-top: 3px; 449 | margin-bottom: 10px; 450 | margin-left: 30px; 451 | } 452 | 453 | dt:target, span.highlighted { 454 | background-color: #fbe54e; 455 | } 456 | 457 | rect.highlighted { 458 | fill: #fbe54e; 459 | } 460 | 461 | dl.glossary dt { 462 | font-weight: bold; 463 | font-size: 1.1em; 464 | } 465 | 466 | .optional { 467 | font-size: 1.3em; 468 | } 469 | 470 | .sig-paren { 471 | font-size: larger; 472 | } 473 | 474 | .versionmodified { 475 | font-style: italic; 476 | } 477 | 478 | .system-message { 479 | background-color: #fda; 480 | padding: 5px; 481 | border: 3px solid red; 482 | } 483 | 484 | .footnote:target { 485 | background-color: #ffa; 486 | } 487 | 488 | .line-block { 489 | display: block; 490 | margin-top: 1em; 491 | margin-bottom: 1em; 492 | } 493 | 494 | .line-block .line-block { 495 | margin-top: 0; 496 | margin-bottom: 0; 497 | margin-left: 1.5em; 498 | } 499 | 500 | .guilabel, .menuselection { 501 | font-family: sans-serif; 502 | } 503 | 504 | .accelerator { 505 | text-decoration: underline; 506 | } 507 | 508 | .classifier { 509 | font-style: oblique; 510 | } 511 | 512 | abbr, acronym { 513 | border-bottom: dotted 1px; 514 | cursor: help; 515 | } 516 | 517 | /* -- code displays --------------------------------------------------------- */ 518 | 519 | pre { 520 | overflow: auto; 521 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 522 | } 523 | 524 | span.pre { 525 | -moz-hyphens: none; 526 | -ms-hyphens: none; 527 | -webkit-hyphens: none; 528 | hyphens: none; 529 | } 530 | 531 | td.linenos pre { 532 | padding: 5px 0px; 533 | border: 0; 534 | background-color: transparent; 535 | color: #aaa; 536 | } 537 | 538 | table.highlighttable { 539 | margin-left: 0.5em; 540 | } 541 | 542 | table.highlighttable td { 543 | padding: 0 0.5em 0 0.5em; 544 | } 545 | 546 | div.code-block-caption { 547 | padding: 2px 5px; 548 | font-size: small; 549 | } 550 | 551 | div.code-block-caption code { 552 | background-color: transparent; 553 | } 554 | 555 | div.code-block-caption + div > div.highlight > pre { 556 | margin-top: 0; 557 | } 558 | 559 | div.code-block-caption span.caption-number { 560 | padding: 0.1em 0.3em; 561 | font-style: italic; 562 | } 563 | 564 | div.code-block-caption span.caption-text { 565 | } 566 | 567 | div.literal-block-wrapper { 568 | padding: 1em 1em 0; 569 | } 570 | 571 | div.literal-block-wrapper div.highlight { 572 | margin: 0; 573 | } 574 | 575 | code.descname { 576 | background-color: transparent; 577 | font-weight: bold; 578 | font-size: 1.2em; 579 | } 580 | 581 | code.descclassname { 582 | background-color: transparent; 583 | } 584 | 585 | code.xref, a code { 586 | background-color: transparent; 587 | font-weight: bold; 588 | } 589 | 590 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 591 | background-color: transparent; 592 | } 593 | 594 | .viewcode-link { 595 | float: right; 596 | } 597 | 598 | .viewcode-back { 599 | float: right; 600 | font-family: sans-serif; 601 | } 602 | 603 | div.viewcode-block:target { 604 | margin: -1px -10px; 605 | padding: 0 10px; 606 | } 607 | 608 | /* -- math display ---------------------------------------------------------- */ 609 | 610 | img.math { 611 | vertical-align: middle; 612 | } 613 | 614 | div.body div.math p { 615 | text-align: center; 616 | } 617 | 618 | span.eqno { 619 | float: right; 620 | } 621 | 622 | span.eqno a.headerlink { 623 | position: relative; 624 | left: 0px; 625 | z-index: 1; 626 | } 627 | 628 | div.math:hover a.headerlink { 629 | visibility: visible; 630 | } 631 | 632 | /* -- printout stylesheet --------------------------------------------------- */ 633 | 634 | @media print { 635 | div.document, 636 | div.documentwrapper, 637 | div.bodywrapper { 638 | margin: 0 !important; 639 | width: 100%; 640 | } 641 | 642 | div.sphinxsidebar, 643 | div.related, 644 | div.footer, 645 | #top-link { 646 | display: none; 647 | } 648 | } -------------------------------------------------------------------------------- /doc/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/comment-bright.png -------------------------------------------------------------------------------- /doc/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/comment-close.png -------------------------------------------------------------------------------- /doc/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/comment.png -------------------------------------------------------------------------------- /doc/_static/contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/contents.png -------------------------------------------------------------------------------- /doc/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span; 75 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 76 | if (isInSVG) { 77 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 78 | } else { 79 | span = document.createElement("span"); 80 | span.className = className; 81 | } 82 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 83 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 84 | document.createTextNode(val.substr(pos + text.length)), 85 | node.nextSibling)); 86 | node.nodeValue = val.substr(0, pos); 87 | if (isInSVG) { 88 | var bbox = span.getBBox(); 89 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 90 | rect.x.baseVal.value = bbox.x; 91 | rect.y.baseVal.value = bbox.y; 92 | rect.width.baseVal.value = bbox.width; 93 | rect.height.baseVal.value = bbox.height; 94 | rect.setAttribute('class', className); 95 | var parentOfText = node.parentNode.parentNode; 96 | addItems.push({ 97 | "parent": node.parentNode, 98 | "target": rect}); 99 | } 100 | } 101 | } 102 | else if (!jQuery(node).is("button, select, textarea")) { 103 | jQuery.each(node.childNodes, function() { 104 | highlight(this, addItems); 105 | }); 106 | } 107 | } 108 | var addItems = []; 109 | var result = this.each(function() { 110 | highlight(this, addItems); 111 | }); 112 | for (var i = 0; i < addItems.length; ++i) { 113 | jQuery(addItems[i].parent).before(addItems[i].target); 114 | } 115 | return result; 116 | }; 117 | 118 | /* 119 | * backward compatibility for jQuery.browser 120 | * This will be supported until firefox bug is fixed. 121 | */ 122 | if (!jQuery.browser) { 123 | jQuery.uaMatch = function(ua) { 124 | ua = ua.toLowerCase(); 125 | 126 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 127 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 128 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 129 | /(msie) ([\w.]+)/.exec(ua) || 130 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 131 | []; 132 | 133 | return { 134 | browser: match[ 1 ] || "", 135 | version: match[ 2 ] || "0" 136 | }; 137 | }; 138 | jQuery.browser = {}; 139 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 140 | } 141 | 142 | /** 143 | * Small JavaScript module for the documentation. 144 | */ 145 | var Documentation = { 146 | 147 | init : function() { 148 | this.fixFirefoxAnchorBug(); 149 | this.highlightSearchWords(); 150 | this.initIndexTable(); 151 | 152 | }, 153 | 154 | /** 155 | * i18n support 156 | */ 157 | TRANSLATIONS : {}, 158 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 159 | LOCALE : 'unknown', 160 | 161 | // gettext and ngettext don't access this so that the functions 162 | // can safely bound to a different name (_ = Documentation.gettext) 163 | gettext : function(string) { 164 | var translated = Documentation.TRANSLATIONS[string]; 165 | if (typeof translated === 'undefined') 166 | return string; 167 | return (typeof translated === 'string') ? translated : translated[0]; 168 | }, 169 | 170 | ngettext : function(singular, plural, n) { 171 | var translated = Documentation.TRANSLATIONS[singular]; 172 | if (typeof translated === 'undefined') 173 | return (n == 1) ? singular : plural; 174 | return translated[Documentation.PLURALEXPR(n)]; 175 | }, 176 | 177 | addTranslations : function(catalog) { 178 | for (var key in catalog.messages) 179 | this.TRANSLATIONS[key] = catalog.messages[key]; 180 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 181 | this.LOCALE = catalog.locale; 182 | }, 183 | 184 | /** 185 | * add context elements like header anchor links 186 | */ 187 | addContextElements : function() { 188 | $('div[id] > :header:first').each(function() { 189 | $('\u00B6'). 190 | attr('href', '#' + this.id). 191 | attr('title', _('Permalink to this headline')). 192 | appendTo(this); 193 | }); 194 | $('dt[id]').each(function() { 195 | $('\u00B6'). 196 | attr('href', '#' + this.id). 197 | attr('title', _('Permalink to this definition')). 198 | appendTo(this); 199 | }); 200 | }, 201 | 202 | /** 203 | * workaround a firefox stupidity 204 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 205 | */ 206 | fixFirefoxAnchorBug : function() { 207 | if (document.location.hash && $.browser.mozilla) 208 | window.setTimeout(function() { 209 | document.location.href += ''; 210 | }, 10); 211 | }, 212 | 213 | /** 214 | * highlight the search words provided in the url in the text 215 | */ 216 | highlightSearchWords : function() { 217 | var params = $.getQueryParameters(); 218 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 219 | if (terms.length) { 220 | var body = $('div.body'); 221 | if (!body.length) { 222 | body = $('body'); 223 | } 224 | window.setTimeout(function() { 225 | $.each(terms, function() { 226 | body.highlightText(this.toLowerCase(), 'highlighted'); 227 | }); 228 | }, 10); 229 | $('') 231 | .appendTo($('#searchbox')); 232 | } 233 | }, 234 | 235 | /** 236 | * init the domain index toggle buttons 237 | */ 238 | initIndexTable : function() { 239 | var togglers = $('img.toggler').click(function() { 240 | var src = $(this).attr('src'); 241 | var idnum = $(this).attr('id').substr(7); 242 | $('tr.cg-' + idnum).toggle(); 243 | if (src.substr(-9) === 'minus.png') 244 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 245 | else 246 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 247 | }).css('display', ''); 248 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 249 | togglers.click(); 250 | } 251 | }, 252 | 253 | /** 254 | * helper function to hide the search marks again 255 | */ 256 | hideSearchWords : function() { 257 | $('#searchbox .highlight-link').fadeOut(300); 258 | $('span.highlighted').removeClass('highlighted'); 259 | }, 260 | 261 | /** 262 | * make the url absolute 263 | */ 264 | makeURL : function(relativeURL) { 265 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 266 | }, 267 | 268 | /** 269 | * get the current relative url 270 | */ 271 | getCurrentURL : function() { 272 | var path = document.location.pathname; 273 | var parts = path.split(/\//); 274 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 275 | if (this === '..') 276 | parts.pop(); 277 | }); 278 | var url = parts.join('/'); 279 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 280 | }, 281 | 282 | initOnKeyListeners: function() { 283 | $(document).keyup(function(event) { 284 | var activeElementType = document.activeElement.tagName; 285 | // don't navigate when in search box or textarea 286 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 287 | switch (event.keyCode) { 288 | case 37: // left 289 | var prevHref = $('link[rel="prev"]').prop('href'); 290 | if (prevHref) { 291 | window.location.href = prevHref; 292 | return false; 293 | } 294 | case 39: // right 295 | var nextHref = $('link[rel="next"]').prop('href'); 296 | if (nextHref) { 297 | window.location.href = nextHref; 298 | return false; 299 | } 300 | } 301 | } 302 | }); 303 | } 304 | }; 305 | 306 | // quick alias for translations 307 | _ = Documentation.gettext; 308 | 309 | $(document).ready(function() { 310 | Documentation.init(); 311 | }); -------------------------------------------------------------------------------- /doc/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '1.0.0', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt', 9 | NAVIGATION_WITH_KEYS: false, 10 | }; -------------------------------------------------------------------------------- /doc/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/down-pressed.png -------------------------------------------------------------------------------- /doc/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/down.png -------------------------------------------------------------------------------- /doc/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/file.png -------------------------------------------------------------------------------- /doc/_static/graphviz.css: -------------------------------------------------------------------------------- 1 | /* 2 | * graphviz.css 3 | * ~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- graphviz extension. 6 | * 7 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | img.graphviz { 13 | border: 0; 14 | max-width: 100%; 15 | } 16 | 17 | object.graphviz { 18 | max-width: 100%; 19 | } 20 | -------------------------------------------------------------------------------- /doc/_static/language_data.js: -------------------------------------------------------------------------------- 1 | /* 2 | * language_data.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * This script contains the language-specific data used by searchtools.js, 6 | * namely the list of stopwords, stemmer, scorer and splitter. 7 | * 8 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 9 | * :license: BSD, see LICENSE for details. 10 | * 11 | */ 12 | 13 | var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; 14 | 15 | 16 | /* Non-minified version JS is _stemmer.js if file is provided */ 17 | /** 18 | * Porter Stemmer 19 | */ 20 | var Stemmer = function() { 21 | 22 | var step2list = { 23 | ational: 'ate', 24 | tional: 'tion', 25 | enci: 'ence', 26 | anci: 'ance', 27 | izer: 'ize', 28 | bli: 'ble', 29 | alli: 'al', 30 | entli: 'ent', 31 | eli: 'e', 32 | ousli: 'ous', 33 | ization: 'ize', 34 | ation: 'ate', 35 | ator: 'ate', 36 | alism: 'al', 37 | iveness: 'ive', 38 | fulness: 'ful', 39 | ousness: 'ous', 40 | aliti: 'al', 41 | iviti: 'ive', 42 | biliti: 'ble', 43 | logi: 'log' 44 | }; 45 | 46 | var step3list = { 47 | icate: 'ic', 48 | ative: '', 49 | alize: 'al', 50 | iciti: 'ic', 51 | ical: 'ic', 52 | ful: '', 53 | ness: '' 54 | }; 55 | 56 | var c = "[^aeiou]"; // consonant 57 | var v = "[aeiouy]"; // vowel 58 | var C = c + "[^aeiouy]*"; // consonant sequence 59 | var V = v + "[aeiou]*"; // vowel sequence 60 | 61 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 62 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 63 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 64 | var s_v = "^(" + C + ")?" + v; // vowel in stem 65 | 66 | this.stemWord = function (w) { 67 | var stem; 68 | var suffix; 69 | var firstch; 70 | var origword = w; 71 | 72 | if (w.length < 3) 73 | return w; 74 | 75 | var re; 76 | var re2; 77 | var re3; 78 | var re4; 79 | 80 | firstch = w.substr(0,1); 81 | if (firstch == "y") 82 | w = firstch.toUpperCase() + w.substr(1); 83 | 84 | // Step 1a 85 | re = /^(.+?)(ss|i)es$/; 86 | re2 = /^(.+?)([^s])s$/; 87 | 88 | if (re.test(w)) 89 | w = w.replace(re,"$1$2"); 90 | else if (re2.test(w)) 91 | w = w.replace(re2,"$1$2"); 92 | 93 | // Step 1b 94 | re = /^(.+?)eed$/; 95 | re2 = /^(.+?)(ed|ing)$/; 96 | if (re.test(w)) { 97 | var fp = re.exec(w); 98 | re = new RegExp(mgr0); 99 | if (re.test(fp[1])) { 100 | re = /.$/; 101 | w = w.replace(re,""); 102 | } 103 | } 104 | else if (re2.test(w)) { 105 | var fp = re2.exec(w); 106 | stem = fp[1]; 107 | re2 = new RegExp(s_v); 108 | if (re2.test(stem)) { 109 | w = stem; 110 | re2 = /(at|bl|iz)$/; 111 | re3 = new RegExp("([^aeiouylsz])\\1$"); 112 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 113 | if (re2.test(w)) 114 | w = w + "e"; 115 | else if (re3.test(w)) { 116 | re = /.$/; 117 | w = w.replace(re,""); 118 | } 119 | else if (re4.test(w)) 120 | w = w + "e"; 121 | } 122 | } 123 | 124 | // Step 1c 125 | re = /^(.+?)y$/; 126 | if (re.test(w)) { 127 | var fp = re.exec(w); 128 | stem = fp[1]; 129 | re = new RegExp(s_v); 130 | if (re.test(stem)) 131 | w = stem + "i"; 132 | } 133 | 134 | // Step 2 135 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 136 | if (re.test(w)) { 137 | var fp = re.exec(w); 138 | stem = fp[1]; 139 | suffix = fp[2]; 140 | re = new RegExp(mgr0); 141 | if (re.test(stem)) 142 | w = stem + step2list[suffix]; 143 | } 144 | 145 | // Step 3 146 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 147 | if (re.test(w)) { 148 | var fp = re.exec(w); 149 | stem = fp[1]; 150 | suffix = fp[2]; 151 | re = new RegExp(mgr0); 152 | if (re.test(stem)) 153 | w = stem + step3list[suffix]; 154 | } 155 | 156 | // Step 4 157 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 158 | re2 = /^(.+?)(s|t)(ion)$/; 159 | if (re.test(w)) { 160 | var fp = re.exec(w); 161 | stem = fp[1]; 162 | re = new RegExp(mgr1); 163 | if (re.test(stem)) 164 | w = stem; 165 | } 166 | else if (re2.test(w)) { 167 | var fp = re2.exec(w); 168 | stem = fp[1] + fp[2]; 169 | re2 = new RegExp(mgr1); 170 | if (re2.test(stem)) 171 | w = stem; 172 | } 173 | 174 | // Step 5 175 | re = /^(.+?)e$/; 176 | if (re.test(w)) { 177 | var fp = re.exec(w); 178 | stem = fp[1]; 179 | re = new RegExp(mgr1); 180 | re2 = new RegExp(meq1); 181 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 182 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 183 | w = stem; 184 | } 185 | re = /ll$/; 186 | re2 = new RegExp(mgr1); 187 | if (re.test(w) && re2.test(w)) { 188 | re = /.$/; 189 | w = w.replace(re,""); 190 | } 191 | 192 | // and turn initial Y back to y 193 | if (firstch == "y") 194 | w = firstch.toLowerCase() + w.substr(1); 195 | return w; 196 | } 197 | } 198 | 199 | 200 | 201 | 202 | 203 | var splitChars = (function() { 204 | var result = {}; 205 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 206 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 207 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 208 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 209 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 210 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 211 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 212 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 213 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 214 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 215 | var i, j, start, end; 216 | for (i = 0; i < singles.length; i++) { 217 | result[singles[i]] = true; 218 | } 219 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 220 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 221 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 222 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 223 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 224 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 225 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 226 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 227 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 228 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 229 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 230 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 231 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 232 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 233 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 234 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 235 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 236 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 237 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 238 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 239 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 240 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 241 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 242 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 243 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 244 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 245 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 246 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 247 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 248 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 249 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 250 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 251 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 252 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 253 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 254 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 255 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 256 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 257 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 258 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 259 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 260 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 261 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 262 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 263 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 264 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 265 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 266 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 267 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 268 | for (i = 0; i < ranges.length; i++) { 269 | start = ranges[i][0]; 270 | end = ranges[i][1]; 271 | for (j = start; j <= end; j++) { 272 | result[j] = true; 273 | } 274 | } 275 | return result; 276 | })(); 277 | 278 | function splitQuery(query) { 279 | var result = []; 280 | var start = -1; 281 | for (var i = 0; i < query.length; i++) { 282 | if (splitChars[query.charCodeAt(i)]) { 283 | if (start !== -1) { 284 | result.push(query.slice(start, i)); 285 | start = -1; 286 | } 287 | } else if (start === -1) { 288 | start = i; 289 | } 290 | } 291 | if (start !== -1) { 292 | result.push(query.slice(start)); 293 | } 294 | return result; 295 | } 296 | 297 | 298 | -------------------------------------------------------------------------------- /doc/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/minus.png -------------------------------------------------------------------------------- /doc/_static/mrt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/mrt.png -------------------------------------------------------------------------------- /doc/_static/navigation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/navigation.png -------------------------------------------------------------------------------- /doc/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/plus.png -------------------------------------------------------------------------------- /doc/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .c { color: #800000; } /* Comment */ 2 | .err { border: 1px solid #FF0000 } /* Error */ 3 | .k { color: #0000aa; } /* Keyword */ 4 | .o { color: #707070 } /* Operator */ 5 | .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 6 | .cp { color: #007020 } /* Comment.Preproc */ 7 | .c1 { color: #408090; font-style: italic } /* Comment.Single */ 8 | .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 9 | .gd { color: #A00000 } /* Generic.Deleted */ 10 | .ge { font-style: italic } /* Generic.Emph */ 11 | .gr { color: #FF0000 } /* Generic.Error */ 12 | .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 13 | .gi { color: #00A000 } /* Generic.Inserted */ 14 | .go { color: #303030 } /* Generic.Output */ 15 | .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 16 | .gs { font-weight: bold } /* Generic.Strong */ 17 | .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 18 | .gt { color: #0040D0 } /* Generic.Traceback */ 19 | .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 20 | .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 21 | .kp { color: #007020 } /* Keyword.Pseudo */ 22 | .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 23 | .kt { color: #602000 } /* Keyword.Type */ 24 | .m { color: #208050 } /* Literal.Number */ 25 | .s { color: #4070a0 } /* Literal.String */ 26 | .na { color: #4070a0 } /* Name.Attribute */ 27 | .nb { color: #007020 } /* Name.Builtin */ 28 | .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 29 | .no { color: #60add5 } /* Name.Constant */ 30 | .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 31 | .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 32 | .ne { color: #007020 } /* Name.Exception */ 33 | .nf { color: #06287e } /* Name.Function */ 34 | .nl { color: #002070; font-weight: bold } /* Name.Label */ 35 | .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 36 | .nt { color: #062873; font-weight: bold } /* Name.Tag */ 37 | .nv { color: #bb60d5 } /* Name.Variable */ 38 | .ow { color: #007020; font-weight: bold } /* Operator.Word */ 39 | .w { color: #bbbbbb } /* Text.Whitespace */ 40 | .mf { color: #208050 } /* Literal.Number.Float */ 41 | .mh { color: #208050 } /* Literal.Number.Hex */ 42 | .mi { color: #208050 } /* Literal.Number.Integer */ 43 | .mo { color: #208050 } /* Literal.Number.Oct */ 44 | .sb { color: #4070a0 } /* Literal.String.Backtick */ 45 | .sc { color: #4070a0 } /* Literal.String.Char */ 46 | .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 47 | .s2 { color: #4070a0 } /* Literal.String.Double */ 48 | .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 49 | .sh { color: #4070a0 } /* Literal.String.Heredoc */ 50 | .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 51 | .sx { color: #c65d09 } /* Literal.String.Other */ 52 | .sr { color: #235388 } /* Literal.String.Regex */ 53 | .s1 { color: #4070a0 } /* Literal.String.Single */ 54 | .ss { color: #517918 } /* Literal.String.Symbol */ 55 | .bp { color: #007020 } /* Name.Builtin.Pseudo */ 56 | .vc { color: #bb60d5 } /* Name.Variable.Class */ 57 | .vg { color: #bb60d5 } /* Name.Variable.Global */ 58 | .vi { color: #bb60d5 } /* Name.Variable.Instance */ 59 | .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /doc/_static/sphinxdoc.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Sphinx stylesheet -- sphinxdoc theme 3 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | * 5 | * Originally created by Armin Ronacher for Werkzeug, adapted by Georg Brandl. 6 | */ 7 | 8 | @import url("basic.css"); 9 | 10 | /* -- page layout ----------------------------------------------------------- */ 11 | 12 | body { 13 | font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 14 | 'Verdana', sans-serif; 15 | font-size: 12px; 16 | /* letter-spacing: -0.01em;*/ 17 | line-height: 140%; 18 | text-align: center; 19 | background-color: #3f4f70; 20 | /* background-color:#dddddd;*/ 21 | color: black; 22 | padding: 0; 23 | margin: 0; 24 | /* border: 1px solid #dddddd;*/ 25 | /* margin: 15px;*/ 26 | /* margin: 0px 5px 0px 80px;*/ 27 | /* min-width: 740px;*/ 28 | } 29 | 30 | div.documentwrapper { 31 | float: none; 32 | } 33 | 34 | div.document { 35 | background-color: white; 36 | text-align: left; 37 | background-image: url(contents.png); 38 | background-repeat: repeat-x; 39 | } 40 | 41 | div.bodywrapper { 42 | margin: 0 240px 0 0; 43 | border-right: 1px solid #ccc; 44 | } 45 | 46 | div.body { 47 | margin: 0; 48 | padding: 0.5em 20px 20px 20px; 49 | } 50 | 51 | div.related { 52 | font-size: 1em; 53 | background-color: #3f4f70; 54 | color: white; 55 | } 56 | 57 | div.related ul { 58 | height: 2em; 59 | border-top: 1px solid #ddd; 60 | border-bottom: 1px solid #ddd; 61 | background-color: #3f4f70; 62 | color: white; 63 | } 64 | 65 | div.related ul li { 66 | margin: 0; 67 | padding: 0; 68 | height: 2em; 69 | float: left; 70 | } 71 | 72 | div.related ul li.right { 73 | float: right; 74 | margin-right: 5px; 75 | } 76 | 77 | div.related ul li a { 78 | margin: 0; 79 | padding: 0 5px 0 5px; 80 | line-height: 1.75em; 81 | color: white; 82 | } 83 | 84 | div.related ul li a:hover { 85 | text-decoration: underline; 86 | } 87 | 88 | div.sphinxsidebarwrapper { 89 | padding: 0; 90 | } 91 | 92 | div.sphinxsidebar { 93 | margin: 0; 94 | padding: 0.5em 15px 15px 0; 95 | width: 210px; 96 | float: right; 97 | font-size: 1em; 98 | text-align: left; 99 | } 100 | 101 | div.sphinxsidebar h3, div.sphinxsidebar h4 { 102 | margin: 1em 0 0.5em 0; 103 | font-size: 1em; 104 | padding: 0.1em 0 0.1em 0.5em; 105 | color: white; 106 | border: 1px solid #5f7f9f; 107 | background-color: #3f4f70; 108 | } 109 | 110 | div.sphinxsidebar h3 a { 111 | color: white; 112 | } 113 | 114 | div.sphinxsidebar ul { 115 | padding-left: 1.5em; 116 | margin-top: 7px; 117 | padding: 0; 118 | line-height: 130%; 119 | } 120 | 121 | div.sphinxsidebar ul ul { 122 | margin-left: 20px; 123 | } 124 | 125 | div.footer { 126 | background-color: #3f4f70; 127 | color: #eeeeee; 128 | padding: 3px 8px 3px 0; 129 | clear: both; 130 | font-size: 0.8em; 131 | text-align: right; 132 | } 133 | 134 | div.footer a { 135 | color: #999999; 136 | text-decoration: underline; 137 | } 138 | 139 | /* -- body styles ----------------------------------------------------------- */ 140 | 141 | p { 142 | margin: 0.8em 0 0.5em 0; 143 | } 144 | 145 | a { 146 | color: #3f5570; 147 | text-decoration: none; 148 | } 149 | 150 | a:hover { 151 | text-decoration: underline; 152 | } 153 | a:visited { 154 | color: #935b78; 155 | } 156 | 157 | div.body a { 158 | text-decoration: underline; 159 | } 160 | 161 | h1 { 162 | margin: 0; 163 | padding: 0.7em 0 0.3em 0; 164 | font-size: 1.5em; 165 | } 166 | 167 | h2 { 168 | margin: 1.3em 0 0.2em 0; 169 | font-size: 1.35em; 170 | padding: 0; 171 | } 172 | 173 | h3 { 174 | margin: 1em 0 -0.3em 0; 175 | font-size: 1.2em; 176 | } 177 | 178 | div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a { 179 | color: black!important; 180 | } 181 | 182 | h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor { 183 | display: none; 184 | margin: 0 0 0 0.3em; 185 | padding: 0 0.2em 0 0.2em; 186 | color: #aaa!important; 187 | } 188 | 189 | h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, 190 | h5:hover a.anchor, h6:hover a.anchor { 191 | display: inline; 192 | } 193 | 194 | h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, 195 | h5 a.anchor:hover, h6 a.anchor:hover { 196 | color: #777; 197 | background-color: #eee; 198 | } 199 | 200 | a.headerlink { 201 | color: #c60f0f!important; 202 | font-size: 1em; 203 | margin-left: 6px; 204 | padding: 0 4px 0 4px; 205 | text-decoration: none!important; 206 | } 207 | 208 | a.headerlink:hover { 209 | background-color: #ccc; 210 | color: white!important; 211 | } 212 | 213 | cite, code, tt { 214 | font-family: 'Consolas', 'Deja Vu Sans Mono', 215 | 'Bitstream Vera Sans Mono', monospace; 216 | font-size: 0.95em; 217 | letter-spacing: 0.01em; 218 | } 219 | 220 | 221 | tt { 222 | color: #222; 223 | font-size: 12px; 224 | } 225 | 226 | tt.descname, tt.descclassname, tt.xref { 227 | border: 0; 228 | } 229 | 230 | hr { 231 | border: 1px solid #abc; 232 | margin: 2em; 233 | } 234 | 235 | a tt { 236 | border: 0; 237 | color: #CA7900; 238 | } 239 | 240 | a tt:hover { 241 | color: #2491CF; 242 | } 243 | 244 | pre { 245 | font-family: 'Consolas', 'Deja Vu Sans Mono', 246 | 'Bitstream Vera Sans Mono', monospace; 247 | font-size: 12px; 248 | letter-spacing: 0.015; 249 | padding: 0.8em; 250 | /* border: 1px solid #e0e0e0;*/ 251 | background-color: #eeeeef; 252 | border-left: 2px solid red; 253 | } 254 | 255 | pre a { 256 | color: inherit; 257 | text-decoration: underline; 258 | } 259 | 260 | td.linenos pre { 261 | padding: 0.5em 0; 262 | } 263 | 264 | div.quotebar { 265 | background-color: #f8f8f8; 266 | max-width: 250px; 267 | float: right; 268 | padding: 2px 7px; 269 | border: 1px solid #ccc; 270 | } 271 | 272 | div.topic { 273 | background-color: #f8f8f8; 274 | } 275 | 276 | table.docutils { 277 | /* border-collapse: collapse;*/ 278 | border: 1px solid #9fafb0; 279 | background-color: #eeeeee; 280 | /* margin: 0 -0.5em 0 -0.5em; */ 281 | } 282 | 283 | table td, table th { 284 | /*padding: 0.2em 0.5em 0.2em 0.5em; */ 285 | } 286 | 287 | div.admonition, div.warning { 288 | font-size: 0.9em; 289 | margin: 1em 0 1em 0; 290 | border: 1px solid #5f7f9f; 291 | background-color: #f7f7f7; 292 | padding: 0; 293 | } 294 | 295 | div.admonition p, div.warning p { 296 | margin: 0.5em 1em 0.5em 1em; 297 | padding: 0; 298 | } 299 | 300 | div.admonition pre, div.warning pre { 301 | margin: 0.4em 1em 0.4em 1em; 302 | } 303 | 304 | div.admonition p.admonition-title, 305 | div.warning p.admonition-title { 306 | margin: 0; 307 | padding: 0.1em 0 0.1em 0.5em; 308 | color: white; 309 | border-bottom: 1px solid #5f7f9f; 310 | font-weight: bold; 311 | background-color: #3f4f70; 312 | } 313 | 314 | div.admonition-todo p.first { 315 | background-color: #e22; 316 | } 317 | 318 | div.warning { 319 | border: 1px solid #940000; 320 | } 321 | 322 | div.warning p.admonition-title { 323 | background-color: #CF0000; 324 | border-bottom-color: #940000; 325 | } 326 | 327 | div.attention p.admonition-title { 328 | background-color: #CFCF00; 329 | border-color: #CFCF00; 330 | color: #000000; 331 | } 332 | 333 | div.admonition ul, div.admonition ol, 334 | div.warning ul, div.warning ol { 335 | margin: 0.1em 0.5em 0.5em 3em; 336 | padding: 0; 337 | } 338 | 339 | div.versioninfo { 340 | margin: 1em 0 0 0; 341 | border: 1px solid #ccc; 342 | background-color: #DDEAF0; 343 | padding: 8px; 344 | line-height: 1.3em; 345 | font-size: 0.9em; 346 | } 347 | 348 | li .toctree-l1 > a { 349 | text-decoration: plain; 350 | } 351 | -------------------------------------------------------------------------------- /doc/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/up-pressed.png -------------------------------------------------------------------------------- /doc/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/_static/up.png -------------------------------------------------------------------------------- /doc/generate_doc/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | 15 | .PHONY: help clean html latex 16 | 17 | html: cmakeapi 18 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) .. 19 | @echo 20 | @echo "Build finished. The HTML pages are in .." 21 | 22 | latex: cmakeapi 23 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) latex 24 | cd latex && make 25 | cp latex/api.pdf .. 26 | @echo 27 | @echo "Build finished. The pdf pages are in .." 28 | 29 | help: 30 | @echo "Please use \`make ' where is one of" 31 | @echo " html to make standalone HTML files" 32 | 33 | clean: 34 | -rm generated_cmake_api.rst 35 | -rm -rf build 36 | -rm -rf latex 37 | 38 | cmakeapi: 39 | ./generate_cmake_rst.py -o generated_cmake_api.rst ../../cmake 40 | 41 | 42 | -------------------------------------------------------------------------------- /doc/generate_doc/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # robuild documentation build configuration file, created by 4 | # sphinx-quickstart on Mon May 11 08:53:19 2009. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | import catkin_sphinx 14 | import os 15 | import sys 16 | import subprocess 17 | from xml.etree.ElementTree import ElementTree 18 | 19 | # -- General configuration ----------------------------------------------------- 20 | 21 | # Add any Sphinx extension module names here, as strings. They can be extensions 22 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 23 | extensions = ['sphinx.ext.ifconfig', 'sphinx.ext.todo', 'sphinx.ext.graphviz', 24 | 'sphinx.ext.intersphinx', 25 | 'catkin_sphinx.ShLexer', 'catkin_sphinx.cmake', 26 | 'sphinx.ext.autodoc', 'sphinx.ext.viewcode'] 27 | todo_include_todos = True 28 | 29 | # Add any paths that contain templates here, relative to this directory. 30 | templates_path = ['_templates'] 31 | 32 | # The suffix of source filenames. 33 | source_suffix = '.rst' 34 | 35 | # The encoding of source files. 36 | #source_encoding = 'utf-8' 37 | 38 | show_sphinx = False 39 | 40 | # The master toctree document. 41 | master_doc = 'generated_cmake_api' 42 | 43 | # General information about the project. 44 | project = u'mrt_cmake_modules' 45 | gitcmd = 'git log -n1 --pretty=format:%cD'.split() 46 | 47 | lastmod = subprocess.Popen(gitcmd, stdout=subprocess.PIPE).communicate()[0] 48 | dochash = subprocess.Popen('git log -n1 --pretty=format:%H'.split(), 49 | stdout=subprocess.PIPE).communicate()[0] 50 | 51 | print "dochash=", dochash 52 | copyright = u'MRT -- ' + ' Version ' + dochash + ", " + ' '.join(lastmod.split(' ')[:4]) 53 | 54 | # The version info for the project you're documenting, acts as replacement for 55 | # |version| and |release|, also used in various other places throughout the 56 | # built documents. 57 | try: 58 | root = ElementTree(None, os.path.join('..', '..', 'package.xml')) 59 | version = root.findtext('version') 60 | except Exception as e: 61 | raise RuntimeError('Could not extract version from package.xml:\n%s' % e) 62 | 63 | # The full version, including alpha/beta/rc tags. 64 | release = version 65 | 66 | # The language for content autogenerated by Sphinx. Refer to documentation 67 | # for a list of supported languages. 68 | #language = None 69 | 70 | # There are two options for replacing |today|: either, you set today to some 71 | # non-false value, then it is used: 72 | #today = '' 73 | # Else, today_fmt is used as the format for a strftime call. 74 | #today_fmt = '%B %d, %Y' 75 | 76 | # List of documents that shouldn't be included in the build. 77 | #unused_docs = [] 78 | 79 | # List of patterns, relative to source directory, that match files and 80 | # directories to ignore when looking for source files. 81 | exclude_patterns = [] 82 | 83 | # The reST default role (used for this markup: `text`) to use for all documents. 84 | #default_role = None 85 | 86 | # If true, '()' will be appended to :func: etc. cross-reference text. 87 | #add_function_parentheses = True 88 | 89 | # If true, the current module name will be prepended to all description 90 | # unit titles (such as .. function::). 91 | #add_module_names = True 92 | 93 | # If true, sectionauthor and moduleauthor directives will be shown in the 94 | # output. They are ignored by default. 95 | show_authors = True 96 | 97 | # The name of the Pygments (syntax highlighting) style to use. 98 | pygments_style = 'sphinx' 99 | 100 | # A list of ignored prefixes for module index sorting. 101 | #modindex_common_prefix = [] 102 | 103 | 104 | # -- Options for HTML output --------------------------------------------------- 105 | 106 | # Add any paths that contain custom themes here, relative to this directory. 107 | html_theme_path = [os.path.join(os.path.dirname(catkin_sphinx.__file__), 108 | 'theme')] 109 | 110 | # The theme to use for HTML and HTML Help pages. Major themes that come with 111 | # Sphinx are currently 'default' and 'sphinxdoc'. 112 | html_theme = 'ros-theme' 113 | 114 | # Theme options are theme-specific and customize the look and feel of a theme 115 | # further. For a list of options available for each theme, see the 116 | # documentation. 117 | # html_theme_options = { 'rightsidebar' : 'true' } 118 | 119 | # The name for this set of Sphinx documents. If None, it defaults to 120 | # " v documentation". 121 | #html_title = 'catkin' 122 | 123 | # A shorter title for the navigation bar. Default is the same as html_title. 124 | #html_short_title = None 125 | 126 | # The name of an image file (relative to this directory) to place at the top 127 | # of the sidebar. 128 | html_logo = 'mrt.png' 129 | 130 | # The name of an image file (within the static path) to use as favicon of the 131 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 132 | # pixels large. 133 | #html_favicon = None 134 | 135 | # Add any paths that contain custom static files (such as style sheets) here, 136 | # relative to this directory. They are copied after the builtin static files, 137 | # so a file named "default.css" will overwrite the builtin "default.css". 138 | ##html_static_path = ['_static'] 139 | 140 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 141 | # using the given strftime format. 142 | # 143 | # tds: We don't use this, we use the git timestamp 144 | # 145 | # html_last_updated_fmt = '%b %d, %Y' 146 | 147 | # If true, SmartyPants will be used to convert quotes and dashes to 148 | # typographically correct entities. 149 | #html_use_smartypants = True 150 | 151 | # Custom sidebar templates, maps document names to template names. 152 | #html_sidebars = {} 153 | 154 | # Additional templates that should be rendered to pages, maps page names to 155 | # template names. 156 | #html_additional_pages = {} 157 | 158 | # If false, no module index is generated. 159 | #html_use_modindex = True 160 | 161 | # If false, no index is generated. 162 | #html_use_index = True 163 | 164 | # If true, the index is split into individual pages for each letter. 165 | #html_split_index = False 166 | 167 | # If true, links to the reST sources are added to the pages. 168 | #html_show_sourcelink = True 169 | 170 | # If true, an OpenSearch description file will be output, and all pages will 171 | # contain a tag referring to it. The value of this option must be the 172 | # base URL from which the finished HTML is served. 173 | #html_use_opensearch = '' 174 | 175 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). 176 | #html_file_suffix = '' 177 | 178 | # Output file base name for HTML help builder. 179 | htmlhelp_basename = 'catkin-cmakedoc' 180 | 181 | 182 | # -- Options for LaTeX output -------------------------------------------------- 183 | 184 | # The paper size ('letter' or 'a4'). 185 | #latex_paper_size = 'letter' 186 | 187 | # The font size ('10pt', '11pt' or '12pt'). 188 | #latex_font_size = '10pt' 189 | 190 | # Grouping the document tree into LaTeX files. List of tuples 191 | # (source start file, target name, title, author, documentclass [howto/manual]). 192 | latex_documents = [ 193 | ('generated_cmake_api', 'api.tex', ur'CMAKE API', 194 | ur'Fabian Poggenhans', 'manual'), 195 | ] 196 | 197 | # The name of an image file (relative to this directory) to place at the top of 198 | # the title page. 199 | #latex_logo = None 200 | 201 | # For "manual" documents, if this is true, then toplevel headings are parts, 202 | # not chapters. 203 | #latex_use_parts = False 204 | 205 | # Additional stuff for the LaTeX preamble. 206 | #latex_preamble = '' 207 | 208 | # Documents to append as an appendix to all manuals. 209 | #latex_appendices = [] 210 | 211 | # If false, no module index is generated. 212 | #latex_use_modindex = True 213 | 214 | intersphinx_mapping = { 215 | 'genmsg': ('http://docs.ros.org/indigo/api/genmsg/html', None), 216 | 'vcstools': ('http://docs.ros.org/independent/api/vcstools/html', None), 217 | 'rosinstall': ('http://docs.ros.org/independent/api/rosinstall/html', None), 218 | 'rospkg': ('http://docs.ros.org/independent/api/rospkg/html', None), 219 | 'rosdep': ('http://docs.ros.org/independent/api/rosdep/html', None), 220 | } 221 | 222 | 223 | rst_epilog = """ 224 | 225 | 226 | """ 227 | -------------------------------------------------------------------------------- /doc/generate_doc/generate_cmake_rst.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Software License Agreement (BSD License) 4 | # 5 | # Copyright (c) 2012, Willow Garage, Inc. 6 | # All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions 10 | # are met: 11 | # 12 | # * Redistributions of source code must retain the above copyright 13 | # notice, this list of conditions and the following disclaimer. 14 | # * Redistributions in binary form must reproduce the above 15 | # copyright notice, this list of conditions and the following 16 | # disclaimer in the documentation and/or other materials provided 17 | # with the distribution. 18 | # * Neither the name of Willow Garage, Inc. nor the names of its 19 | # contributors may be used to endorse or promote products derived 20 | # from this software without specific prior written permission. 21 | # 22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | # POSSIBILITY OF SUCH DAMAGE. 34 | 35 | from __future__ import print_function 36 | import argparse 37 | import os 38 | import re 39 | import sys 40 | 41 | '''Simple superficial API doc generator for .cmake files''' 42 | 43 | 44 | def crawl_for_cmake(path): 45 | ''' 46 | Crawls over path, looking for files named *.cmake, 47 | returns tuple of full and relative path. 48 | ''' 49 | cmake_files = [] 50 | for (parentdir, _, files) in os.walk(path): 51 | for filename in files: 52 | if not filename.endswith('.cmake') or filename.startswith("Find"): 53 | continue 54 | fullpath = os.path.join(parentdir, filename) 55 | relpath = os.path.relpath(fullpath, path) 56 | cmake_files.append((fullpath, relpath)) 57 | return cmake_files 58 | 59 | 60 | def generate_rst(files): 61 | ''' 62 | Each of the CMake files is traversed line by line, looking for 63 | lines like function(...) or macro(...). For each of these, 64 | multiple lines of reStructured text are added documenting the 65 | function. 66 | ''' 67 | public = {} 68 | documented = {} 69 | undocumented = {} 70 | for (fullpath, relpath) in files: 71 | last_block = [] 72 | last_block_public = False 73 | with open(fullpath, 'r') as f: 74 | lines = f.readlines() 75 | for line in lines: 76 | if line.startswith('#'): 77 | line = line.lstrip('#') 78 | if line.strip() == '@public': 79 | last_block_public = True 80 | else: 81 | last_block.append(line.rstrip('\n')) 82 | else: 83 | declaration = re.match(r'[a-zA-Z]+\([a-zA-Z_ ]+\)', line) 84 | if declaration is None: 85 | last_block = [] 86 | last_block_public = False 87 | else: 88 | tokens = line.split('(') 89 | dec_type = tokens[0].strip() 90 | dec_args = tokens[1].strip().rstrip(')').split(' ') 91 | 92 | if dec_type == 'function' or dec_type == 'macro': 93 | rst = [] 94 | # directives defined in catkin-sphinx 95 | dec_line = '.. _`%s_ref`:\n\n`%s`\n%s\n\n.. cmake:macro:: %s(%s)' % ( 96 | dec_args[0], dec_args[0], '-' * (len(dec_args[0]) + 2), dec_args[0], ', '.join(dec_args[1:])) 97 | rst.append(dec_line) 98 | rst.append('') 99 | rst.append(' *[%s defined in %s]*' % (dec_type, relpath)) 100 | if last_block: 101 | rst.append('') 102 | rst.extend(last_block) 103 | 104 | if dec_args[0] in documented or dec_args[0] in undocumented: 105 | raise RuntimeError('Function/macro with same name "%s" exists multiple times' % dec_args[0]) 106 | if last_block_public: 107 | public[dec_args[0]] = rst 108 | elif last_block: 109 | documented[dec_args[0]] = rst 110 | else: 111 | undocumented[dec_args[0]] = rst 112 | 113 | last_block = [] 114 | last_block_public = False 115 | 116 | rst = ['Extracted CMake API reference', 117 | '============================='] 118 | rst.append('This page was auto-generated from cmake source files using %s\n' % os.path.basename(__file__)) 119 | rst.append('.. ' + '!' * 70) 120 | rst.append('.. !!!!!! Auto-generated file, do not modify') 121 | rst.append('.. ' + '!' * 70) 122 | rst.append('') 123 | rst.append('.. contents::') 124 | rst.append('') 125 | rst.append('') 126 | rst.append('Public CMake functions / macros') 127 | rst.append('-------------------------------') 128 | rst.append('') 129 | for name in sorted(public.keys()): 130 | rst.append(' * :cmake:macro:`%s`' % name) 131 | for name in sorted(public.keys()): 132 | rst.append('') 133 | rst.extend(public[name]) 134 | 135 | rst.append('') 136 | rst.append('Non-public CMake functions / macros') 137 | rst.append('-----------------------------------') 138 | rst.append('') 139 | for name in sorted(documented.keys()): 140 | rst.append(' * :cmake:macro:`%s`' % name) 141 | for name in sorted(documented.keys()): 142 | rst.append('') 143 | rst.extend(documented[name]) 144 | 145 | rst.append('') 146 | rst.append('Not documented CMake functions / macros') 147 | rst.append('---------------------------------------') 148 | for name in sorted(undocumented.keys()): 149 | rst.append('') 150 | rst.extend(undocumented[name]) 151 | 152 | return rst 153 | 154 | 155 | if __name__ == '__main__': 156 | parser = argparse.ArgumentParser( 157 | description='Crawls a path for .cmake files and extract documentation of functions and macros into reStructured text.') 158 | parser.add_argument('path', nargs='?', default='.', help='The path to be crawled') 159 | parser.add_argument('-o', '--output', help='The name of the generated rst file') 160 | args = parser.parse_args() 161 | 162 | cmake_files = crawl_for_cmake(args.path) 163 | lines = generate_rst(cmake_files) 164 | if args.output: 165 | with open(args.output, 'w') as f: 166 | f.write('\n'.join(lines)) 167 | else: 168 | for line in lines: 169 | print(line) 170 | sys.exit(0) 171 | -------------------------------------------------------------------------------- /doc/generate_doc/mrt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/generate_doc/mrt.png -------------------------------------------------------------------------------- /doc/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | Index — mrt_cmake_modules 1.0.3 documentation 10 | 11 | 12 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 38 | 58 | 59 |
60 |
61 |
62 |
63 | 64 | 65 |

Index

66 | 67 |
68 | _ 69 | | C 70 | | G 71 | | M 72 | 73 |
74 |

_

75 | 76 | 84 | 92 |
93 | 94 |

C

95 | 96 | 100 | 106 |
107 | 108 |

G

109 | 110 | 116 | 122 |
123 | 124 |

M

125 | 126 | 150 | 176 |
177 | 178 | 179 | 180 |
181 |
182 |
183 |
184 |
185 | 194 | 198 | 199 | -------------------------------------------------------------------------------- /doc/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KIT-MRT/mrt_cmake_modules/46c80964ae675bcd8db1754381376b7e35f03527/doc/objects.inv -------------------------------------------------------------------------------- /doc/search.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | Search — mrt_cmake_modules 1.0.3 documentation 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 45 | 52 | 53 |
54 |
55 |
56 |
57 | 58 |

Search

59 |
60 | 61 |

62 | Please activate JavaScript to enable the search 63 | functionality. 64 |

65 |
66 |

67 | From here you can search these documents. Enter your search 68 | words into the box below and click "search". Note that the search 69 | function will automatically search for all of the words. Pages 70 | containing fewer words won't appear in the result list. 71 |

72 |
73 | 74 | 75 | 76 |
77 | 78 |
79 | 80 |
81 | 82 |
83 |
84 |
85 |
86 |
87 | 96 | 100 | 101 | -------------------------------------------------------------------------------- /doc/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({docnames:["generated_cmake_api"],envversion:52,filenames:["generated_cmake_api.rst"],objects:{"":{_mrt_add_nosetests_impl:[0,0,1,""],_mrt_create_executable_gtest:[0,0,1,""],_mrt_export_package:[0,0,1,""],_mrt_get_python_destination:[0,0,1,""],_mrt_run_test:[0,0,1,""],_setup_coverage_info:[0,0,1,""],catkin_install_python:[0,0,1,""],catkin_package:[0,0,1,""],catkin_package_xml:[0,0,1,""],generate_ros_interface_files:[0,0,1,""],generate_ros_parameter_files:[0,0,1,""],glob_folders:[0,0,1,""],glob_ros_files:[0,0,1,""],mrt_add_action_files:[0,0,1,""],mrt_add_executable:[0,0,1,""],mrt_add_gtest:[0,0,1,""],mrt_add_library:[0,0,1,""],mrt_add_links:[0,0,1,""],mrt_add_message_files:[0,0,1,""],mrt_add_node_and_nodelet:[0,0,1,""],mrt_add_nodelet:[0,0,1,""],mrt_add_nosetests:[0,0,1,""],mrt_add_python_api:[0,0,1,""],mrt_add_ros_tests:[0,0,1,""],mrt_add_rostest:[0,0,1,""],mrt_add_rostest_gtest:[0,0,1,""],mrt_add_service_files:[0,0,1,""],mrt_add_tests:[0,0,1,""],mrt_add_to_ide:[0,0,1,""],mrt_glob_files:[0,0,1,""],mrt_glob_files_recurse:[0,0,1,""],mrt_glob_folders:[0,0,1,""],mrt_init_testing:[0,0,1,""],mrt_install:[0,0,1,""],mrt_parse_package_xml:[0,0,1,""],mrt_python_module_setup:[0,0,1,""]}},objnames:{"0":["cmake","macro","CMake macro"]},objtypes:{"0":"cmake:macro"},terms:{"export":0,"import":0,"new":0,"return":0,"true":0,But:0,IDEs:0,The:0,Use:0,Will:0,__init__:0,_depend:0,_node:0,_nodelet:0,absolut:0,access:0,action:0,actual:0,add:0,add_action_fil:0,add_message_fil:0,add_service_fil:0,added:0,addit:0,after:0,afterward:0,against:0,alia:0,all:0,allow:0,also:0,alwai:0,analysi:0,ani:0,anoth:0,append:0,argument:0,assum:0,auto:0,autodep:0,autogener:0,automat:0,avoid:0,backward:0,base:0,basenam:0,becom:0,befor:0,boost:0,boost_python_modul:0,bugtrack:0,build:0,build_export:0,call:0,can:0,cannot:0,catkin:0,catkin_add_nosetest:0,catkin_download_test_data:0,catkinmockforconan:0,choos:0,code:0,comil:0,command:0,commit:0,compabl:0,compil:0,configur:0,conflict:0,contain:0,correspond:0,coverag:0,cpp:0,cpp_file:0,creat:0,ctest:0,cuda:0,currect:0,cwd:0,declar:0,defin:0,depend:0,deprec:0,determin:0,devel:0,develspac:0,dir:0,directori:0,directory_list:0,due:0,each:0,elsewher:0,enabl:0,end:0,ensur:0,entri:0,etc:0,everi:0,exampl:0,example_packag:0,excecutable_nam:0,exec:0,execnam:0,execut:0,exist:0,explicitli:0,export_lib:0,exportpackag:0,extension_nam:0,extern:0,extra:0,fail:0,file:0,first:0,flag:0,folder:0,folder_nam:0,form:0,found:0,from:0,garbag:0,gener:0,generate_cmake_rst:0,get:0,glob:0,gtest:0,hardcod:0,have:0,header:0,here:0,hpp:0,identifi:0,ides:0,ignor:0,impos:0,includ:0,indentifi:0,indic:0,info:0,inform:0,instal:0,installspac:0,instead:0,interfac:0,intern:0,its:0,known:0,launch:0,launch_fil:0,launchfil:0,lib:0,libexample_packag:0,libnam:0,librar:0,librari:0,link:0,list:0,local:0,locat:0,longer:0,look:0,made:0,main:0,maintain:0,make:0,mandatori:0,mark:0,mechan:0,mess:0,messag:0,modul:0,modulenam:0,most:0,mrt:0,mrt_:0,mrt_add_:0,mrt_cmake_modul:0,mrt_enable_covarag:0,mrt_no_fail_on_test:0,mrttest:0,must:0,my_target:0,myclass2:0,myclass:0,mytest:0,name:0,necessari:0,need:0,node:0,nodelet:0,nodelet_plugin:0,nodeletnam:0,nosetest:0,onc:0,one:0,onli:0,other:0,output:0,output_var:0,overriden:0,packag:0,package_format:0,package_nam:0,page:0,paramet:0,pars:0,pass:0,path:0,per:0,perform:0,pkt_cmake_dir:0,place:0,present:0,privat:0,program:0,project:0,project_nam:0,project_source_dir:0,project_space_dir:0,projectrootdir:0,python:0,python_api:0,python_api_module_nam:0,recurs:0,recursivli:0,regener:0,rel:0,relev:0,remov:0,replac:0,repositori:0,requir:0,restrict:0,result:0,result_xml_path:0,root:0,rosinterface_handl:0,rosparam:0,rostest:0,run:0,run_test:0,same:0,sanit:0,script:0,search:0,search_directori:0,separ:0,seper:0,servic:0,set:0,setup:0,should:0,silent:0,similar:0,simpli:0,sourc:0,specifi:0,src:0,string:0,sub:0,subfold:0,submodul:0,sure:0,target:0,target_nam:0,targetnam:0,test:0,test_data:0,test_util:0,thei:0,them:0,therefor:0,thi:0,thu:0,time:0,treat:0,type:0,under:0,unittest:0,unless:0,upon:0,url_:0,use:0,used:0,using:0,usual:0,variabl:0,varnam:0,version:0,view:0,visibl:0,wai:0,websit:0,when:0,where:0,within:0,without:0,working_dir:0,wrap:0,xml:0,you:0,your:0},titles:["Extracted CMake API reference"],titleterms:{"function":0,"public":0,Not:0,_mrt_add_nosetests_impl:0,_mrt_create_executable_gtest:0,_mrt_export_packag:0,_mrt_get_python_destin:0,_mrt_run_test:0,_setup_coverage_info:0,api:0,catkin_install_python:0,catkin_packag:0,catkin_package_xml:0,cmake:0,content:0,document:0,extract:0,generate_ros_interface_fil:0,generate_ros_parameter_fil:0,glob_fold:0,glob_ros_fil:0,macro:0,mrt_add_action_fil:0,mrt_add_execut:0,mrt_add_gtest:0,mrt_add_librari:0,mrt_add_link:0,mrt_add_message_fil:0,mrt_add_node_and_nodelet:0,mrt_add_nodelet:0,mrt_add_nosetest:0,mrt_add_python_api:0,mrt_add_ros_test:0,mrt_add_rostest:0,mrt_add_rostest_gtest:0,mrt_add_service_fil:0,mrt_add_test:0,mrt_add_to_id:0,mrt_glob_fil:0,mrt_glob_files_recurs:0,mrt_glob_fold:0,mrt_init_test:0,mrt_instal:0,mrt_parse_package_xml:0,mrt_python_module_setup:0,non:0,refer:0}}) -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | mrt_cmake_modules 3 | 1.0.11 4 | CMake Functions and Modules for automating CMake 5 | 6 | BSD 7 | Kevin Rösch 8 | Fabian Poggenhans 9 | Fabian Poggenhans 10 | Johannes Beck 11 | https://github.com/KIT-MRT/mrt_cmake_modules.git 12 | http://wiki.ros.org/mrt_cmake_modules 13 | http://wiki.ros.org/mrt_cmake_modules/issues 14 | 15 | catkin 16 | ament_cmake_core 17 | gtest_vendor 18 | 19 | ros_environment 20 | ros_environment 21 | lcov 22 | python-catkin-pkg-modules 23 | python3-catkin-pkg-modules 24 | python-yaml 25 | python3-yaml 26 | python-rospkg 27 | python3-rospkg 28 | python-setuptools 29 | python3-setuptools 30 | 31 | 32 | python-catkin-pkg-modules 33 | python3-catkin-pkg-modules 34 | python-yaml 35 | python3-yaml 36 | python-rospkg 37 | python3-rospkg 38 | python-setuptools 39 | python3-setuptools 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /rosdoc.yaml: -------------------------------------------------------------------------------- 1 | - builder: sphinx 2 | sphinx_root_dir: doc/generate_doc 3 | -------------------------------------------------------------------------------- /scripts/eval_coverage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This Python file uses the following encoding: utf-8 3 | from __future__ import print_function 4 | import subprocess 5 | import sys 6 | import argparse 7 | import shutil 8 | import os 9 | import re 10 | 11 | 12 | def sync_gcno_files(path, build_dir): 13 | # sync the gcno files into this folder 14 | copied_something = False 15 | for root, dirs, files in os.walk(path): 16 | for file in files: 17 | # we remove the mocs file that is auto generated because there is no .gcno file generated and I don't know why 18 | if file.startswith("mocs_compilation"): 19 | os.remove(os.path.join(root,file)) 20 | continue 21 | if file.endswith(".gcda"): 22 | file_gcno = file[:len(file) - 4] + "gcno" 23 | gcda_file = os.path.join(root, file_gcno)[len(path):] 24 | if not os.path.exists(gcda_file): 25 | raise Exception("No gcno file found matching {} (expected {})".format(file, gcda_file)) 26 | shutil.copy(gcda_file, os.path.join(root, file_gcno)) 27 | copied_something = True 28 | return copied_something 29 | 30 | 31 | def print_coverage(output, coverage_dir, to_stderr): 32 | regex = re.search(r"\((?P\d*) of (?P\d*) lines\)", output) 33 | lines = int(regex.group("lines")) if regex else 0 34 | total = int(regex.group("total")) if regex else 0 35 | # search for python coverage 36 | for file in os.listdir(coverage_dir): 37 | if file.endswith("coverage.xml"): 38 | from xml.dom import minidom 39 | cov_xml = minidom.parse(os.path.join(coverage_dir, file)) 40 | coverage = cov_xml.getElementsByTagName("coverage")[0] 41 | lines += int(coverage.attributes["lines-covered"].value) 42 | total += int(coverage.attributes["lines-valid"].value) 43 | percent = float(lines) / total if total else 1 44 | file = sys.stderr if to_stderr else sys.stdout 45 | print("\n\033[1mTotal test coverage: {:.2%}\033[0m ({} of {} lines)".format(percent, lines, total), file=file) 46 | 47 | 48 | def is_empty(tracefile): 49 | # lcov only tells us a tracefile is empty when it is too late. 50 | # This function tries to do the check efficently before we pass all tracefiles to lcov. 51 | with open(tracefile) as f: 52 | for line in f: 53 | if line.startswith("DA") or line.startswith("FN"): 54 | return False 55 | return True 56 | 57 | 58 | def build_coverage(args): 59 | if not args.coverage_dir: 60 | return 0 61 | lcov_baseline = os.path.join(args.coverage_dir, "baseline.lcov") 62 | # check with --summary that the tracefile has valid records 63 | if not os.path.exists(lcov_baseline) or is_empty(lcov_baseline): 64 | print("No C++ coverage files found.") 65 | return 0 66 | 67 | # evaluate individual coverage 68 | lcovs = [lcov_baseline] 69 | for folder in os.listdir(args.coverage_dir): 70 | path = os.path.join(args.coverage_dir, folder) 71 | lcov_file = path + ".lcov" 72 | has_coverage = sync_gcno_files(path, args.build_dir) 73 | if not has_coverage: 74 | continue 75 | cmd = ["lcov", "-d", path, "-c", "-o", lcov_file, "-t", folder.replace("-", "_"), "-q"] 76 | fail = subprocess.call(cmd) 77 | if not fail and not is_empty(lcov_file): 78 | lcovs.append(lcov_file) 79 | 80 | # build full coverage (including files outside project) 81 | lcov_full = os.path.join(args.coverage_dir, "full_coverage.lcov") 82 | add_args = [] 83 | for lcov in lcovs: 84 | add_args += ("-a", lcov) 85 | cmd = ["lcov", "-o", lcov_full, "-q"] + add_args 86 | fail = subprocess.call(cmd) 87 | if fail: 88 | print("No C++ coverage was generated") 89 | print_coverage("", args.coverage_dir, args.coverage_stderr) 90 | return 0 91 | 92 | # strip coverage of files outside project 93 | lcov_project = os.path.join(args.coverage_dir, "project_coverage.lcov") 94 | cmd = ["lcov", "-o", lcov_project, "--extract", lcov_full, args.project_dir + "/*", "-q"] 95 | fail = subprocess.call(cmd) 96 | if fail or os.path.getsize(lcov_project) == 0: 97 | # this is most likely because the test did not create any results 98 | print("No C++ coverage was generated") 99 | print_coverage("", args.coverage_dir, args.coverage_stderr) 100 | return 0 101 | 102 | # build html coverage 103 | html_dir = os.path.join(args.coverage_dir, "coverage") 104 | cmd = ["genhtml", "-o", html_dir, lcov_project, "-s"] 105 | proc = subprocess.Popen(cmd, universal_newlines=True, stdout=subprocess.PIPE) 106 | out, err = proc.communicate() 107 | if proc.returncode: 108 | print("No C++ coverage was generated") 109 | print_coverage("", args.coverage_dir, args.coverage_stderr) 110 | return 0 111 | 112 | # print & show 113 | print_coverage(out, args.coverage_dir, args.coverage_stderr) 114 | index_html = os.path.join(html_dir, "index.html") 115 | file = sys.stderr if args.coverage_stderr else sys.stdout 116 | print(" Coverage report: file://{}".format(index_html), file=file) 117 | if args.show: 118 | subprocess.call(["firefox", index_html]) 119 | return 0 120 | 121 | 122 | def main(argv=sys.argv[1:]): 123 | parser = argparse.ArgumentParser( 124 | description='Cleans up results of old tests and coverage runs, initializes coverage counters.') 125 | parser.add_argument('project_dir', help='Path of the project') 126 | parser.add_argument('build_dir', help='The path where cmake was configured') 127 | parser.add_argument('test_results_dir', help='The directory where test results will be written') 128 | parser.add_argument('coverage_dir', nargs='?', default="", help='the directory for the coverage') 129 | parser.add_argument('--show', action='store_true', help='Display results after run') 130 | parser.add_argument('--coverage_stderr', action='store_true', help='Print coverage to stderr instead') 131 | parser.add_argument('--fail_on_test', action='store_true', help='Report failure if tests failed') 132 | args = parser.parse_args(argv) 133 | fail = build_coverage(args) 134 | if fail: 135 | return fail 136 | 137 | # for ros2 we currently don't handle processing the results 138 | if os.environ.get("ROS_VERSION", "1") == "2": 139 | return 0 140 | 141 | # print unittests 142 | with open(os.devnull, "w") as f: 143 | has_ccat = subprocess.call(["which", "pygmentize"], stdout=f, stderr=f) == 0 144 | ccat_cmd = " | pygmentize" if has_ccat else "" 145 | verbose = " --verbose" if args.coverage_stderr else "" 146 | to_err = " 1>&2" if args.coverage_stderr else "" 147 | cmd = '/bin/bash -c "set -o pipefail; catkin_test_results{} {}{}{}"'.format( 148 | verbose, args.test_results_dir, ccat_cmd, to_err) 149 | fail = subprocess.call(cmd, shell=True) 150 | sys.stderr.write("\n") 151 | if args.fail_on_test: 152 | return fail 153 | return 0 154 | 155 | 156 | if __name__ == '__main__': 157 | sys.exit(main()) 158 | -------------------------------------------------------------------------------- /scripts/generate_cmakelists.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This Python file uses the following encoding: utf-8 3 | import argparse 4 | import os 5 | import sys 6 | import subprocess 7 | 8 | parser = argparse.ArgumentParser(description='Generates a CMakeLists.txt for a project.') 9 | parser.add_argument('package_name', type=str, help='name of the package') 10 | parser.add_argument('-r', '--ros', action='store_true', help='add ROS support (messages, ...)') 11 | parser.add_argument('-e', '--exe', action='store_true', help='create an executable/node package') 12 | args = parser.parse_args() 13 | 14 | # figure out where the template file is 15 | currdir = os.path.dirname(os.path.abspath(__file__)) 16 | devel_template = os.path.join(currdir, "../ci_templates/CMakeLists.txt") 17 | install_template = os.path.join(currdir, "../../share/mrt_cmake_modules/CMakeLists.txt") 18 | if os.path.exists(devel_template): 19 | template = devel_template 20 | elif os.path.exists(install_template): 21 | template = install_template 22 | else: 23 | print("Failed to find the CMakeLists template file. Was this script moved?") 24 | sys.exit(1) 25 | 26 | pattern = "@" 27 | if args.ros: 28 | pattern += ".x" 29 | else: 30 | pattern += "x." 31 | pattern += "|" 32 | 33 | if not args.exe: 34 | pattern += "x.@" 35 | else: 36 | pattern += ".x@" 37 | 38 | with open("CMakeLists.txt", "w") as file: 39 | with open(template) as template_file: 40 | file.write(template_file.read()) 41 | 42 | subprocess.call("sed -i " + 43 | "-e 's/^" + pattern + " //g' " + 44 | "-e '/^@..|..@/d' " + 45 | r"-e 's/\${CMAKE_PACKAGE_NAME}/" + args.package_name + "/g' " + 46 | "CMakeLists.txt", shell=True) 47 | -------------------------------------------------------------------------------- /scripts/init_coverage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This Python file uses the following encoding: utf-8 3 | import subprocess 4 | import sys 5 | import argparse 6 | import shutil 7 | import os 8 | 9 | 10 | def get_source_file(gcno_file, build_dir): 11 | # the gcno path should have the structure: /CMakeFiles//.gcno. 12 | # We want to extract the sourcepath part 13 | relpath = os.path.relpath(gcno_file, os.path.join(build_dir, "CMakeFiles")) 14 | return os.path.join(*(relpath.rstrip(".gcno").split(os.path.sep)[1:])) 15 | 16 | 17 | def cleanup_orphaned_gcnos(build_dir, project_dir): 18 | # cmake does not delete gcno files after their source file is gone. this confuses lcov. 19 | for root, dirs, files in os.walk(os.path.join(build_dir, "CMakeFiles")): 20 | for file in files: 21 | if not file.endswith(".gcno"): 22 | continue 23 | gcno_file = os.path.join(root, file) 24 | src_file = os.path.join(project_dir, get_source_file(gcno_file, build_dir)) 25 | if not os.path.exists(src_file): 26 | print("Removing orphaned {}".format(file)) 27 | os.remove(gcno_file) 28 | 29 | 30 | def main(argv=sys.argv[1:]): 31 | parser = argparse.ArgumentParser( 32 | description='Cleans up results of old tests and coverage runs, initializes coverage counters.') 33 | parser.add_argument('project_name', help='Name of the project') 34 | parser.add_argument('build_dir', help='The path where cmake was configured') 35 | parser.add_argument('project_dir', help='Path to the project') 36 | parser.add_argument('test_results_dir', help='The directory where test results will be written') 37 | parser.add_argument('coverage_dir', nargs='?', default="", help='the directory for the coverage') 38 | args = parser.parse_args(argv) 39 | 40 | test_dir = os.path.join(args.test_results_dir) 41 | print("Removing {}".format(test_dir)) 42 | if os.path.exists(test_dir): 43 | shutil.rmtree(test_dir) 44 | os.makedirs(test_dir) 45 | 46 | if not args.coverage_dir: 47 | return 48 | 49 | if os.path.exists(args.coverage_dir): 50 | print("Removing {}".format(args.coverage_dir)) 51 | shutil.rmtree(args.coverage_dir) 52 | if os.path.exists(args.build_dir): 53 | cleanup_orphaned_gcnos(args.build_dir, args.project_dir) 54 | os.mkdir(args.coverage_dir) 55 | out_file = os.path.join(args.coverage_dir, "baseline.lcov") 56 | cmd = ["lcov", "-i", "-c", "-o", out_file, "--directory", args.build_dir, "-q"] 57 | print("Initializing counters") 58 | return subprocess.call(cmd) 59 | 60 | 61 | if __name__ == '__main__': 62 | sys.exit(main()) 63 | -------------------------------------------------------------------------------- /scripts/run_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This Python file uses the following encoding: utf-8 3 | from __future__ import print_function 4 | import argparse 5 | import os 6 | import sys 7 | import subprocess 8 | import sys 9 | try: 10 | import xml.etree.cElementTree as ET 11 | except ImportError: 12 | import xml.etree.ElementTree as ET 13 | 14 | 15 | def get_missing_junit_result_filename(filename): 16 | return os.path.join(os.path.dirname(filename), 'MISSING-%s' % os.path.basename(filename)) 17 | 18 | 19 | def remove_junit_result(filename): 20 | # if result file exists remove it before test execution 21 | if os.path.exists(filename): 22 | os.remove(filename) 23 | # if placeholder (indicating previous failure) exists remove it before test execution 24 | missing_filename = get_missing_junit_result_filename(filename) 25 | if os.path.exists(missing_filename): 26 | os.remove(missing_filename) 27 | 28 | 29 | def ensure_junit_result_exist(filename, errors): 30 | if os.path.exists(filename): 31 | # if result file exists ensure that it contains valid xml 32 | try: 33 | ET.parse(filename) 34 | except ParseError: 35 | from catkin.tidy_xml import tidy_xml 36 | tidy_xml(filename) 37 | try: 38 | ET.parse(filename) 39 | except ParseError as e: 40 | print("Invalid XML in result file '%s' (even after trying to tidy it): %s " % (filename, str(e)), file=sys.stderr) 41 | return True 42 | # if result file does not exist create placeholder which indicates failure 43 | missing_filename = get_missing_junit_result_filename(filename) 44 | print("Cannot find results, writing failure results to '%s'" % missing_filename, file=sys.stderr) 45 | # create folder if necessary 46 | if not os.path.exists(os.path.dirname(filename)): 47 | try: 48 | os.makedirs(os.path.dirname(filename)) 49 | except OSError as e: 50 | # catch case where folder has been created in the mean time 51 | if e.errno != errno.EEXIST: 52 | raise 53 | cdata = "".format(errors) if errors else "" 54 | cdata = cdata.replace("\033", "") 55 | with open(missing_filename, 'w') as f: 56 | data = {'test': os.path.basename(filename), 'test_file': filename, 'cdata': cdata} 57 | f.write( 58 | ('\n' 59 | '\n' 60 | ' \n' 61 | ' ' 62 | '%(cdata)s' 63 | ' \n' 64 | ' \n' 65 | '\n') % 66 | data) 67 | return False 68 | 69 | 70 | def main(argv=sys.argv[1:]): 71 | parser = argparse.ArgumentParser( 72 | description='Runs the test command passed as an argument and verifies that the expected result file has been generated.') 73 | parser.add_argument('results', help='The path to the xunit result file') 74 | parser.add_argument('command', nargs='+', help='The test command to execute') 75 | parser.add_argument('--working-dir', nargs='?', help='The working directory for the executed command') 76 | parser.add_argument('--coverage-dir', nargs='?', help='The directory where coverage data should be generated') 77 | parser.add_argument( 78 | '--return-code', 79 | action='store_true', 80 | help='Set the return code based on the success of the test command') 81 | parser.add_argument('--redirect-stderr', action='store_true', help='Redirect stderr to stdout') 82 | args = parser.parse_args(argv) 83 | 84 | remove_junit_result(args.results) 85 | 86 | try: 87 | os.mkdir(os.path.dirname(args.results)) 88 | except OSError: 89 | pass 90 | 91 | work_dir_msg = ' with working directory "%s"' % args.working_dir if args.working_dir is not None else '' 92 | cmds_msg = ''.join(['\n %s' % cmd for cmd in args.command]) 93 | print('-- run_test.py: execute commands%s%s' % (work_dir_msg, cmds_msg)) 94 | 95 | if args.coverage_dir: 96 | env = os.environ.copy() 97 | print("Coverage goes to {}".format(args.coverage_dir)) 98 | env['GCOV_PREFIX'] = args.coverage_dir 99 | if not os.path.exists(args.coverage_dir): 100 | os.mkdir(args.coverage_dir) 101 | else: 102 | env = os.environ 103 | 104 | rc = 0 105 | errors = [] 106 | for cmd in args.command: 107 | stream = sys.stderr if not args.redirect_stderr else sys.stdout 108 | proc = subprocess.Popen(cmd + " | tee", cwd=args.working_dir, shell=True, env=env, stderr=subprocess.PIPE, universal_newlines=True) 109 | stdout, stderr = proc.communicate() 110 | if stderr: 111 | print(stderr, file=stream) 112 | errors.append(stderr) 113 | if proc.returncode: 114 | rc = proc.returncode 115 | break 116 | 117 | print('-- run_test.py: verify result "%s"' % args.results) 118 | exists = ensure_junit_result_exist(args.results, u"\n".join(errors)) 119 | if not exists: 120 | rc = 1 121 | 122 | if args.return_code: 123 | return rc 124 | return 0 125 | 126 | 127 | if __name__ == '__main__': 128 | sys.exit(main()) 129 | --------------------------------------------------------------------------------