├── .gitignore ├── CHANGELOG.rst ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── cmake ├── Modules │ ├── FindEigen.cmake │ ├── FindGSL.cmake │ ├── FindGflags.cmake │ ├── FindNUMPY.cmake │ ├── FindPoco.cmake │ ├── FindTBB.cmake │ ├── FindTinyXML.cmake │ ├── FindTinyXML2.cmake │ ├── FindUUID.cmake │ └── FindXenomai.cmake ├── cmake_modules-extras.cmake.develspace.in └── cmake_modules-extras.cmake.installspace.in ├── package.xml └── tests └── test_find_tinyxml ├── CMakeLists.txt └── package.xml /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeCache.txt 2 | CMakeFiles 3 | Makefile 4 | cmake_install.cmake 5 | install_manifest.txt 6 | build 7 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package cmake_modules 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.5.2 (2025-04-25) 6 | ------------------ 7 | * Do not put location of macOS SDK in UUID_INCLUDE_DIRS on macOS (`#54 `_) 8 | * Contributors: Silvio Traversaro 9 | 10 | 0.5.1 (2025-04-10) 11 | ------------------ 12 | * Update maintainers (`#53 `_) 13 | * 0.5 Noetic release only (`#52 `_) 14 | * Contributors: Mabel Zhang, Shane Loretz 15 | 16 | 0.5.0 (2020-01-23) 17 | ------------------ 18 | * Bump CMake version to avoid CMP0048 author warning (`#51 `_) 19 | * Contributors: Shane Loretz 20 | 21 | 0.4.2 (2019-03-19) 22 | ------------------ 23 | * Changed FindPoco to use 'd' suffix only when debug libraries are present (`#50 `_) 24 | * Recent versions of Debian and Ubuntu (beginning with Stretch and Bionic respectively) do not provide separate debug library versions of Poco. 25 | * The refactored debug check now actually verifies that a d-suffixed library exists. 26 | * If not it falls back to using the non-suffixed version of the library which may or may not include debug symbols. 27 | * add note about ROS Lunar and future versioning schemes 28 | * Contributors: Steven! Ragnarök, William Woodall 29 | 30 | 0.4.1 (2017-02-21) 31 | ------------------ 32 | * Add FindTinyXML2 module (`#42 `_) 33 | Signed-off-by: Dmitry Rozhkov 34 | * Add FindGflags for supporting Gflags 35 | * Contributors: Dave Coleman, Dmitry Rozhkov, William Woodall 36 | 37 | 0.4.0 (2014-12-25) 38 | ------------------ 39 | * The Eigen module provided by this package has been deprecated. 40 | There is now a CMake warning to encourage people to use the Module provided by Eigen instead. 41 | * Contributors: William Woodall 42 | 43 | 0.3.3 (2014-12-23) 44 | ------------------ 45 | * Added FindPoco.cmake, which migrated from the ros/class_loader repository. 46 | * Update to FindXenomai.cmake 47 | find_package_handle_standard_args generates all caps variables (XENOMAI_FOUND), while this script is expected to create Xenomai_FOUND. 48 | This changeset creates the appropriately cased variable, but does not unset the all-caps variant for backwards-compatibility reasons (I typically unset it on new modules). 49 | * Contributors: Adolfo Rodriguez Tsouroukdissian, Esteve Fernandez, William Woodall 50 | 51 | 0.3.2 (2014-10-27) 52 | ------------------ 53 | * Added CMake module for finding the UUID libraries 54 | * Changed prepend of CMAKE_MODULE_PATH to append behaviour in order to allow prepending of external CMake modules. 55 | * Added CMake module for finding GSL 56 | * Contributors: Esteve Fernandez, Peter Lehner, William Woodall, v01d 57 | 58 | 0.3.1 (2014-05-07) 59 | ------------------ 60 | * Export architecture_independent flag in package.xml 61 | * Fix extended CMAKE_MODULE_PATH variable when path contains spaces 62 | * Mention the sequencing reqirement with an example 63 | * Contributors: Dirk Thomas, Paul Mathieu, Scott K Logan, Tully Foote, William Woodall, phuicy 64 | 65 | 0.3.0 (2014-02-22) 66 | ------------------ 67 | * Added Numpy CMake module 68 | * Added Eigen CMake module 69 | closed `#10 `_ 70 | * Removed use of absolute paths in extra files 71 | fixed `#9 `_ 72 | * Contributors: Vincent Rabaud, William Woodall 73 | 74 | 0.2.1 (2014-01-24) 75 | ------------------ 76 | * Adding CMake module for finding Xenomai RT kernel patch build flags 77 | * Contributors: Jonathan Bohren, William Woodall 78 | 79 | 0.2.0 (2013-12-04) 80 | ------------------ 81 | * Added FindTBB.cmake version r36 from the findtbb package 82 | * TinyXML: Add more comprehensive header documentation. 83 | 84 | 0.1.0 (2013-07-24) 85 | ------------------ 86 | * Initial release, includes the FindTinyXML.cmake CMake module 87 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(cmake_modules) 3 | 4 | find_package(catkin REQUIRED) 5 | 6 | catkin_package(CFG_EXTRAS cmake_modules-extras.cmake) 7 | 8 | ## Install all cmake files 9 | install(DIRECTORY cmake/Modules 10 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake) 11 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing a new CMake Module 2 | 3 | First of all lets talk about the difference in a CMake module and a CMake config. 4 | 5 | A **CMake config file** is named like `-config.cmake` or `Config.cmake`, and should normally be distributed by the CMake project which it applies to and should contain absolute locations to things which are known at build and install time. These files are discovered by searching the `CMAKE_PREFIX_PATH`. 6 | 7 | A **CMake module file** is named like `Find.cmake` and are discovered by searching the `CMAKE_MODULE_PATH`. These files are distributed by CMake, or other packages like this one, and are used to locate software packages which were not built with CMake and which do not distribute CMake config files themselves. The prefix `Find` in the file names implies that you must "find" the software in question and often requires the use of the pkg-config module and/or the `find_path` and `find_library` CMake macros. 8 | 9 | These are some similar repositories which contain several CMake modules, which CMake itself does not distribute: 10 | - https://github.com/rpavlik/cmake-modules 11 | - http://code.google.com/p/mgep/source/browse/branches/clientv2/CMakeModules 12 | 13 | This package should exclusively contain **CMake modules** since config files should be distributed by the packages to which they apply. 14 | 15 | You may want to contribute an existing CMake module you found on the internet, or you may want to write one from scratch. When writing one from scratch, this page can be useful: 16 | 17 | http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules 18 | 19 | ## CMake Module Style 20 | 21 | When contributing a new CMake module for this package, please follow these guidelines: 22 | 23 | - The module should be placed in the `cmake/Modules` directory of this package 24 | - It should take the name `Find.cmake` 25 | - For example `FindTinyXML.cmake` 26 | - The module should **at least** provide these variables: 27 | - `_FOUND` 28 | - `_INCLUDE_DIRS` 29 | - `_LIBRARIES` 30 | - It may provide other variables but they must be documented at the top of the module file. 31 | - The module must provide documentation for each variable it sets and give an example of usage 32 | 33 | You should also strive to keep the `PackageName` in `Find.cmake`'s case consistent in the CMake variables. For example, `FindTinyXML.cmake` should be found with a command like `find_package(TinyXML REQUIRED)` and should produce variables like `TinyXML_FOUND`. 34 | 35 | A complete description of the recommended convention for writing CMake modules can be found here: 36 | 37 | http://www.cmake.org/cmake/help/v3.0/manual/cmake-developer.7.html#find-modules 38 | 39 | ## Long term contribution 40 | 41 | This package serves as a repository for common modules which CMake does not currently distribute itself, but the ideal solution would be to get these modules contributed upstream with CMake so that in future versions of CMake, the modules will not have to be provided here, and will more widely benefit the CMake community. 42 | 43 | So consider contributing your CMake modules upstream to CMake, details here: 44 | 45 | http://www.cmake.org/cmake/project/getinvolved.html 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Open Source Robotics Foundation 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | Redistributions in binary form must reproduce the above copyright notice, this 11 | list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Archived - ROS 1 End-of-life 2 | 3 | This repository contains ROS 1 packages. 4 | The last supported ROS 1 release, ROS Noetic, [officially reached end of life on May 31st, 2025](https://bit.ly/NoeticEOL). 5 | 6 | cmake_modules 7 | ============= 8 | 9 | A common repository for CMake Modules which are not distributed with CMake but are commonly used by ROS packages. 10 | 11 | See the CONTRIBUTING.md file in this repository before submitting pull requests for new modules. 12 | 13 | ROS Distros 14 | ----------- 15 | 16 | This repository has branches for minor releases (`0.2-devel`, `0.3-devel`, `0.4-devel`, etc...) and they map to specific ROS distributions like so: 17 | 18 | - `0.2-devel`: 19 | - ROS Groovy 20 | - `0.3-devel`: 21 | - ROS Hydro 22 | - ROS Indigo 23 | - `0.4-devel`: 24 | - ROS Jade 25 | - ROS Kinetic 26 | - ROS Lunar 27 | - ROS Melodic 28 | - `0.5-devel`: 29 | - ROS Noetic 30 | 31 | This mapping will be kept up-to-date in the `README.md` on the default branch. 32 | 33 | In the future, new minor releases will increment by the number of ROS distros that are skipped. 34 | For example, if a custom branch is needed for ROS Lunar, then it will be `0.6-devel` and not `0.5-devel`, so that `0.5-devel` maybe used by Kinetic in the future if necessary. 35 | 36 | Provided Modules 37 | ---------------- 38 | 39 | 1. [**NumPy**](http://www.numpy.org/) is the fundamental package for scientific computing with Python. 40 | 1. [**TBB**](https://www.threadingbuildingblocks.org/) lets you easily write parallel C++ programs that take full advantage of multicore performance. 41 | 1. [**TinyXML**](http://www.grinninglizard.com/tinyxml/) is a simple, small, C++ XML parser. 42 | 1. [**TinyXML2**](http://www.grinninglizard.com/tinyxml2/) is a simple, small, C++ XML parser, continuation of TinyXML. 43 | 1. [**Xenomai**](http://www.xenomai.org/) is a real-time development framework cooperating with the Linux kernel. 44 | 1. [**GSL**](http://www.gnu.org/software/gsl/) is a numerical library for C and C++ programmers. 45 | 1. [**Gflags**](https://gflags.github.io/gflags/) is a C++ library that implements commandline flags processing with the ability to define flags in the source file in which they are used. 46 | 1. \[Deprecated\] [**Eigen**](http://eigen.tuxfamily.org/index.php?title=Main_Page) is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. 47 | 48 | Usage 49 | ----- 50 | 51 | To use the CMake modules provided by this catkin package, you must `` on it in your `package.xml`, like so: 52 | 53 | ```xml 54 | 55 | 56 | 57 | cmake_modules 58 | 59 | ``` 60 | 61 | Then you must `find_package` it in your `CMakeLists.txt` along with your other catkin build dependencies: 62 | 63 | ```cmake 64 | find_package(catkin REQUIRED COMPONENTS ... cmake_modules ...) 65 | ``` 66 | 67 | OR by `find_package`'ing it directly: 68 | 69 | ```cmake 70 | find_package(cmake_modules REQUIRED) 71 | ``` 72 | 73 | After the above `find_package` invocations, the modules provided by `cmake_modules` will be available in your `CMAKE_MODULE_PATH` to be found. For example you can find `TinyXML` by using the following: 74 | 75 | ```cmake 76 | find_package(TinyXML REQUIRED) 77 | ``` 78 | 79 | ### Lookup sheet 80 | 81 | ##### Eigen [Deprecated] 82 | 83 | ```cmake 84 | find_package(Eigen REQUIRED) 85 | ``` 86 | 87 | ##### NumPY 88 | 89 | ```cmake 90 | find_package(NUMPY REQUIRED) 91 | ``` 92 | 93 | ##### TBB 94 | 95 | ```cmake 96 | find_package(TBB REQUIRED) 97 | ``` 98 | 99 | ##### TinyXML 100 | 101 | ```cmake 102 | find_package(TinyXML REQUIRED) 103 | ``` 104 | 105 | ##### Xenomai 106 | 107 | ```cmake 108 | find_package(Xenomai REQUIRED) 109 | ``` 110 | 111 | ##### FindGSL 112 | 113 | ```cmake 114 | find_package(GSL REQUIRED) 115 | ``` 116 | 117 | ##### Gflags 118 | 119 | ```cmake 120 | find_package(Gflags REQUIRED) 121 | ``` 122 | -------------------------------------------------------------------------------- /cmake/Modules/FindEigen.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # NOTICE! This module is deprecated and the FindEigen3.cmake which is 3 | # distributed with Eigen should now be used. 4 | # 5 | 6 | ############################################################################### 7 | # 8 | # CMake script for finding the Eigen library. 9 | # 10 | # http://eigen.tuxfamily.org/index.php?title=Main_Page 11 | # 12 | # Copyright (c) 2006, 2007 Montel Laurent, 13 | # Copyright (c) 2008, 2009 Gael Guennebaud, 14 | # Copyright (c) 2009 Benoit Jacob 15 | # Redistribution and use is allowed according to the terms of the 2-clause BSD 16 | # license. 17 | # 18 | # 19 | # Input variables: 20 | # 21 | # - Eigen_ROOT_DIR (optional): When specified, header files and libraries 22 | # will be searched for in `${Eigen_ROOT_DIR}/include` and 23 | # `${Eigen_ROOT_DIR}/libs` respectively, and the default CMake search order 24 | # will be ignored. When unspecified, the default CMake search order is used. 25 | # This variable can be specified either as a CMake or environment variable. 26 | # If both are set, preference is given to the CMake variable. 27 | # Use this variable for finding packages installed in a nonstandard location, 28 | # or for enforcing that one of multiple package installations is picked up. 29 | # 30 | # Cache variables (not intended to be used in CMakeLists.txt files) 31 | # 32 | # - Eigen_INCLUDE_DIR: Absolute path to package headers. 33 | # 34 | # 35 | # Output variables: 36 | # 37 | # - Eigen_FOUND: Boolean that indicates if the package was found 38 | # - Eigen_INCLUDE_DIRS: Paths to the necessary header files 39 | # - Eigen_VERSION: Version of Eigen library found 40 | # - Eigen_DEFINITIONS: Definitions to be passed on behalf of eigen 41 | # 42 | # 43 | # Example usage: 44 | # 45 | # # Passing the version means Eigen_FOUND will only be TRUE if a 46 | # # version >= the provided version is found. 47 | # find_package(Eigen 3.1.2) 48 | # if(NOT Eigen_FOUND) 49 | # # Error handling 50 | # endif() 51 | # ... 52 | # add_definitions(${Eigen_DEFINITIONS}) 53 | # ... 54 | # include_directories(${Eigen_INCLUDE_DIRS} ...) 55 | # 56 | ############################################################################### 57 | 58 | find_package(PkgConfig) 59 | pkg_check_modules(PC_EIGEN eigen3) 60 | set(EIGEN_DEFINITIONS ${PC_EIGEN_CFLAGS_OTHER}) 61 | 62 | message(WARNING 63 | "The FindEigen.cmake Module in the cmake_modules package is deprecated.\n" 64 | "Please use the FindEigen3.cmake Module provided with Eigen. " 65 | "Change instances of find_package(Eigen) to find_package(Eigen3). " 66 | "Check the FindEigen3.cmake Module for the resulting CMake variable names.\n" 67 | ) 68 | 69 | find_path(EIGEN_INCLUDE_DIR Eigen/Core 70 | HINTS ${PC_EIGEN_INCLUDEDIR} ${PC_EIGEN_INCLUDE_DIRS} 71 | "${Eigen_ROOT_DIR}" "$ENV{EIGEN_ROOT_DIR}" 72 | "${EIGEN_ROOT}" "$ENV{EIGEN_ROOT}" # Backwards Compatibility 73 | PATHS "$ENV{PROGRAMFILES}/Eigen" "$ENV{PROGRAMW6432}/Eigen" 74 | "$ENV{PROGRAMFILES}/Eigen 3.0.0" "$ENV{PROGRAMW6432}/Eigen 3.0.0" 75 | PATH_SUFFIXES eigen3 include/eigen3 include) 76 | 77 | set(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR}) 78 | 79 | include(FindPackageHandleStandardArgs) 80 | find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR) 81 | 82 | mark_as_advanced(EIGEN_INCLUDE_DIR) 83 | 84 | if(EIGEN_FOUND) 85 | message(STATUS "Eigen found (include: ${EIGEN_INCLUDE_DIRS})") 86 | endif(EIGEN_FOUND) 87 | 88 | 89 | set(Eigen_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}) 90 | set(Eigen_FOUND ${EIGEN_FOUND}) 91 | set(Eigen_VERSION ${EIGEN_VERSION}) 92 | set(Eigen_DEFINITIONS ${EIGEN_DEFINITIONS}) 93 | -------------------------------------------------------------------------------- /cmake/Modules/FindGSL.cmake: -------------------------------------------------------------------------------- 1 | # Try to find gnu scientific library GSL 2 | # See 3 | # http://www.gnu.org/software/gsl/ and 4 | # http://gnuwin32.sourceforge.net/packages/gsl.htm 5 | # 6 | # Once run this will define: 7 | # 8 | # GSL_FOUND = system has GSL lib 9 | # 10 | # GSL_LIBRARIES = full path to the libraries 11 | # on Unix/Linux with additional linker flags from "gsl-config --libs" 12 | # 13 | # CMAKE_GSL_CXX_FLAGS = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`" 14 | # 15 | # GSL_INCLUDE_DIRS = where to find headers 16 | # 17 | # GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix 18 | # GSL_EXE_LINKER_FLAGS = rpath on Unix 19 | # 20 | # Felix Woelk 07/2004 21 | # Jan Woetzel 22 | # 23 | # www.mip.informatik.uni-kiel.de 24 | # -------------------------------- 25 | 26 | IF(WIN32) 27 | # JW tested with gsl-1.8, Windows XP, MSVS 7.1, MSVS 8.0 28 | SET(GSL_POSSIBLE_ROOT_DIRS 29 | ${GSL_ROOT_DIR} 30 | $ENV{GSL_ROOT_DIR} 31 | ${GSL_DIR} 32 | ${GSL_HOME} 33 | $ENV{GSL_DIR} 34 | $ENV{GSL_HOME} 35 | $ENV{EXTERN_LIBS_DIR}/gsl 36 | $ENV{EXTRA} 37 | # "C:/home/jw/source2/gsl-1.8" 38 | ) 39 | FIND_PATH(GSL_INCLUDE_DIRS 40 | NAMES gsl/gsl_cdf.h gsl/gsl_randist.h 41 | PATHS ${GSL_POSSIBLE_ROOT_DIRS} 42 | PATH_SUFFIXES include 43 | DOC "GSL header include dir" 44 | ) 45 | 46 | FIND_LIBRARY(GSL_GSL_LIBRARY 47 | NAMES gsl libgsl 48 | PATHS ${GSL_POSSIBLE_ROOT_DIRS} 49 | PATH_SUFFIXES lib 50 | DOC "GSL library dir" ) 51 | 52 | FIND_LIBRARY(GSL_GSLCBLAS_LIBRARY 53 | NAMES gslcblas libgslcblas 54 | PATHS ${GSL_POSSIBLE_ROOT_DIRS} 55 | PATH_SUFFIXES lib 56 | DOC "GSL cblas library dir" ) 57 | 58 | SET(GSL_LIBRARIES ${GSL_GSL_LIBRARY}) 59 | 60 | #MESSAGE("DBG\n" 61 | # "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n" 62 | # "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n" 63 | # "GSL_LIBRARIES=${GSL_LIBRARIES}") 64 | 65 | 66 | ELSE(WIN32) 67 | 68 | IF(UNIX) 69 | SET(GSL_CONFIG_PREFER_PATH 70 | "$ENV{GSL_DIR}/bin" 71 | "$ENV{GSL_DIR}" 72 | "$ENV{GSL_HOME}/bin" 73 | "$ENV{GSL_HOME}" 74 | CACHE STRING "preferred path to GSL (gsl-config)") 75 | FIND_PROGRAM(GSL_CONFIG gsl-config 76 | ${GSL_CONFIG_PREFER_PATH} 77 | /usr/bin/ 78 | ) 79 | # MESSAGE("DBG GSL_CONFIG ${GSL_CONFIG}") 80 | 81 | IF (GSL_CONFIG) 82 | 83 | MESSAGE(STATUS "GSL using gsl-config ${GSL_CONFIG}") 84 | # set CXXFLAGS to be fed into CXX_FLAGS by the user: 85 | EXEC_PROGRAM(${GSL_CONFIG} 86 | ARGS --cflags 87 | OUTPUT_VARIABLE GSL_CXX_FLAGS ) 88 | #SET(GSL_CXX_FLAGS "`${GSL_CONFIG} --cflags`") 89 | 90 | # set INCLUDE_DIRS to prefix+include 91 | EXEC_PROGRAM(${GSL_CONFIG} 92 | ARGS --prefix 93 | OUTPUT_VARIABLE GSL_PREFIX) 94 | SET(GSL_INCLUDE_DIRS ${GSL_PREFIX}/include CACHE STRING INTERNAL) 95 | 96 | # set link libraries and link flags 97 | 98 | #SET(GSL_LIBRARIES "`${GSL_CONFIG} --libs`") 99 | 100 | # extract link dirs for rpath 101 | EXEC_PROGRAM(${GSL_CONFIG} 102 | ARGS --libs 103 | OUTPUT_VARIABLE GSL_CONFIG_LIBS ) 104 | SET(GSL_LIBRARIES "${GSL_CONFIG_LIBS}") 105 | 106 | # split off the link dirs (for rpath) 107 | # use regular expression to match wildcard equivalent "-L*" 108 | # with is a space or a semicolon 109 | STRING(REGEX MATCHALL "[-][L]([^ ;])+" 110 | GSL_LINK_DIRECTORIES_WITH_PREFIX 111 | "${GSL_CONFIG_LIBS}" ) 112 | # MESSAGE("DBG GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}") 113 | 114 | # remove prefix -L because we need the pure directory for LINK_DIRECTORIES 115 | 116 | IF (GSL_LINK_DIRECTORIES_WITH_PREFIX) 117 | STRING(REGEX REPLACE "[-][L]" "" GSL_LINK_DIRECTORIES ${GSL_LINK_DIRECTORIES_WITH_PREFIX} ) 118 | ENDIF (GSL_LINK_DIRECTORIES_WITH_PREFIX) 119 | SET(GSL_EXE_LINKER_FLAGS "-Wl,-rpath,${GSL_LINK_DIRECTORIES}" CACHE STRING INTERNAL) 120 | # MESSAGE("DBG GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}") 121 | # MESSAGE("DBG GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}") 122 | 123 | # ADD_DEFINITIONS("-DHAVE_GSL") 124 | # SET(GSL_DEFINITIONS "-DHAVE_GSL") 125 | MARK_AS_ADVANCED( 126 | GSL_CXX_FLAGS 127 | GSL_INCLUDE_DIRS 128 | GSL_LIBRARIES 129 | GSL_LINK_DIRECTORIES 130 | GSL_DEFINITIONS 131 | ) 132 | MESSAGE(STATUS "Using GSL from ${GSL_PREFIX}") 133 | 134 | ELSE(GSL_CONFIG) 135 | 136 | INCLUDE(UsePkgConfig) #needed for PKGCONFIG(...) 137 | 138 | MESSAGE(STATUS "GSL using pkgconfig") 139 | # PKGCONFIG(gsl includedir libdir linkflags cflags) 140 | PKGCONFIG(gsl GSL_INCLUDE_DIRS GSL_LINK_DIRECTORIES GSL_LIBRARIES GSL_CXX_FLAGS) 141 | IF(GSL_INCLUDE_DIRS) 142 | MARK_AS_ADVANCED( 143 | GSL_CXX_FLAGS 144 | GSL_INCLUDE_DIRS 145 | GSL_LIBRARIES 146 | GSL_LINK_DIRECTORIES 147 | ) 148 | 149 | ELSE(GSL_INCLUDE_DIRS) 150 | MESSAGE("FindGSL.cmake: gsl-config/pkg-config gsl not found. Please set it manually. GSL_CONFIG=${GSL_CONFIG}") 151 | ENDIF(GSL_INCLUDE_DIRS) 152 | 153 | ENDIF(GSL_CONFIG) 154 | 155 | ENDIF(UNIX) 156 | ENDIF(WIN32) 157 | 158 | 159 | IF(GSL_LIBRARIES) 160 | IF(GSL_INCLUDE_DIRS OR GSL_CXX_FLAGS) 161 | 162 | SET(GSL_FOUND 1) 163 | 164 | ENDIF(GSL_INCLUDE_DIRS OR GSL_CXX_FLAGS) 165 | ENDIF(GSL_LIBRARIES) 166 | 167 | 168 | # ========================================== 169 | IF(NOT GSL_FOUND) 170 | # make FIND_PACKAGE friendly 171 | IF(NOT GSL_FIND_QUIETLY) 172 | IF(GSL_FIND_REQUIRED) 173 | MESSAGE(FATAL_ERROR "GSL required, please specify it's location.") 174 | ELSE(GSL_FIND_REQUIRED) 175 | MESSAGE(STATUS "ERROR: GSL was not found.") 176 | ENDIF(GSL_FIND_REQUIRED) 177 | ENDIF(NOT GSL_FIND_QUIETLY) 178 | ENDIF(NOT GSL_FOUND) 179 | -------------------------------------------------------------------------------- /cmake/Modules/FindGflags.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # CMake script for finding the GFlags library. 4 | # 5 | # https://gflags.github.io/gflags/ 6 | # 7 | # Redistribution and use is allowed according to the terms of the 3-clause BSD 8 | # license. 9 | # 10 | # Input variables: 11 | # 12 | # - Gflags_FIND_REQUIRED: throws an error if gflags is not found but it is required 13 | # 14 | # Output variables: 15 | # 16 | # - Gflags_FOUND: Boolean that indicates if the package was found 17 | # - Gflags_LIBRARIES: Package libraries 18 | # - Gflags_INCLUDE_DIRS: Absolute path to package headers 19 | # 20 | # Example usage: 21 | # 22 | # find_package(Gflags REQUIRED) 23 | # 24 | # include_directories( 25 | # ${Gflags_INCLUDE_DIRS} 26 | # ) 27 | # 28 | # add_executable(main src/main.cpp) 29 | # target_link_libraries(main 30 | # ${Gflags_LIBRARIES} 31 | # ) 32 | ############################################################################### 33 | 34 | 35 | find_path(Gflags_INCLUDE_PATH gflags/gflags.h) 36 | 37 | find_library(Gflags_LIBRARY NAMES gflags libgflags) 38 | 39 | if(Gflags_INCLUDE_PATH AND Gflags_LIBRARY) 40 | set(Gflags_FOUND TRUE) 41 | endif(Gflags_INCLUDE_PATH AND Gflags_LIBRARY) 42 | 43 | if(Gflags_FOUND) 44 | message(STATUS "Found gflags: ${Gflags_LIBRARY}") 45 | # Output variables 46 | set(Gflags_INCLUDE_DIRS ${Gflags_INCLUDE_DIR}) 47 | set(Gflags_LIBRARIES ${Gflags_LIBRARY}) 48 | else(Gflags_FOUND) 49 | if(Gflags_FIND_REQUIRED) 50 | message(FATAL_ERROR "Could not find gflags library.") 51 | endif(Gflags_FIND_REQUIRED) 52 | endif(Gflags_FOUND) 53 | -------------------------------------------------------------------------------- /cmake/Modules/FindNUMPY.cmake: -------------------------------------------------------------------------------- 1 | # This file was downloaded from 2 | # http://svn.lam.fr/repos/unsio/trunk/py/cmake/FindNumPy.cmake 3 | # - Find the NumPy libraries 4 | # This module finds if NumPy is installed, and sets the following variables 5 | # indicating where it is. 6 | # 7 | # TODO: Update to provide the libraries and paths for linking npymath lib. 8 | # 9 | # NUMPY_FOUND - was NumPy found 10 | # NUMPY_VERSION - the version of NumPy found as a string 11 | # NUMPY_VERSION_MAJOR - the major version number of NumPy 12 | # NUMPY_VERSION_MINOR - the minor version number of NumPy 13 | # NUMPY_VERSION_PATCH - the patch version number of NumPy 14 | # NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601 15 | # NUMPY_INCLUDE_DIRS - path to the NumPy include files 16 | 17 | #============================================================================ 18 | # Copyright 2012 Continuum Analytics, Inc. 19 | # 20 | # MIT License 21 | # 22 | # Permission is hereby granted, free of charge, to any person obtaining 23 | # a copy of this software and associated documentation files 24 | # (the "Software"), to deal in the Software without restriction, including 25 | # without limitation the rights to use, copy, modify, merge, publish, 26 | # distribute, sublicense, and/or sell copies of the Software, and to permit 27 | # persons to whom the Software is furnished to do so, subject to 28 | # the following conditions: 29 | # 30 | # The above copyright notice and this permission notice shall be included 31 | # in all copies or substantial portions of the Software. 32 | # 33 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 34 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 36 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 37 | # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 38 | # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 39 | # OTHER DEALINGS IN THE SOFTWARE. 40 | # 41 | #============================================================================ 42 | 43 | # 44 | # Example usage: 45 | # 46 | # # Passing the version means NUMPY_FOUND will only be TRUE if a 47 | # # version >= the provided version is found. 48 | # find_package(NUMPY 1.7) 49 | # if(NOT NUMPY_FOUND) 50 | # # Error handling 51 | # endif() 52 | # ... 53 | # include_directories(${NUMPY_INCLUDE_DIRS} ...) 54 | # 55 | 56 | # Finding NumPy involves calling the Python interpreter 57 | if(NumPy_FIND_REQUIRED) 58 | find_package(PythonInterp REQUIRED) 59 | else() 60 | find_package(PythonInterp) 61 | endif() 62 | 63 | if(NOT PYTHONINTERP_FOUND) 64 | set(NUMPY_FOUND FALSE) 65 | return() 66 | endif() 67 | 68 | execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" 69 | "import numpy as n; print(n.__version__); print(n.get_include());" 70 | RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS 71 | OUTPUT_VARIABLE _NUMPY_VALUES_OUTPUT 72 | ERROR_VARIABLE _NUMPY_ERROR_VALUE 73 | OUTPUT_STRIP_TRAILING_WHITESPACE) 74 | 75 | if(NOT _NUMPY_SEARCH_SUCCESS MATCHES 0) 76 | if(NumPy_FIND_REQUIRED) 77 | message(FATAL_ERROR 78 | "NumPy import failure:\n${_NUMPY_ERROR_VALUE}") 79 | endif() 80 | set(NUMPY_FOUND FALSE) 81 | return() 82 | endif() 83 | 84 | # Convert the process output into a list 85 | string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES_OUTPUT}) 86 | string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES}) 87 | # Just in case there is unexpected output from the Python command. 88 | list(GET _NUMPY_VALUES -2 NUMPY_VERSION) 89 | list(GET _NUMPY_VALUES -1 NUMPY_INCLUDE_DIRS) 90 | 91 | string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" _VER_CHECK "${NUMPY_VERSION}") 92 | if("${_VER_CHECK}" STREQUAL "") 93 | # The output from Python was unexpected. Raise an error always 94 | # here, because we found NumPy, but it appears to be corrupted somehow. 95 | message(FATAL_ERROR 96 | "Requested version and include path from NumPy, got instead:\n${_NUMPY_VALUES_OUTPUT}\n") 97 | return() 98 | endif() 99 | 100 | # Make sure all directory separators are '/' 101 | string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS}) 102 | 103 | # Get the major and minor version numbers 104 | string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION}) 105 | list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR) 106 | list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR) 107 | list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH) 108 | string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH}) 109 | math(EXPR NUMPY_VERSION_DECIMAL 110 | "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}") 111 | 112 | find_package_message(NUMPY 113 | "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}" 114 | "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}") 115 | 116 | set(NUMPY_FOUND TRUE) 117 | -------------------------------------------------------------------------------- /cmake/Modules/FindPoco.cmake: -------------------------------------------------------------------------------- 1 | # - Find the Poco includes and libraries. 2 | # The following variables are set if Poco is found. If Poco is not 3 | # found, Poco_FOUND is set to false. 4 | # Poco_FOUND - True when the Poco include directory is found. 5 | # Poco_INCLUDE_DIRS - the path to where the poco include files are. 6 | # Poco_LIBRARY_DIR - The path to where the poco library files are. 7 | # Poco_BINARY_DIRS - The path to where the poco dlls are. 8 | # Poco_LIBRARIES - list of all libs from requested components. 9 | 10 | # ---------------------------------------------------------------------------- 11 | # If you have installed Poco in a non-standard location. 12 | # Then you have three options. 13 | # In the following comments, it is assumed that 14 | # points to the root directory of the include directory of Poco. e.g 15 | # If you have put poco in C:\development\Poco then is 16 | # "C:/development/Poco" and in this directory there will be two 17 | # directories called "include" and "lib". 18 | # 1) After CMake runs, set Poco_INCLUDE_DIR to /poco<-version> 19 | # 2) Use CMAKE_INCLUDE_PATH to set a path to /poco<-version>. This will allow FIND_PATH() 20 | # to locate Poco_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. 21 | # SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/include") 22 | # 3) Set an environment variable called ${POCO_ROOT} that points to the root of where you have 23 | # installed Poco, e.g. . It is assumed that there is at least a subdirectory called 24 | # Foundation/include/Poco in this path. 25 | # 26 | # Note: 27 | # 1) If you are just using the poco headers, then you do not need to use 28 | # Poco_LIBRARY_DIR in your CMakeLists.txt file. 29 | # 2) If Poco has not been installed, then when setting Poco_LIBRARY_DIR 30 | # the script will look for /lib first and, if this fails, then for /stage/lib. 31 | # 32 | # Usage: 33 | # In your CMakeLists.txt file do something like this: 34 | # ... 35 | # # Poco 36 | # FIND_PACKAGE(Poco COMPONENTS XML Net Data...) 37 | # ... 38 | # INCLUDE_DIRECTORIES(${Poco_INCLUDE_DIRS}) 39 | # LINK_DIRECTORIES(${Poco_LIBRARY_DIR}) 40 | # 41 | # In Windows, we make the assumption that, if the Poco files are installed, the default directory 42 | # will be C:\poco or C:\Program Files\Poco or C:\Programme\Poco. 43 | 44 | MESSAGE(STATUS "Searching for Poco library...") 45 | 46 | SET(POCO_INCLUDE_PATH_DESCRIPTION "top-level directory containing the poco include directories. E.g /usr/local/include/ or c:\\poco\\include\\poco-1.3.2") 47 | SET(POCO_INCLUDE_DIR_MESSAGE "Set the Poco_INCLUDE_DIR cmake cache entry to the ${POCO_INCLUDE_PATH_DESCRIPTION}") 48 | SET(POCO_LIBRARY_PATH_DESCRIPTION "top-level directory containing the poco libraries.") 49 | SET(POCO_LIBRARY_DIR_MESSAGE "Set the Poco_LIBRARY_DIR cmake cache entry to the ${POCO_LIBRARY_PATH_DESCRIPTION}") 50 | 51 | 52 | SET(POCO_DIR_SEARCH $ENV{POCO_ROOT}) 53 | IF(POCO_DIR_SEARCH) 54 | FILE(TO_CMAKE_PATH ${POCO_DIR_SEARCH} POCO_DIR_SEARCH) 55 | ENDIF(POCO_DIR_SEARCH) 56 | 57 | 58 | IF(WIN32) 59 | SET(POCO_DIR_SEARCH 60 | ${POCO_DIR_SEARCH} 61 | C:/poco 62 | D:/poco 63 | "C:/Program Files/poco" 64 | "C:/Programme/poco" 65 | "D:/Program Files/poco" 66 | "D:/Programme/poco" 67 | ) 68 | ENDIF(WIN32) 69 | 70 | # Add in some path suffixes. These will have to be updated whenever a new Poco version comes out. 71 | SET(SUFFIX_FOR_INCLUDE_PATH 72 | poco-1.3.2 73 | poco-1.3.3 74 | poco-1.3.4 75 | poco-1.3.5 76 | poco-1.3.6 77 | ) 78 | 79 | SET(SUFFIX_FOR_LIBRARY_PATH 80 | poco-1.3.2/lib 81 | poco-1.3.2/lib/Linux/i686 82 | poco-1.3.2/lib/Linux/x86_64 83 | poco-1.3.3/lib 84 | poco-1.3.3/lib/Linux/i686 85 | poco-1.3.3/lib/Linux/x86_64 86 | poco-1.3.4/lib 87 | poco-1.3.4/lib/Linux/i686 88 | poco-1.3.4/lib/Linux/x86_64 89 | poco-1.3.5/lib 90 | poco-1.3.5/lib/Linux/i686 91 | poco-1.3.5/lib/Linux/x86_64 92 | poco-1.3.6/lib 93 | poco-1.3.6/lib/Linux/i686 94 | poco-1.3.6/lib/Linux/x86_64 95 | lib 96 | lib/Linux/i686 97 | lib/Linux/x86_64 98 | ) 99 | 100 | # 101 | # Look for an installation. 102 | # 103 | FIND_PATH(Poco_INCLUDE_DIR NAMES Foundation/include/Poco/SharedLibrary.h PATH_SUFFIXES ${SUFFIX_FOR_INCLUDE_PATH} PATHS 104 | 105 | # Look in other places. 106 | ${POCO_DIR_SEARCH} 107 | 108 | # Help the user find it if we cannot. 109 | DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}" 110 | ) 111 | 112 | IF(NOT Poco_INCLUDE_DIR) 113 | 114 | # Look for standard unix include paths 115 | FIND_PATH(Poco_INCLUDE_DIR Poco/Poco.h DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}") 116 | 117 | ENDIF(NOT Poco_INCLUDE_DIR) 118 | 119 | # Assume we didn't find it. 120 | SET(Poco_FOUND 0) 121 | 122 | # Now try to get the include and library path. 123 | IF(Poco_INCLUDE_DIR) 124 | IF(EXISTS "${Poco_INCLUDE_DIR}/Foundation/include/Poco/SharedLibrary.h") 125 | SET(Poco_INCLUDE_DIRS 126 | ${Poco_INCLUDE_DIR}/CppUnit/include 127 | ${Poco_INCLUDE_DIR}/Foundation/include 128 | ${Poco_INCLUDE_DIR}/Net/include 129 | ${Poco_INCLUDE_DIR}/Util/include 130 | ${Poco_INCLUDE_DIR}/XML/include 131 | ) 132 | SET(Poco_FOUND 1) 133 | ELSEIF(EXISTS "${Poco_INCLUDE_DIR}/Poco/Poco.h") 134 | SET(Poco_INCLUDE_DIRS 135 | ${Poco_INCLUDE_DIR} 136 | ) 137 | SET(Poco_FOUND 1) 138 | ENDIF() 139 | 140 | IF(NOT Poco_LIBRARY_DIR) 141 | 142 | FIND_LIBRARY(Poco_FOUNDATION_LIB NAMES PocoFoundation PocoFoundationd PATH_SUFFIXES ${SUFFIX_FOR_LIBRARY_PATH} PATHS 143 | 144 | # Look in other places. 145 | ${Poco_INCLUDE_DIR} 146 | ${POCO_DIR_SEARCH} 147 | 148 | # Help the user find it if we cannot. 149 | DOC "The ${POCO_LIBRARY_PATH_DESCRIPTION}" 150 | ) 151 | SET(Poco_LIBRARY_DIR "" CACHE PATH POCO_LIBARARY_PATH_DESCRIPTION) 152 | GET_FILENAME_COMPONENT(Poco_LIBRARY_DIR ${Poco_FOUNDATION_LIB} PATH) 153 | SET(Poco_LIBRARIES "") 154 | SET(Comp_List "") 155 | IF(Poco_LIBRARY_DIR AND Poco_FOUNDATION_LIB) 156 | # Look for the poco binary path. 157 | SET(Poco_BINARY_DIR ${Poco_INCLUDE_DIR}) 158 | IF(Poco_BINARY_DIR AND EXISTS "${Poco_BINARY_DIR}/bin") 159 | SET(Poco_BINARY_DIRS ${Poco_BINARY_DIR}/bin) 160 | ENDIF(Poco_BINARY_DIR AND EXISTS "${Poco_BINARY_DIR}/bin") 161 | ENDIF(Poco_LIBRARY_DIR AND Poco_FOUNDATION_LIB) 162 | SET(DBG "") 163 | IF(Poco_FOUNDATION_LIB) 164 | IF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") 165 | # Check that separate debug libraries are actually present. 166 | FIND_LIBRARY(LIBFoundation "PocoFoundationd" Poco_LIBRARY_DIR) 167 | IF(LIBFoundation) 168 | SET(DBG "d") 169 | ENDIF(LIBFoundation) 170 | ENDIF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") 171 | SET(Comp_List "Foundation${DBG}") 172 | FOREACH(COMPONENT ${Poco_FIND_COMPONENTS}) 173 | FIND_LIBRARY(LIB${COMPONENT} "Poco${COMPONENT}${DBG}" Poco_LIBRARY_DIR) 174 | IF (LIB${COMPONENT}) 175 | LIST(APPEND Poco_LIBRARIES "${LIB${COMPONENT}}") 176 | LIST(APPEND Comp_List "${COMPONENT}${DBG}") 177 | ENDIF(LIB${COMPONENT}) 178 | ENDFOREACH(COMPONENT) 179 | LIST(REMOVE_DUPLICATES Comp_List) 180 | ENDIF(Poco_FOUNDATION_LIB) 181 | ENDIF(NOT Poco_LIBRARY_DIR) 182 | ENDIF(Poco_INCLUDE_DIR) 183 | 184 | IF(NOT Poco_FOUND) 185 | IF(Poco_FIND_QUIETLY) 186 | MESSAGE(STATUS "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}") 187 | ELSE(Poco_FIND_QUIETLY) 188 | IF(Poco_FIND_REQUIRED) 189 | MESSAGE(FATAL_ERROR "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}") 190 | ENDIF(Poco_FIND_REQUIRED) 191 | ENDIF(Poco_FIND_QUIETLY) 192 | ELSE(NOT Poco_FOUND) 193 | MESSAGE(STATUS " Found Poco!") 194 | SET(COMPONENT_STR "components found:") 195 | FOREACH(comp ${Comp_List}) 196 | SET(COMPONENT_STR "${COMPONENT_STR}, ${comp}") 197 | 198 | ENDFOREACH(comp ${Comp_List}) 199 | STRING(REPLACE ":," ":" COMPONENT_LSTR ${COMPONENT_STR}) 200 | MESSAGE(STATUS "${COMPONENT_LSTR}.") 201 | ENDIF(NOT Poco_FOUND) 202 | 203 | #I added this in to add "libdl" on non-Windows systems. Technically dl is only neded if the "Foundation" component is used, 204 | #but i doesn't hurt to add it in anyway - mas 205 | if(Poco_FOUND AND NOT WIN32) 206 | LIST(APPEND Poco_LIBRARIES "dl") 207 | endif(Poco_FOUND AND NOT WIN32) 208 | -------------------------------------------------------------------------------- /cmake/Modules/FindTBB.cmake: -------------------------------------------------------------------------------- 1 | # Locate Intel Threading Building Blocks include paths and libraries 2 | # FindTBB.cmake can be found at https://code.google.com/p/findtbb/ 3 | # Written by Hannes Hofmann 4 | # Improvements by Gino van den Bergen , 5 | # Florian Uhlig , 6 | # Jiri Marsik 7 | 8 | # The MIT License 9 | # 10 | # Copyright (c) 2011 Hannes Hofmann 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to deal 14 | # in the Software without restriction, including without limitation the rights 15 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | # copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | # THE SOFTWARE. 29 | 30 | # GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler. 31 | # e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21" 32 | # TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found 33 | # in the TBB installation directory (TBB_INSTALL_DIR). 34 | # 35 | # GvdB: Mac OS X distribution places libraries directly in lib directory. 36 | # 37 | # For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER. 38 | # TBB_ARCHITECTURE [ ia32 | em64t | itanium ] 39 | # which architecture to use 40 | # TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9 41 | # which compiler to use (detected automatically on Windows) 42 | 43 | # This module respects 44 | # TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR} 45 | 46 | # This module defines 47 | # TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc. 48 | # TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc 49 | # TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug 50 | # TBB_INSTALL_DIR, the base TBB install directory 51 | # TBB_LIBRARIES, the libraries to link against to use TBB. 52 | # TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols. 53 | # TBB_FOUND, If false, don't try to use TBB. 54 | # TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h 55 | 56 | 57 | if (WIN32) 58 | # has em64t/vc8 em64t/vc9 59 | # has ia32/vc7.1 ia32/vc8 ia32/vc9 60 | set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB") 61 | set(_TBB_LIB_NAME "tbb") 62 | set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") 63 | set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") 64 | set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") 65 | if (MSVC71) 66 | set (_TBB_COMPILER "vc7.1") 67 | endif(MSVC71) 68 | if (MSVC80) 69 | set(_TBB_COMPILER "vc8") 70 | endif(MSVC80) 71 | if (MSVC90) 72 | set(_TBB_COMPILER "vc9") 73 | endif(MSVC90) 74 | if(MSVC10) 75 | set(_TBB_COMPILER "vc10") 76 | endif(MSVC10) 77 | # Todo: add other Windows compilers such as ICL. 78 | set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) 79 | endif (WIN32) 80 | 81 | if (UNIX) 82 | if (APPLE) 83 | # MAC 84 | set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions") 85 | # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug 86 | set(_TBB_LIB_NAME "tbb") 87 | set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") 88 | set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") 89 | set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") 90 | # default flavor on apple: ia32/cc4.0.1_os10.4.9 91 | # Jiri: There is no reason to presume there is only one flavor and 92 | # that user's setting of variables should be ignored. 93 | if(NOT TBB_COMPILER) 94 | set(_TBB_COMPILER "cc4.0.1_os10.4.9") 95 | elseif (NOT TBB_COMPILER) 96 | set(_TBB_COMPILER ${TBB_COMPILER}) 97 | endif(NOT TBB_COMPILER) 98 | if(NOT TBB_ARCHITECTURE) 99 | set(_TBB_ARCHITECTURE "ia32") 100 | elseif(NOT TBB_ARCHITECTURE) 101 | set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) 102 | endif(NOT TBB_ARCHITECTURE) 103 | else (APPLE) 104 | # LINUX 105 | set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include") 106 | set(_TBB_LIB_NAME "tbb") 107 | set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") 108 | set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") 109 | set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") 110 | # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21 111 | # has ia32/* 112 | # has itanium/* 113 | set(_TBB_COMPILER ${TBB_COMPILER}) 114 | set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) 115 | endif (APPLE) 116 | endif (UNIX) 117 | 118 | if (CMAKE_SYSTEM MATCHES "SunOS.*") 119 | # SUN 120 | # not yet supported 121 | # has em64t/cc3.4.3_kernel5.10 122 | # has ia32/* 123 | endif (CMAKE_SYSTEM MATCHES "SunOS.*") 124 | 125 | 126 | #-- Clear the public variables 127 | set (TBB_FOUND "NO") 128 | 129 | 130 | #-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR} 131 | # first: use CMake variable TBB_INSTALL_DIR 132 | if (TBB_INSTALL_DIR) 133 | set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR}) 134 | endif (TBB_INSTALL_DIR) 135 | # second: use environment variable 136 | if (NOT _TBB_INSTALL_DIR) 137 | if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "") 138 | set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR}) 139 | endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "") 140 | # Intel recommends setting TBB21_INSTALL_DIR 141 | if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "") 142 | set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR}) 143 | endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "") 144 | if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "") 145 | set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR}) 146 | endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "") 147 | if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "") 148 | set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR}) 149 | endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "") 150 | endif (NOT _TBB_INSTALL_DIR) 151 | # third: try to find path automatically 152 | if (NOT _TBB_INSTALL_DIR) 153 | if (_TBB_DEFAULT_INSTALL_DIR) 154 | set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR}) 155 | endif (_TBB_DEFAULT_INSTALL_DIR) 156 | endif (NOT _TBB_INSTALL_DIR) 157 | # sanity check 158 | if (NOT _TBB_INSTALL_DIR) 159 | message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}") 160 | else (NOT _TBB_INSTALL_DIR) 161 | # finally: set the cached CMake variable TBB_INSTALL_DIR 162 | if (NOT TBB_INSTALL_DIR) 163 | set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory") 164 | mark_as_advanced(TBB_INSTALL_DIR) 165 | endif (NOT TBB_INSTALL_DIR) 166 | 167 | 168 | #-- A macro to rewrite the paths of the library. This is necessary, because 169 | # find_library() always found the em64t/vc9 version of the TBB libs 170 | macro(TBB_CORRECT_LIB_DIR var_name) 171 | # if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t") 172 | string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) 173 | # endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t") 174 | string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) 175 | string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) 176 | string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) 177 | string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) 178 | string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) 179 | endmacro(TBB_CORRECT_LIB_DIR var_content) 180 | 181 | 182 | #-- Look for include directory and set ${TBB_INCLUDE_DIR} 183 | set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include) 184 | # Jiri: tbbvars now sets the CPATH environment variable to the directory 185 | # containing the headers. 186 | find_path(TBB_INCLUDE_DIR 187 | tbb/task_scheduler_init.h 188 | PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH 189 | ) 190 | mark_as_advanced(TBB_INCLUDE_DIR) 191 | 192 | 193 | #-- Look for libraries 194 | # GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh] 195 | if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") 196 | set (_TBB_LIBRARY_DIR 197 | ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM} 198 | ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib 199 | ) 200 | endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") 201 | # Jiri: This block isn't mutually exclusive with the previous one 202 | # (hence no else), instead I test if the user really specified 203 | # the variables in question. 204 | if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "")) 205 | # HH: deprecated 206 | message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).") 207 | # Jiri: It doesn't hurt to look in more places, so I store the hints from 208 | # ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER 209 | # variables and search them both. 210 | set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR}) 211 | endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "")) 212 | 213 | # GvdB: Mac OS X distribution places libraries directly in lib directory. 214 | list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib) 215 | 216 | # Jiri: No reason not to check the default paths. From recent versions, 217 | # tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH 218 | # variables, which now point to the directories of the lib files. 219 | # It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS 220 | # argument instead of the implicit PATHS as it isn't hard-coded 221 | # but computed by system introspection. Searching the LIBRARY_PATH 222 | # and LD_LIBRARY_PATH environment variables is now even more important 223 | # that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates 224 | # the use of TBB built from sources. 225 | find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR} 226 | PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) 227 | find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR} 228 | PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) 229 | 230 | #Extract path from TBB_LIBRARY name 231 | get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH) 232 | 233 | #TBB_CORRECT_LIB_DIR(TBB_LIBRARY) 234 | #TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY) 235 | mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY) 236 | 237 | #-- Look for debug libraries 238 | # Jiri: Changed the same way as for the release libraries. 239 | find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} 240 | PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) 241 | find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} 242 | PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) 243 | 244 | # Jiri: Self-built TBB stores the debug libraries in a separate directory. 245 | # Extract path from TBB_LIBRARY_DEBUG name 246 | get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH) 247 | 248 | #TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG) 249 | #TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG) 250 | mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG) 251 | 252 | 253 | if (TBB_INCLUDE_DIR) 254 | if (TBB_LIBRARY) 255 | set (TBB_FOUND "YES") 256 | set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES}) 257 | set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES}) 258 | set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE) 259 | set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE) 260 | # Jiri: Self-built TBB stores the debug libraries in a separate directory. 261 | set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE) 262 | mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES) 263 | message(STATUS "Found Intel TBB") 264 | endif (TBB_LIBRARY) 265 | endif (TBB_INCLUDE_DIR) 266 | 267 | if (NOT TBB_FOUND) 268 | message("ERROR: Intel TBB NOT found!") 269 | message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}") 270 | # do only throw fatal, if this pkg is REQUIRED 271 | if (TBB_FIND_REQUIRED) 272 | message(FATAL_ERROR "Could NOT find TBB library.") 273 | endif (TBB_FIND_REQUIRED) 274 | endif (NOT TBB_FOUND) 275 | 276 | endif (NOT _TBB_INSTALL_DIR) 277 | 278 | if (TBB_FOUND) 279 | set(TBB_INTERFACE_VERSION 0) 280 | FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS) 281 | STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}") 282 | set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}") 283 | endif (TBB_FOUND) 284 | -------------------------------------------------------------------------------- /cmake/Modules/FindTinyXML.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################################## 2 | # 3 | # CMake script for finding TinyXML. 4 | # 5 | # Input variables: 6 | # 7 | # - TinyXML_ROOT_DIR (optional): When specified, header files and libraries will be searched for in 8 | # ${TinyXML_ROOT_DIR}/include 9 | # ${TinyXML_ROOT_DIR}/libs 10 | # respectively, and the default CMake search order will be ignored. When unspecified, the default 11 | # CMake search order is used. 12 | # This variable can be specified either as a CMake or environment variable. If both are set, 13 | # preference is given to the CMake variable. 14 | # Use this variable for finding packages installed in a nonstandard location, or for enforcing 15 | # that one of multiple package installations is picked up. 16 | # 17 | # 18 | # Cache variables (not intended to be used in CMakeLists.txt files) 19 | # 20 | # - TinyXML_INCLUDE_DIR: Absolute path to package headers. 21 | # - TinyXML_LIBRARY: Absolute path to library. 22 | # 23 | # 24 | # Output variables: 25 | # 26 | # - TinyXML_FOUND: Boolean that indicates if the package was found 27 | # - TinyXML_INCLUDE_DIRS: Paths to the necessary header files 28 | # - TinyXML_LIBRARIES: Package libraries 29 | # 30 | # 31 | # Example usage: 32 | # 33 | # find_package(TinyXML) 34 | # if(NOT TinyXML_FOUND) 35 | # # Error handling 36 | # endif() 37 | # ... 38 | # include_directories(${TinyXML_INCLUDE_DIRS} ...) 39 | # ... 40 | # target_link_libraries(my_target ${TinyXML_LIBRARIES}) 41 | # 42 | ################################################################################################## 43 | 44 | # Get package location hint from environment variable (if any) 45 | if(NOT TinyXML_ROOT_DIR AND DEFINED ENV{TinyXML_ROOT_DIR}) 46 | set(TinyXML_ROOT_DIR "$ENV{TinyXML_ROOT_DIR}" CACHE PATH 47 | "TinyXML base directory location (optional, used for nonstandard installation paths)") 48 | endif() 49 | 50 | # Search path for nonstandard package locations 51 | if(TinyXML_ROOT_DIR) 52 | set(TinyXML_INCLUDE_PATH PATHS "${TinyXML_ROOT_DIR}/include" NO_DEFAULT_PATH) 53 | set(TinyXML_LIBRARY_PATH PATHS "${TinyXML_ROOT_DIR}/lib" NO_DEFAULT_PATH) 54 | endif() 55 | 56 | # Find headers and libraries 57 | find_path(TinyXML_INCLUDE_DIR NAMES tinyxml.h PATH_SUFFIXES "tinyxml" ${TinyXML_INCLUDE_PATH}) 58 | find_library(TinyXML_LIBRARY NAMES tinyxml PATH_SUFFIXES "tinyxml" ${TinyXML_LIBRARY_PATH}) 59 | 60 | mark_as_advanced(TinyXML_INCLUDE_DIR 61 | TinyXML_LIBRARY) 62 | 63 | # Output variables generation 64 | include(FindPackageHandleStandardArgs) 65 | find_package_handle_standard_args(TinyXML DEFAULT_MSG TinyXML_LIBRARY 66 | TinyXML_INCLUDE_DIR) 67 | 68 | set(TinyXML_FOUND ${TINYXML_FOUND}) # Enforce case-correctness: Set appropriately cased variable... 69 | unset(TINYXML_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args 70 | 71 | if(TinyXML_FOUND) 72 | set(TinyXML_INCLUDE_DIRS ${TinyXML_INCLUDE_DIR}) 73 | set(TinyXML_LIBRARIES ${TinyXML_LIBRARY}) 74 | endif() 75 | -------------------------------------------------------------------------------- /cmake/Modules/FindTinyXML2.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################################## 2 | # 3 | # CMake script for finding TinyXML2. 4 | # 5 | # Input variables: 6 | # 7 | # - TinyXML2_ROOT_DIR (optional): When specified, header files and libraries will be searched for in 8 | # ${TinyXML2_ROOT_DIR}/include 9 | # ${TinyXML2_ROOT_DIR}/libs 10 | # respectively, and the default CMake search order will be ignored. When unspecified, the default 11 | # CMake search order is used. 12 | # This variable can be specified either as a CMake or environment variable. If both are set, 13 | # preference is given to the CMake variable. 14 | # Use this variable for finding packages installed in a nonstandard location, or for enforcing 15 | # that one of multiple package installations is picked up. 16 | # 17 | # 18 | # Cache variables (not intended to be used in CMakeLists.txt files) 19 | # 20 | # - TinyXML2_INCLUDE_DIR: Absolute path to package headers. 21 | # - TinyXML2_LIBRARY: Absolute path to library. 22 | # 23 | # 24 | # Output variables: 25 | # 26 | # - TinyXML2_FOUND: Boolean that indicates if the package was found 27 | # - TinyXML2_INCLUDE_DIRS: Paths to the necessary header files 28 | # - TinyXML2_LIBRARIES: Package libraries 29 | # 30 | # 31 | # Example usage: 32 | # 33 | # find_package(TinyXML2) 34 | # if(NOT TinyXML2_FOUND) 35 | # # Error handling 36 | # endif() 37 | # ... 38 | # include_directories(${TinyXML2_INCLUDE_DIRS} ...) 39 | # ... 40 | # target_link_libraries(my_target ${TinyXML2_LIBRARIES}) 41 | # 42 | ################################################################################################## 43 | 44 | # Get package location hint from environment variable (if any) 45 | if(NOT TinyXML2_ROOT_DIR AND DEFINED ENV{TinyXML2_ROOT_DIR}) 46 | set(TinyXML2_ROOT_DIR "$ENV{TinyXML2_ROOT_DIR}" CACHE PATH 47 | "TinyXML2 base directory location (optional, used for nonstandard installation paths)") 48 | endif() 49 | 50 | # Search path for nonstandard package locations 51 | if(TinyXML2_ROOT_DIR) 52 | set(TinyXML2_INCLUDE_PATH PATHS "${TinyXML2_ROOT_DIR}/include" NO_DEFAULT_PATH) 53 | set(TinyXML2_LIBRARY_PATH PATHS "${TinyXML2_ROOT_DIR}/lib" NO_DEFAULT_PATH) 54 | endif() 55 | 56 | # Find headers and libraries 57 | find_path(TinyXML2_INCLUDE_DIR NAMES tinyxml2.h PATH_SUFFIXES "tinyxml2" ${TinyXML2_INCLUDE_PATH}) 58 | find_library(TinyXML2_LIBRARY NAMES tinyxml2 PATH_SUFFIXES "tinyxml2" ${TinyXML2_LIBRARY_PATH}) 59 | 60 | mark_as_advanced(TinyXML2_INCLUDE_DIR 61 | TinyXML2_LIBRARY) 62 | 63 | # Output variables generation 64 | include(FindPackageHandleStandardArgs) 65 | find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TinyXML2_LIBRARY 66 | TinyXML2_INCLUDE_DIR) 67 | 68 | set(TinyXML2_FOUND ${TINYXML2_FOUND}) # Enforce case-correctness: Set appropriately cased variable... 69 | unset(TINYXML2_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args 70 | 71 | if(TinyXML2_FOUND) 72 | set(TinyXML2_INCLUDE_DIRS ${TinyXML2_INCLUDE_DIR}) 73 | set(TinyXML2_LIBRARIES ${TinyXML2_LIBRARY}) 74 | endif() 75 | -------------------------------------------------------------------------------- /cmake/Modules/FindUUID.cmake: -------------------------------------------------------------------------------- 1 | # Locate the include paths and libraries for the UUID libraries. On 2 | # Windows this locates the Rpcrt4 library. On macOS uuid is provided 3 | # by the the macOS SDK, so it is always indicated as found 4 | # 5 | # UUID_FOUND - was libuuid (Linux or OSX) or Rpcrt4 (Windows) found 6 | # UUID_INCLUDE_DIRS - path to the UUID include files. On Windows and macOS this variable 7 | # is left empty, but you should still add it to your CMakeLists.txt to ensure 8 | # portability 9 | # UUID_LIBRARIES - full path to the libraries 10 | if(APPLE) 11 | set(UUID_FOUND true) 12 | set(UUID_INCLUDE_DIRS "") 13 | set(UUID_LIBRARIES "") 14 | elseif(WIN32) 15 | find_library(UUID_LIBRARIES NAMES Rpcrt4 PATH) 16 | 17 | if(UUID_LIBRARIES) 18 | set(UUID_FOUND true) 19 | endif(UUID_LIBRARIES) 20 | 21 | else() 22 | find_path(UUID_INCLUDE_DIRS uuid/uuid.h) 23 | find_library(UUID_LIBRARIES NAMES uuid PATH) 24 | 25 | if(UUID_INCLUDE_DIRS) 26 | set(UUID_FOUND true) 27 | endif(UUID_INCLUDE_DIRS) 28 | 29 | if(NOT UUID_LIBRARIES) 30 | set(UUID_LIBRARIES "") 31 | endif(NOT UUID_LIBRARIES) 32 | 33 | endif(WIN32) 34 | 35 | if(NOT UUID_FOUND) 36 | if(UUID_FIND_REQUIRED) 37 | if(WIN32) 38 | message(FATAL_ERROR "Could not find Rpcrt4") 39 | else() 40 | message(FATAL_ERROR "Could not find UUID") 41 | endif(WIN32) 42 | endif(UUID_FIND_REQUIRED) 43 | endif(NOT UUID_FOUND) 44 | -------------------------------------------------------------------------------- /cmake/Modules/FindXenomai.cmake: -------------------------------------------------------------------------------- 1 | # (C) Copyright 2005-2014 Johns Hopkins University (JHU), All Rights 2 | # Reserved. 3 | # 4 | # --- begin cisst license - do not edit --- 5 | # 6 | # This software is provided "as is" under an open source license, with 7 | # no warranty. The complete license can be found in license.txt and 8 | # http://www.cisst.org/cisst/license.txt. 9 | # 10 | # --- end cisst license --- 11 | # 12 | # CMake script for finding Xenomai 13 | # 14 | # This will find Xenomai on Linux systems and define flags for each of the 15 | # supported Xenomai "skins". The current supported skins are: 16 | # 17 | # - NATIVE 18 | # - POSIX 19 | # 20 | # Input variables: 21 | # 22 | # - ${Xenomai_ROOT_DIR} (optional): Used as a hint to find the Xenomai root dir 23 | # - $ENV{XENOMAI_ROOT_DIR} (optional): Used as a hint to find the Xenomai root dir 24 | # 25 | # Cache variables: 26 | # 27 | # - Xenomai_ROOT_DIR 28 | # - Xenomai_INCLUDE_DIRS 29 | # 30 | # Output Variables: 31 | # 32 | # - Xenomai_FOUND: Boolean that indicates if the package was found. See the 33 | # Xenomai_*_FOUND variables below for individual skins. 34 | # - Xenomai_VERSION: major.minor.patch Xenomai version string 35 | # - Xenomai_XENO_CONFIG: Path to xeno-config program 36 | # 37 | # - Individual library variables: 38 | # - Xenomai_LIBRARY_XENOMAI 39 | # - Xenomai_LIBRARY_NATIVE 40 | # - Xenomai_LIBRARY_PTHREAD_RT 41 | # - Xenomai_LIBRARY_RTDM 42 | # - Xenomai_LIBRARY_RTDK ( this will be empty, deprecated after Xenomai 2.6.0) 43 | # 44 | # - Native Flags: 45 | # - Xenomai_NATIVE_FOUND: Boolean that indicates if the native skin was found 46 | # - Xenomai_NATIVE_DEFINITIONS 47 | # - Xenomai_NATIVE_INCLUDE_DIRS 48 | # - Xenomai_NATIVE_LIBRARY_DIRS 49 | # - Xenomai_NATIVE_LIBRARIES 50 | # - Xenomai_NATIVE_LDFLAGS 51 | # 52 | # - POSIX Flags: 53 | # - Xenomai_POSIX_FOUND: Boolean that indicates if the posix skin was found 54 | # - Xenomai_POSIX_DEFINITIONS 55 | # - Xenomai_POSIX_INCLUDE_DIRS 56 | # - Xenomai_POSIX_LIBRARY_DIRS 57 | # - Xenomai_POSIX_LIBRARIES 58 | # - Xenomai_POSIX_LDFLAGS 59 | # 60 | # - RTDM Flags: 61 | # - Xenomai_RTDM_FOUND: Boolean that indicates if the RTDM skin was found 62 | # - Xenomai_RTDM_DEFINITIONS 63 | # - Xenomai_RTDM_INCLUDE_DIRS 64 | # - Xenomai_RTDM_LIBRARY_DIRS 65 | # - Xenomai_RTDM_LIBRARIES 66 | # - Xenomai_RTDM_LDFLAGS 67 | 68 | if( UNIX ) 69 | 70 | # Get hint from environment variable (if any) 71 | if(NOT $ENV{XENOMAI_ROOT_DIR} STREQUAL "") 72 | set(XENOMAI_ROOT_DIR $ENV{XENOMAI_ROOT_DIR} CACHE PATH "Xenomai base directory location (optional, used for nonstandard installation paths)" FORCE) 73 | mark_as_advanced(XENOMAI_ROOT_DIR) 74 | endif() 75 | 76 | # set the search paths 77 | set( Xenomai_SEARCH_PATH /usr/local /usr $ENV{XENOMAI_ROOT_DIR} ${Xenomai_ROOT_DIR}) 78 | 79 | # find xeno_config.h 80 | find_path( Xenomai_INCLUDE_DIR 81 | xeno_config.h 82 | PATHS ${Xenomai_SEARCH_PATH} 83 | PATH_SUFFIXES xenomai include xenomai/include include/xenomai 84 | ) 85 | 86 | # did we find xeno_config.h? 87 | if(Xenomai_INCLUDE_DIR) 88 | MESSAGE(STATUS "xenomai found: \"${Xenomai_INCLUDE_DIR}\"") 89 | 90 | # set the root directory 91 | if( "${Xenomai_INCLUDE_DIR}" MATCHES "/usr/include/xenomai" ) 92 | # on ubuntu linux, xenomai install is not rooted to a single dir 93 | set( Xenomai_ROOT_DIR /usr CACHE PATH "The Xenomai FHS root") 94 | set( Xenomai_INCLUDE_POSIX_DIR ${Xenomai_INCLUDE_DIR}/posix ) 95 | else() 96 | # elsewhere, xenomai install is packaged 97 | get_filename_component(Xenomai_ROOT_DIR ${Xenomai_INCLUDE_DIR} PATH CACHE) 98 | set( Xenomai_INCLUDE_POSIX_DIR ${Xenomai_ROOT_DIR}/include/posix ) 99 | endif() 100 | 101 | # Find xeno-config 102 | find_program(Xenomai_XENO_CONFIG NAMES xeno-config PATHS ${Xenomai_ROOT_DIR}/bin NO_DEFAULT_PATH) 103 | 104 | # get xenomai version 105 | execute_process(COMMAND ${Xenomai_XENO_CONFIG} --version OUTPUT_VARIABLE Xenomai_VERSION) 106 | 107 | # find the xenomai pthread library 108 | find_library( Xenomai_LIBRARY_NATIVE native ${Xenomai_ROOT_DIR}/lib ) 109 | find_library( Xenomai_LIBRARY_XENOMAI xenomai ${Xenomai_ROOT_DIR}/lib ) 110 | find_library( Xenomai_LIBRARY_PTHREAD_RT pthread_rt ${Xenomai_ROOT_DIR}/lib ) 111 | find_library( Xenomai_LIBRARY_RTDM rtdm ${Xenomai_ROOT_DIR}/lib ) 112 | 113 | # In 2.6.0 RTDK was merged into the main xenomai library 114 | if(Xenomai_VERSION VERSION_GREATER 2.6.0) 115 | set(Xenomai_LIBRARY_RTDK_FOUND ${Xenomai_LIBRARY_XENOMAI_FOUND}) 116 | set(Xenomai_LIBRARY_RTDK ${Xenomai_LIBRARY_XENOMAI}) 117 | else() 118 | find_library( Xenomai_LIBRARY_RTDK rtdk ${Xenomai_ROOT_DIR}/lib ) 119 | endif() 120 | 121 | # Xenomai libraries for each skin 122 | set(Xenomai_NATIVE_LIBRARIES ${Xenomai_LIBRARY_NATIVE} ${Xenomai_LIBRARY_XENOMAI} pthread) 123 | set(Xenomai_POSIX_LIBRARIES ${Xenomai_LIBRARY_PTHREAD_RT} ${Xenomai_LIBRARY_XENOMAI} pthread rt) 124 | set(Xenomai_RTDM_LIBRARIES ${Xenomai_LIBRARY_RTDM} ${Xenomai_LIBRARY_XENOMAI} pthread rt) 125 | 126 | # Xenomai LDFLAGS for each skin 127 | set(Xenomai_NATIVE_LDFLAGS "") 128 | set(Xenomai_POSIX_LDFLAGS "-Wl,@${Xenomai_ROOT_DIR}/lib/posix.wrappers") 129 | set(Xenomai_RTDM_LDFLAGS "") 130 | 131 | # Xenomai compiler definitions for each supported skin 132 | set(Xenomai_NATIVE_DEFINITIONS -D_GNU_SOURCE -D_REENTRANT -D__XENO__) 133 | set(Xenomai_POSIX_DEFINITIONS ${Xenomai_NATIVE_DEFINITIONS}) 134 | set(Xenomai_RTDM_DEFINITIONS ${Xenomai_NATIVE_DEFINITIONS}) 135 | 136 | # Xenomai library dirs for each skin 137 | set( Xenomai_NATIVE_LIBRARY_DIRS ${Xenomai_ROOT_DIR}/lib ) 138 | set( Xenomai_POSIX_LIBRARY_DIRS ${Xenomai_NATIVE_LIBRARY_DIRS} ) 139 | set( Xenomai_RTDM_LIBRARY_DIRS ${Xenomai_NATIVE_LIBRARY_DIRS} ) 140 | 141 | # Xenomai library dirs for each skin 142 | set( Xenomai_NATIVE_INCLUDE_DIRS ${Xenomai_INCLUDE_DIR} ) 143 | set( Xenomai_POSIX_INCLUDE_DIRS ${Xenomai_INCLUDE_DIR} ${Xenomai_INCLUDE_POSIX_DIR} ) 144 | set( Xenomai_RTDM_INCLUDE_DIRS ${Xenomai_INCLUDE_DIR} ) 145 | 146 | # Compatibility 147 | set( Xenomai_LIBRARIES 148 | ${Xenomai_LIBRARY_XENOMAI} 149 | ${Xenomai_LIBRARY_NATIVE} 150 | ${Xenomai_LIBRARY_PTHREAD_RT} 151 | ${Xenomai_LIBRARY_RTDM} 152 | ${Xenomai_LIBRARY_RTDK} 153 | ) 154 | 155 | else( ) 156 | MESSAGE(STATUS "Xenomai NOT found in paths: (${Xenomai_SEARCH_PATH})") 157 | endif( ) 158 | 159 | endif( UNIX ) 160 | 161 | include(FindPackageHandleStandardArgs) 162 | 163 | find_package_handle_standard_args(Xenomai DEFAULT_MSG 164 | Xenomai_ROOT_DIR 165 | Xenomai_INCLUDE_DIR 166 | Xenomai_LIBRARY_XENOMAI 167 | Xenomai_LIBRARY_RTDK 168 | ) 169 | 170 | set(Xenomai_FOUND ${XENOMAI_FOUND}) # Set appropriately cased variable 171 | 172 | if(Xenomai_LIBRARY_XENOMAI AND Xenomai_LIBRARY_NATIVE) 173 | message(STATUS "Xenomai Native skin found") 174 | set(Xenomai_NATIVE_FOUND True) 175 | endif() 176 | 177 | if(Xenomai_LIBRARY_XENOMAI AND Xenomai_LIBRARY_PTHREAD_RT) 178 | message(STATUS "Xenomai POSIX skin found") 179 | set(Xenomai_POSIX_FOUND True) 180 | endif() 181 | 182 | if(Xenomai_LIBRARY_XENOMAI AND Xenomai_LIBRARY_RTDM) 183 | message(STATUS "Xenomai RTDM skin found") 184 | set(Xenomai_RTDM_FOUND True) 185 | endif() 186 | 187 | -------------------------------------------------------------------------------- /cmake/cmake_modules-extras.cmake.develspace.in: -------------------------------------------------------------------------------- 1 | # Append cmake modules from source directory to the cmake module path 2 | list(APPEND CMAKE_MODULE_PATH "@CMAKE_CURRENT_SOURCE_DIR@/cmake/Modules") 3 | -------------------------------------------------------------------------------- /cmake/cmake_modules-extras.cmake.installspace.in: -------------------------------------------------------------------------------- 1 | # Append the installed cmake modules to the cmake module path 2 | list(APPEND CMAKE_MODULE_PATH "${cmake_modules_DIR}/../../../@CATKIN_PACKAGE_SHARE_DESTINATION@/cmake/Modules") 3 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | cmake_modules 4 | 0.5.2 5 | A common repository for CMake Modules which are not distributed with CMake but are commonly used by ROS packages. 6 | 7 | Mabel Zhang 8 | 9 | BSD 10 | 11 | https://github.com/ros/cmake_modules 12 | https://github.com/ros/cmake_modules/issues 13 | 14 | William Woodall 15 | 16 | catkin 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/test_find_tinyxml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(test_find_tinyxml) 3 | 4 | find_package(catkin REQUIRED COMPONENTS cmake_modules) 5 | 6 | find_package(TinyXML REQUIRED) 7 | 8 | message("TinyXML_FOUND: ${TinyXML_FOUND}") 9 | message("TinyXML_INCLUDE_DIRS: ${TinyXML_INCLUDE_DIRS}") 10 | message("TinyXML_LIBRARIES: ${TinyXML_LIBRARIES}") 11 | 12 | catkin_package( 13 | # INCLUDE ${TinyXML_INCLUDE_DIRS} # Include this if one of your headers uses a header from TinyXML_INCLUDE_DIRS 14 | # LIBRARIES ${TinyXML_LIBRARIES} # Include this if people who link against you need to link against TinyXML too 15 | # # OR 16 | # DEPENDS TinyXML # Use this if you would use both of the above lines 17 | ) 18 | -------------------------------------------------------------------------------- /tests/test_find_tinyxml/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_find_tinyxml 4 | 0.0.0 5 | Test package to find TinyXML 6 | 7 | Mabel Zhang 8 | 9 | BSD 10 | 11 | William Woodall 12 | 13 | catkin 14 | cmake_modules 15 | 16 | 17 | --------------------------------------------------------------------------------