pax_global_header00006660000000000000000000000064124554421200014511gustar00rootroot0000000000000052 comment=bacf5962e310f17b7ab6ae2e7fe0b3b08dde8679 ros-cmake-modules-0.4.0/000077500000000000000000000000001245544212000150415ustar00rootroot00000000000000ros-cmake-modules-0.4.0/.gitignore000066400000000000000000000001221245544212000170240ustar00rootroot00000000000000CMakeCache.txt CMakeFiles Makefile cmake_install.cmake install_manifest.txt build ros-cmake-modules-0.4.0/CHANGELOG.rst000066400000000000000000000042671245544212000170730ustar00rootroot00000000000000^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Changelog for package cmake_modules ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 0.4.0 (2014-12-25) ------------------ * The Eigen module provided by this package has been deprecated. There is now a CMake warning to encourage people to use the Module provided by Eigen instead. * Contributors: William Woodall 0.3.3 (2014-12-23) ------------------ * Added FindPoco.cmake, which migrated from the ros/class_loader repository. * Update to FindXenomai.cmake find_package_handle_standard_args generates all caps variables (XENOMAI_FOUND), while this script is expected to create Xenomai_FOUND. 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). * Contributors: Adolfo Rodriguez Tsouroukdissian, Esteve Fernandez, William Woodall 0.3.2 (2014-10-27) ------------------ * Added CMake module for finding the UUID libraries * Changed prepend of CMAKE_MODULE_PATH to append behaviour in order to allow prepending of external CMake modules. * Added CMake module for finding GSL * Contributors: Esteve Fernandez, Peter Lehner, William Woodall, v01d 0.3.1 (2014-05-07) ------------------ * Export architecture_independent flag in package.xml * Fix extended CMAKE_MODULE_PATH variable when path contains spaces * Mention the sequencing reqirement with an example * Contributors: Dirk Thomas, Paul Mathieu, Scott K Logan, Tully Foote, William Woodall, phuicy 0.3.0 (2014-02-22) ------------------ * Added Numpy CMake module * Added Eigen CMake module closed `#10 `_ * Removed use of absolute paths in extra files fixed `#9 `_ * Contributors: Vincent Rabaud, William Woodall 0.2.1 (2014-01-24) ------------------ * Adding CMake module for finding Xenomai RT kernel patch build flags * Contributors: Jonathan Bohren, William Woodall 0.2.0 (2013-12-04) ------------------ * Added FindTBB.cmake version r36 from the findtbb package * TinyXML: Add more comprehensive header documentation. 0.1.0 (2013-07-24) ------------------ * Initial release, includes the FindTinyXML.cmake CMake module ros-cmake-modules-0.4.0/CMakeLists.txt000066400000000000000000000004101245544212000175740ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8.3) project(cmake_modules) find_package(catkin REQUIRED) catkin_package(CFG_EXTRAS cmake_modules-extras.cmake) ## Install all cmake files install(DIRECTORY cmake/Modules DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake) ros-cmake-modules-0.4.0/CONTRIBUTING.md000066400000000000000000000061251245544212000172760ustar00rootroot00000000000000## Contributing a new CMake Module First of all lets talk about the difference in a CMake module and a CMake config. 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`. 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. These are some similar repositories which contain several CMake modules, which CMake itself does not distribute: - https://github.com/rpavlik/cmake-modules - http://code.google.com/p/mgep/source/browse/branches/clientv2/CMakeModules This package should exclusively contain **CMake modules** since config files should be distributed by the packages to which they apply. 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: http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules ## CMake Module Style When contributing a new CMake module for this package, please follow these guidelines: - The module should be placed in the `cmake/Modules` directory of this package - It should take the name `Find.cmake` - For example `FindTinyXML.cmake` - The module should **at least** provide these variables: - `_FOUND` - `_INCLUDE_DIRS` - `_LIBRARIES` - It may provide other variables but they must be documented at the top of the module file. - The module must provide documentation for each variable it sets and give an example of usage 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`. A complete description of the recommended convention for writing CMake modules can be found here: http://www.cmake.org/cmake/help/v3.0/manual/cmake-developer.7.html#find-modules ## Long term contribution 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. So consider contributing your CMake modules upstream to CMake, details here: http://www.cmake.org/cmake/project/getinvolved.html ros-cmake-modules-0.4.0/LICENSE000066400000000000000000000027431245544212000160540ustar00rootroot00000000000000Copyright (c) 2013, Open Source Robotics Foundation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 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. Neither the name of the {organization} nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 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. ros-cmake-modules-0.4.0/README.md000066400000000000000000000047311245544212000163250ustar00rootroot00000000000000cmake_modules ============= A common repository for CMake Modules which are not distributed with CMake but are commonly used by ROS packages. See the CONTRIBUTING.md file in this repository before submitting pull requests for new modules. ROS Distros ----------- 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: - `0.2-devel`: - ROS Groovy - `0.3-devel`: - ROS Hydro - ROS Indigo - `0.4-devel`: - ROS Jade This mapping will be kept up-to-date in the `README.md` on the default branch. Provided Modules ---------------- 1. [**NumPy**](http://www.numpy.org/) is the fundamental package for scientific computing with Python. 1. [**TBB**](https://www.threadingbuildingblocks.org/) lets you easily write parallel C++ programs that take full advantage of multicore performance. 1. [**TinyXML**](http://www.grinninglizard.com/tinyxml/) is a simple, small, C++ XML parser. 1. [**Xenomai**](http://www.xenomai.org/) is a real-time development framework cooperating with the Linux kernel. 1. [**GSL**](http://www.gnu.org/software/gsl/) is a numerical library for C and C++ programmers. 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. Usage ----- To use the CMake modules provided by this catkin package, you must `` on it in your `package.xml`, like so: ```xml cmake_modules ``` Then you must `find_package` it in your `CMakeLists.txt` along with your other catkin build dependencies: ```cmake find_package(catkin REQUIRED COMPONENTS ... cmake_modules ...) ``` OR by `find_package`'ing it directly: ```cmake find_package(cmake_modules REQUIRED) ``` 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: ```cmake find_package(TinyXML REQUIRED) ``` ### Lookup sheet ##### Eigen [Deprecated] ```cmake find_package(Eigen REQUIRED) ``` ##### NumPY ```cmake find_package(NUMPY REQUIRED) ``` ##### TBB ```cmake find_package(TBB REQUIRED) ``` ##### TinyXML ```cmake find_package(TinyXML REQUIRED) ``` ##### Xenomai ```cmake find_package(Xenomai REQUIRED) ``` ### FindGSL ```cmake find_package(GSL REQUIRED) ``` ros-cmake-modules-0.4.0/cmake/000077500000000000000000000000001245544212000161215ustar00rootroot00000000000000ros-cmake-modules-0.4.0/cmake/Modules/000077500000000000000000000000001245544212000175315ustar00rootroot00000000000000ros-cmake-modules-0.4.0/cmake/Modules/FindEigen.cmake000066400000000000000000000063501245544212000223670ustar00rootroot00000000000000# # NOTICE! This module is deprecated and the FindEigen3.cmake which is # distributed with Eigen should now be used. # ############################################################################### # # CMake script for finding the Eigen library. # # http://eigen.tuxfamily.org/index.php?title=Main_Page # # Copyright (c) 2006, 2007 Montel Laurent, # Copyright (c) 2008, 2009 Gael Guennebaud, # Copyright (c) 2009 Benoit Jacob # Redistribution and use is allowed according to the terms of the 2-clause BSD # license. # # # Input variables: # # - Eigen_ROOT_DIR (optional): When specified, header files and libraries # will be searched for in `${Eigen_ROOT_DIR}/include` and # `${Eigen_ROOT_DIR}/libs` respectively, and the default CMake search order # will be ignored. When unspecified, the default CMake search order is used. # This variable can be specified either as a CMake or environment variable. # If both are set, preference is given to the CMake variable. # Use this variable for finding packages installed in a nonstandard location, # or for enforcing that one of multiple package installations is picked up. # # Cache variables (not intended to be used in CMakeLists.txt files) # # - Eigen_INCLUDE_DIR: Absolute path to package headers. # # # Output variables: # # - Eigen_FOUND: Boolean that indicates if the package was found # - Eigen_INCLUDE_DIRS: Paths to the necessary header files # - Eigen_VERSION: Version of Eigen library found # - Eigen_DEFINITIONS: Definitions to be passed on behalf of eigen # # # Example usage: # # # Passing the version means Eigen_FOUND will only be TRUE if a # # version >= the provided version is found. # find_package(Eigen 3.1.2) # if(NOT Eigen_FOUND) # # Error handling # endif() # ... # add_definitions(${Eigen_DEFINITIONS}) # ... # include_directories(${Eigen_INCLUDE_DIRS} ...) # ############################################################################### find_package(PkgConfig) pkg_check_modules(PC_EIGEN eigen3) set(EIGEN_DEFINITIONS ${PC_EIGEN_CFLAGS_OTHER}) message(WARNING "The FindEigen.cmake Module in the cmake_modules package is deprecated.\n" "Please use the FindEigen3.cmake Module provided with Eigen. " "Change instances of find_package(Eigen) to find_package(Eigen3). " "Check the FindEigen3.cmake Module for the resulting CMake variable names.\n" ) find_path(EIGEN_INCLUDE_DIR Eigen/Core HINTS ${PC_EIGEN_INCLUDEDIR} ${PC_EIGEN_INCLUDE_DIRS} "${Eigen_ROOT_DIR}" "$ENV{EIGEN_ROOT_DIR}" "${EIGEN_ROOT}" "$ENV{EIGEN_ROOT}" # Backwards Compatibility PATHS "$ENV{PROGRAMFILES}/Eigen" "$ENV{PROGRAMW6432}/Eigen" "$ENV{PROGRAMFILES}/Eigen 3.0.0" "$ENV{PROGRAMW6432}/Eigen 3.0.0" PATH_SUFFIXES eigen3 include/eigen3 include) set(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR) mark_as_advanced(EIGEN_INCLUDE_DIR) if(EIGEN_FOUND) message(STATUS "Eigen found (include: ${EIGEN_INCLUDE_DIRS})") endif(EIGEN_FOUND) set(Eigen_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}) set(Eigen_FOUND ${EIGEN_FOUND}) set(Eigen_VERSION ${EIGEN_VERSION}) set(Eigen_DEFINITIONS ${EIGEN_DEFINITIONS}) ros-cmake-modules-0.4.0/cmake/Modules/FindGSL.cmake000066400000000000000000000110661245544212000217650ustar00rootroot00000000000000# Try to find gnu scientific library GSL # See # http://www.gnu.org/software/gsl/ and # http://gnuwin32.sourceforge.net/packages/gsl.htm # # Once run this will define: # # GSL_FOUND = system has GSL lib # # GSL_LIBRARIES = full path to the libraries # on Unix/Linux with additional linker flags from "gsl-config --libs" # # CMAKE_GSL_CXX_FLAGS = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`" # # GSL_INCLUDE_DIRS = where to find headers # # GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix # GSL_EXE_LINKER_FLAGS = rpath on Unix # # Felix Woelk 07/2004 # Jan Woetzel # # www.mip.informatik.uni-kiel.de # -------------------------------- IF(WIN32) # JW tested with gsl-1.8, Windows XP, MSVS 7.1, MSVS 8.0 SET(GSL_POSSIBLE_ROOT_DIRS ${GSL_ROOT_DIR} $ENV{GSL_ROOT_DIR} ${GSL_DIR} ${GSL_HOME} $ENV{GSL_DIR} $ENV{GSL_HOME} $ENV{EXTERN_LIBS_DIR}/gsl $ENV{EXTRA} # "C:/home/jw/source2/gsl-1.8" ) FIND_PATH(GSL_INCLUDE_DIRS NAMES gsl/gsl_cdf.h gsl/gsl_randist.h PATHS ${GSL_POSSIBLE_ROOT_DIRS} PATH_SUFFIXES include DOC "GSL header include dir" ) FIND_LIBRARY(GSL_GSL_LIBRARY NAMES gsl libgsl PATHS ${GSL_POSSIBLE_ROOT_DIRS} PATH_SUFFIXES lib DOC "GSL library dir" ) FIND_LIBRARY(GSL_GSLCBLAS_LIBRARY NAMES gslcblas libgslcblas PATHS ${GSL_POSSIBLE_ROOT_DIRS} PATH_SUFFIXES lib DOC "GSL cblas library dir" ) SET(GSL_LIBRARIES ${GSL_GSL_LIBRARY}) #MESSAGE("DBG\n" # "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n" # "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n" # "GSL_LIBRARIES=${GSL_LIBRARIES}") ELSE(WIN32) IF(UNIX) SET(GSL_CONFIG_PREFER_PATH "$ENV{GSL_DIR}/bin" "$ENV{GSL_DIR}" "$ENV{GSL_HOME}/bin" "$ENV{GSL_HOME}" CACHE STRING "preferred path to GSL (gsl-config)") FIND_PROGRAM(GSL_CONFIG gsl-config ${GSL_CONFIG_PREFER_PATH} /usr/bin/ ) # MESSAGE("DBG GSL_CONFIG ${GSL_CONFIG}") IF (GSL_CONFIG) MESSAGE(STATUS "GSL using gsl-config ${GSL_CONFIG}") # set CXXFLAGS to be fed into CXX_FLAGS by the user: EXEC_PROGRAM(${GSL_CONFIG} ARGS --cflags OUTPUT_VARIABLE GSL_CXX_FLAGS ) #SET(GSL_CXX_FLAGS "`${GSL_CONFIG} --cflags`") # set INCLUDE_DIRS to prefix+include EXEC_PROGRAM(${GSL_CONFIG} ARGS --prefix OUTPUT_VARIABLE GSL_PREFIX) SET(GSL_INCLUDE_DIRS ${GSL_PREFIX}/include CACHE STRING INTERNAL) # set link libraries and link flags #SET(GSL_LIBRARIES "`${GSL_CONFIG} --libs`") # extract link dirs for rpath EXEC_PROGRAM(${GSL_CONFIG} ARGS --libs OUTPUT_VARIABLE GSL_CONFIG_LIBS ) SET(GSL_LIBRARIES "${GSL_CONFIG_LIBS}") # split off the link dirs (for rpath) # use regular expression to match wildcard equivalent "-L*" # with is a space or a semicolon STRING(REGEX MATCHALL "[-][L]([^ ;])+" GSL_LINK_DIRECTORIES_WITH_PREFIX "${GSL_CONFIG_LIBS}" ) # MESSAGE("DBG GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}") # remove prefix -L because we need the pure directory for LINK_DIRECTORIES IF (GSL_LINK_DIRECTORIES_WITH_PREFIX) STRING(REGEX REPLACE "[-][L]" "" GSL_LINK_DIRECTORIES ${GSL_LINK_DIRECTORIES_WITH_PREFIX} ) ENDIF (GSL_LINK_DIRECTORIES_WITH_PREFIX) SET(GSL_EXE_LINKER_FLAGS "-Wl,-rpath,${GSL_LINK_DIRECTORIES}" CACHE STRING INTERNAL) # MESSAGE("DBG GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}") # MESSAGE("DBG GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}") # ADD_DEFINITIONS("-DHAVE_GSL") # SET(GSL_DEFINITIONS "-DHAVE_GSL") MARK_AS_ADVANCED( GSL_CXX_FLAGS GSL_INCLUDE_DIRS GSL_LIBRARIES GSL_LINK_DIRECTORIES GSL_DEFINITIONS ) MESSAGE(STATUS "Using GSL from ${GSL_PREFIX}") ELSE(GSL_CONFIG) INCLUDE(UsePkgConfig) #needed for PKGCONFIG(...) MESSAGE(STATUS "GSL using pkgconfig") # PKGCONFIG(gsl includedir libdir linkflags cflags) PKGCONFIG(gsl GSL_INCLUDE_DIRS GSL_LINK_DIRECTORIES GSL_LIBRARIES GSL_CXX_FLAGS) IF(GSL_INCLUDE_DIRS) MARK_AS_ADVANCED( GSL_CXX_FLAGS GSL_INCLUDE_DIRS GSL_LIBRARIES GSL_LINK_DIRECTORIES ) ELSE(GSL_INCLUDE_DIRS) MESSAGE("FindGSL.cmake: gsl-config/pkg-config gsl not found. Please set it manually. GSL_CONFIG=${GSL_CONFIG}") ENDIF(GSL_INCLUDE_DIRS) ENDIF(GSL_CONFIG) ENDIF(UNIX) ENDIF(WIN32) IF(GSL_LIBRARIES) IF(GSL_INCLUDE_DIRS OR GSL_CXX_FLAGS) SET(GSL_FOUND 1) ENDIF(GSL_INCLUDE_DIRS OR GSL_CXX_FLAGS) ENDIF(GSL_LIBRARIES) # ========================================== IF(NOT GSL_FOUND) # make FIND_PACKAGE friendly IF(NOT GSL_FIND_QUIETLY) IF(GSL_FIND_REQUIRED) MESSAGE(FATAL_ERROR "GSL required, please specify it's location.") ELSE(GSL_FIND_REQUIRED) MESSAGE(STATUS "ERROR: GSL was not found.") ENDIF(GSL_FIND_REQUIRED) ENDIF(NOT GSL_FIND_QUIETLY) ENDIF(NOT GSL_FOUND) ros-cmake-modules-0.4.0/cmake/Modules/FindNUMPY.cmake000066400000000000000000000104141245544212000222440ustar00rootroot00000000000000# This file was downloaded from # http://svn.lam.fr/repos/unsio/trunk/py/cmake/FindNumPy.cmake # - Find the NumPy libraries # This module finds if NumPy is installed, and sets the following variables # indicating where it is. # # TODO: Update to provide the libraries and paths for linking npymath lib. # # NUMPY_FOUND - was NumPy found # NUMPY_VERSION - the version of NumPy found as a string # NUMPY_VERSION_MAJOR - the major version number of NumPy # NUMPY_VERSION_MINOR - the minor version number of NumPy # NUMPY_VERSION_PATCH - the patch version number of NumPy # NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601 # NUMPY_INCLUDE_DIRS - path to the NumPy include files #============================================================================ # Copyright 2012 Continuum Analytics, Inc. # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # #============================================================================ # # Example usage: # # # Passing the version means NUMPY_FOUND will only be TRUE if a # # version >= the provided version is found. # find_package(NUMPY 1.7) # if(NOT NUMPY_FOUND) # # Error handling # endif() # ... # include_directories(${NUMPY_INCLUDE_DIRS} ...) # # Finding NumPy involves calling the Python interpreter if(NumPy_FIND_REQUIRED) find_package(PythonInterp REQUIRED) else() find_package(PythonInterp) endif() if(NOT PYTHONINTERP_FOUND) set(NUMPY_FOUND FALSE) return() endif() execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import numpy as n; print(n.__version__); print(n.get_include());" RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS OUTPUT_VARIABLE _NUMPY_VALUES_OUTPUT ERROR_VARIABLE _NUMPY_ERROR_VALUE OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT _NUMPY_SEARCH_SUCCESS MATCHES 0) if(NumPy_FIND_REQUIRED) message(FATAL_ERROR "NumPy import failure:\n${_NUMPY_ERROR_VALUE}") endif() set(NUMPY_FOUND FALSE) return() endif() # Convert the process output into a list string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES_OUTPUT}) string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES}) # Just in case there is unexpected output from the Python command. list(GET _NUMPY_VALUES -2 NUMPY_VERSION) list(GET _NUMPY_VALUES -1 NUMPY_INCLUDE_DIRS) string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" _VER_CHECK "${NUMPY_VERSION}") if("${_VER_CHECK}" STREQUAL "") # The output from Python was unexpected. Raise an error always # here, because we found NumPy, but it appears to be corrupted somehow. message(FATAL_ERROR "Requested version and include path from NumPy, got instead:\n${_NUMPY_VALUES_OUTPUT}\n") return() endif() # Make sure all directory separators are '/' string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS}) # Get the major and minor version numbers string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION}) list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR) list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR) list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH) string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH}) math(EXPR NUMPY_VERSION_DECIMAL "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}") find_package_message(NUMPY "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}" "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}") set(NUMPY_FOUND TRUE) ros-cmake-modules-0.4.0/cmake/Modules/FindPoco.cmake000066400000000000000000000157701245544212000222460ustar00rootroot00000000000000# - Find the Poco includes and libraries. # The following variables are set if Poco is found. If Poco is not # found, Poco_FOUND is set to false. # Poco_FOUND - True when the Poco include directory is found. # Poco_INCLUDE_DIRS - the path to where the poco include files are. # Poco_LIBRARY_DIR - The path to where the poco library files are. # Poco_BINARY_DIRS - The path to where the poco dlls are. # Poco_LIBRARIES - list of all libs from requested components. # ---------------------------------------------------------------------------- # If you have installed Poco in a non-standard location. # Then you have three options. # In the following comments, it is assumed that # points to the root directory of the include directory of Poco. e.g # If you have put poco in C:\development\Poco then is # "C:/development/Poco" and in this directory there will be two # directories called "include" and "lib". # 1) After CMake runs, set Poco_INCLUDE_DIR to /poco<-version> # 2) Use CMAKE_INCLUDE_PATH to set a path to /poco<-version>. This will allow FIND_PATH() # to locate Poco_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. # SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/include") # 3) Set an environment variable called ${POCO_ROOT} that points to the root of where you have # installed Poco, e.g. . It is assumed that there is at least a subdirectory called # Foundation/include/Poco in this path. # # Note: # 1) If you are just using the poco headers, then you do not need to use # Poco_LIBRARY_DIR in your CMakeLists.txt file. # 2) If Poco has not been installed, then when setting Poco_LIBRARY_DIR # the script will look for /lib first and, if this fails, then for /stage/lib. # # Usage: # In your CMakeLists.txt file do something like this: # ... # # Poco # FIND_PACKAGE(Poco COMPONENTS XML Net Data...) # ... # INCLUDE_DIRECTORIES(${Poco_INCLUDE_DIRS}) # LINK_DIRECTORIES(${Poco_LIBRARY_DIR}) # # In Windows, we make the assumption that, if the Poco files are installed, the default directory # will be C:\poco or C:\Program Files\Poco or C:\Programme\Poco. MESSAGE(STATUS "Searching for Poco library...") 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") SET(POCO_INCLUDE_DIR_MESSAGE "Set the Poco_INCLUDE_DIR cmake cache entry to the ${POCO_INCLUDE_PATH_DESCRIPTION}") SET(POCO_LIBRARY_PATH_DESCRIPTION "top-level directory containing the poco libraries.") SET(POCO_LIBRARY_DIR_MESSAGE "Set the Poco_LIBRARY_DIR cmake cache entry to the ${POCO_LIBRARY_PATH_DESCRIPTION}") SET(POCO_DIR_SEARCH $ENV{POCO_ROOT}) IF(POCO_DIR_SEARCH) FILE(TO_CMAKE_PATH ${POCO_DIR_SEARCH} POCO_DIR_SEARCH) ENDIF(POCO_DIR_SEARCH) IF(WIN32) SET(POCO_DIR_SEARCH ${POCO_DIR_SEARCH} C:/poco D:/poco "C:/Program Files/poco" "C:/Programme/poco" "D:/Program Files/poco" "D:/Programme/poco" ) ENDIF(WIN32) # Add in some path suffixes. These will have to be updated whenever a new Poco version comes out. SET(SUFFIX_FOR_INCLUDE_PATH poco-1.3.2 poco-1.3.3 poco-1.3.4 poco-1.3.5 poco-1.3.6 ) SET(SUFFIX_FOR_LIBRARY_PATH poco-1.3.2/lib poco-1.3.2/lib/Linux/i686 poco-1.3.2/lib/Linux/x86_64 poco-1.3.3/lib poco-1.3.3/lib/Linux/i686 poco-1.3.3/lib/Linux/x86_64 poco-1.3.4/lib poco-1.3.4/lib/Linux/i686 poco-1.3.4/lib/Linux/x86_64 poco-1.3.5/lib poco-1.3.5/lib/Linux/i686 poco-1.3.5/lib/Linux/x86_64 poco-1.3.6/lib poco-1.3.6/lib/Linux/i686 poco-1.3.6/lib/Linux/x86_64 lib lib/Linux/i686 lib/Linux/x86_64 ) # # Look for an installation. # FIND_PATH(Poco_INCLUDE_DIR NAMES Foundation/include/Poco/SharedLibrary.h PATH_SUFFIXES ${SUFFIX_FOR_INCLUDE_PATH} PATHS # Look in other places. ${POCO_DIR_SEARCH} # Help the user find it if we cannot. DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}" ) IF(NOT Poco_INCLUDE_DIR) # Look for standard unix include paths FIND_PATH(Poco_INCLUDE_DIR Poco/Poco.h DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}") ENDIF(NOT Poco_INCLUDE_DIR) # Assume we didn't find it. SET(Poco_FOUND 0) # Now try to get the include and library path. IF(Poco_INCLUDE_DIR) IF(EXISTS "${Poco_INCLUDE_DIR}/Foundation/include/Poco/SharedLibrary.h") SET(Poco_INCLUDE_DIRS ${Poco_INCLUDE_DIR}/CppUnit/include ${Poco_INCLUDE_DIR}/Foundation/include ${Poco_INCLUDE_DIR}/Net/include ${Poco_INCLUDE_DIR}/Util/include ${Poco_INCLUDE_DIR}/XML/include ) SET(Poco_FOUND 1) ELSEIF(EXISTS "${Poco_INCLUDE_DIR}/Poco/Poco.h") SET(Poco_INCLUDE_DIRS ${Poco_INCLUDE_DIR} ) SET(Poco_FOUND 1) ENDIF() IF(NOT Poco_LIBRARY_DIR) FIND_LIBRARY(Poco_FOUNDATION_LIB NAMES PocoFoundation PocoFoundationd PATH_SUFFIXES ${SUFFIX_FOR_LIBRARY_PATH} PATHS # Look in other places. ${Poco_INCLUDE_DIR} ${POCO_DIR_SEARCH} # Help the user find it if we cannot. DOC "The ${POCO_LIBRARY_PATH_DESCRIPTION}" ) SET(Poco_LIBRARY_DIR "" CACHE PATH POCO_LIBARARY_PATH_DESCRIPTION) GET_FILENAME_COMPONENT(Poco_LIBRARY_DIR ${Poco_FOUNDATION_LIB} PATH) SET(Poco_LIBRARIES "") SET(Comp_List "") IF(Poco_LIBRARY_DIR AND Poco_FOUNDATION_LIB) # Look for the poco binary path. SET(Poco_BINARY_DIR ${Poco_INCLUDE_DIR}) IF(Poco_BINARY_DIR AND EXISTS "${Poco_BINARY_DIR}/bin") SET(Poco_BINARY_DIRS ${Poco_BINARY_DIR}/bin) ENDIF(Poco_BINARY_DIR AND EXISTS "${Poco_BINARY_DIR}/bin") ENDIF(Poco_LIBRARY_DIR AND Poco_FOUNDATION_LIB) IF(Poco_FOUNDATION_LIB) IF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") SET(DBG "d") ELSE ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") SET(DBG "") ENDIF ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") SET(Comp_List "Foundation${DBG}") FOREACH(COMPONENT ${Poco_FIND_COMPONENTS}) FIND_LIBRARY(LIB${COMPONENT} "Poco${COMPONENT}${DBG}" Poco_LIBRARY_DIR) IF (LIB${COMPONENT}) LIST(APPEND Poco_LIBRARIES "${LIB${COMPONENT}}") LIST(APPEND Comp_List "${COMPONENT}${DBG}") ENDIF(LIB${COMPONENT}) ENDFOREACH(COMPONENT) LIST(REMOVE_DUPLICATES Comp_List) ENDIF(Poco_FOUNDATION_LIB) ENDIF(NOT Poco_LIBRARY_DIR) ENDIF(Poco_INCLUDE_DIR) IF(NOT Poco_FOUND) IF(Poco_FIND_QUIETLY) MESSAGE(STATUS "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}") ELSE(Poco_FIND_QUIETLY) IF(Poco_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}") ENDIF(Poco_FIND_REQUIRED) ENDIF(Poco_FIND_QUIETLY) ELSE(NOT Poco_FOUND) MESSAGE(STATUS " Found Poco!") SET(COMPONENT_STR "components found:") FOREACH(comp ${Comp_List}) SET(COMPONENT_STR "${COMPONENT_STR}, ${comp}") ENDFOREACH(comp ${Comp_List}) STRING(REPLACE ":," ":" COMPONENT_LSTR ${COMPONENT_STR}) MESSAGE(STATUS "${COMPONENT_LSTR}.") ENDIF(NOT Poco_FOUND) #I added this in to add "libdl" on non-Windows systems. Technically dl is only neded if the "Foundation" component is used, #but i doesn't hurt to add it in anyway - mas if(Poco_FOUND AND NOT WIN32) LIST(APPEND Poco_LIBRARIES "dl") endif(Poco_FOUND AND NOT WIN32) ros-cmake-modules-0.4.0/cmake/Modules/FindTBB.cmake000066400000000000000000000315731245544212000217540ustar00rootroot00000000000000# Locate Intel Threading Building Blocks include paths and libraries # FindTBB.cmake can be found at https://code.google.com/p/findtbb/ # Written by Hannes Hofmann # Improvements by Gino van den Bergen , # Florian Uhlig , # Jiri Marsik # The MIT License # # Copyright (c) 2011 Hannes Hofmann # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler. # e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21" # TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found # in the TBB installation directory (TBB_INSTALL_DIR). # # GvdB: Mac OS X distribution places libraries directly in lib directory. # # For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER. # TBB_ARCHITECTURE [ ia32 | em64t | itanium ] # which architecture to use # TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9 # which compiler to use (detected automatically on Windows) # This module respects # TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR} # This module defines # TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc. # TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc # TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug # TBB_INSTALL_DIR, the base TBB install directory # TBB_LIBRARIES, the libraries to link against to use TBB. # TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols. # TBB_FOUND, If false, don't try to use TBB. # TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h if (WIN32) # has em64t/vc8 em64t/vc9 # has ia32/vc7.1 ia32/vc8 ia32/vc9 set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB") set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") if (MSVC71) set (_TBB_COMPILER "vc7.1") endif(MSVC71) if (MSVC80) set(_TBB_COMPILER "vc8") endif(MSVC80) if (MSVC90) set(_TBB_COMPILER "vc9") endif(MSVC90) if(MSVC10) set(_TBB_COMPILER "vc10") endif(MSVC10) # Todo: add other Windows compilers such as ICL. set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) endif (WIN32) if (UNIX) if (APPLE) # MAC set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions") # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") # default flavor on apple: ia32/cc4.0.1_os10.4.9 # Jiri: There is no reason to presume there is only one flavor and # that user's setting of variables should be ignored. if(NOT TBB_COMPILER) set(_TBB_COMPILER "cc4.0.1_os10.4.9") elseif (NOT TBB_COMPILER) set(_TBB_COMPILER ${TBB_COMPILER}) endif(NOT TBB_COMPILER) if(NOT TBB_ARCHITECTURE) set(_TBB_ARCHITECTURE "ia32") elseif(NOT TBB_ARCHITECTURE) set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) endif(NOT TBB_ARCHITECTURE) else (APPLE) # LINUX set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include") set(_TBB_LIB_NAME "tbb") set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc") set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug") set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") # 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 # has ia32/* # has itanium/* set(_TBB_COMPILER ${TBB_COMPILER}) set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) endif (APPLE) endif (UNIX) if (CMAKE_SYSTEM MATCHES "SunOS.*") # SUN # not yet supported # has em64t/cc3.4.3_kernel5.10 # has ia32/* endif (CMAKE_SYSTEM MATCHES "SunOS.*") #-- Clear the public variables set (TBB_FOUND "NO") #-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR} # first: use CMake variable TBB_INSTALL_DIR if (TBB_INSTALL_DIR) set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR}) endif (TBB_INSTALL_DIR) # second: use environment variable if (NOT _TBB_INSTALL_DIR) if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "") set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR}) endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "") # Intel recommends setting TBB21_INSTALL_DIR if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "") set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR}) endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "") if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "") set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR}) endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "") if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "") set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR}) endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "") endif (NOT _TBB_INSTALL_DIR) # third: try to find path automatically if (NOT _TBB_INSTALL_DIR) if (_TBB_DEFAULT_INSTALL_DIR) set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR}) endif (_TBB_DEFAULT_INSTALL_DIR) endif (NOT _TBB_INSTALL_DIR) # sanity check if (NOT _TBB_INSTALL_DIR) message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}") else (NOT _TBB_INSTALL_DIR) # finally: set the cached CMake variable TBB_INSTALL_DIR if (NOT TBB_INSTALL_DIR) set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory") mark_as_advanced(TBB_INSTALL_DIR) endif (NOT TBB_INSTALL_DIR) #-- A macro to rewrite the paths of the library. This is necessary, because # find_library() always found the em64t/vc9 version of the TBB libs macro(TBB_CORRECT_LIB_DIR var_name) # if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t") string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) # endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t") string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) endmacro(TBB_CORRECT_LIB_DIR var_content) #-- Look for include directory and set ${TBB_INCLUDE_DIR} set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include) # Jiri: tbbvars now sets the CPATH environment variable to the directory # containing the headers. find_path(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH ) mark_as_advanced(TBB_INCLUDE_DIR) #-- Look for libraries # GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh] if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") set (_TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM} ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib ) endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") # Jiri: This block isn't mutually exclusive with the previous one # (hence no else), instead I test if the user really specified # the variables in question. if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "")) # HH: deprecated 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]).") # Jiri: It doesn't hurt to look in more places, so I store the hints from # ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER # variables and search them both. set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR}) endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "")) # GvdB: Mac OS X distribution places libraries directly in lib directory. list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib) # Jiri: No reason not to check the default paths. From recent versions, # tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH # variables, which now point to the directories of the lib files. # It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS # argument instead of the implicit PATHS as it isn't hard-coded # but computed by system introspection. Searching the LIBRARY_PATH # and LD_LIBRARY_PATH environment variables is now even more important # that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates # the use of TBB built from sources. find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR} PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR} PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) #Extract path from TBB_LIBRARY name get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH) #TBB_CORRECT_LIB_DIR(TBB_LIBRARY) #TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY) mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY) #-- Look for debug libraries # Jiri: Changed the same way as for the release libraries. find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) # Jiri: Self-built TBB stores the debug libraries in a separate directory. # Extract path from TBB_LIBRARY_DEBUG name get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH) #TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG) #TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG) mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG) if (TBB_INCLUDE_DIR) if (TBB_LIBRARY) set (TBB_FOUND "YES") set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES}) set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES}) set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE) set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE) # Jiri: Self-built TBB stores the debug libraries in a separate directory. set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE) mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES) message(STATUS "Found Intel TBB") endif (TBB_LIBRARY) endif (TBB_INCLUDE_DIR) if (NOT TBB_FOUND) message("ERROR: Intel TBB NOT found!") message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}") # do only throw fatal, if this pkg is REQUIRED if (TBB_FIND_REQUIRED) message(FATAL_ERROR "Could NOT find TBB library.") endif (TBB_FIND_REQUIRED) endif (NOT TBB_FOUND) endif (NOT _TBB_INSTALL_DIR) if (TBB_FOUND) set(TBB_INTERFACE_VERSION 0) FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS) STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}") set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}") endif (TBB_FOUND) ros-cmake-modules-0.4.0/cmake/Modules/FindTinyXML.cmake000066400000000000000000000054151245544212000226450ustar00rootroot00000000000000################################################################################################## # # CMake script for finding TinyXML. # # Input variables: # # - TinyXML_ROOT_DIR (optional): When specified, header files and libraries will be searched for in # ${TinyXML_ROOT_DIR}/include # ${TinyXML_ROOT_DIR}/libs # respectively, and the default CMake search order will be ignored. When unspecified, the default # CMake search order is used. # This variable can be specified either as a CMake or environment variable. If both are set, # preference is given to the CMake variable. # Use this variable for finding packages installed in a nonstandard location, or for enforcing # that one of multiple package installations is picked up. # # # Cache variables (not intended to be used in CMakeLists.txt files) # # - TinyXML_INCLUDE_DIR: Absolute path to package headers. # - TinyXML_LIBRARY: Absolute path to library. # # # Output variables: # # - TinyXML_FOUND: Boolean that indicates if the package was found # - TinyXML_INCLUDE_DIRS: Paths to the necessary header files # - TinyXML_LIBRARIES: Package libraries # # # Example usage: # # find_package(TinyXML) # if(NOT TinyXML_FOUND) # # Error handling # endif() # ... # include_directories(${TinyXML_INCLUDE_DIRS} ...) # ... # target_link_libraries(my_target ${TinyXML_LIBRARIES}) # ################################################################################################## # Get package location hint from environment variable (if any) if(NOT TinyXML_ROOT_DIR AND DEFINED ENV{TinyXML_ROOT_DIR}) set(TinyXML_ROOT_DIR "$ENV{TinyXML_ROOT_DIR}" CACHE PATH "TinyXML base directory location (optional, used for nonstandard installation paths)") endif() # Search path for nonstandard package locations if(TinyXML_ROOT_DIR) set(TinyXML_INCLUDE_PATH PATHS "${TinyXML_ROOT_DIR}/include" NO_DEFAULT_PATH) set(TinyXML_LIBRARY_PATH PATHS "${TinyXML_ROOT_DIR}/lib" NO_DEFAULT_PATH) endif() # Find headers and libraries find_path(TinyXML_INCLUDE_DIR NAMES tinyxml.h PATH_SUFFIXES "tinyxml" ${TinyXML_INCLUDE_PATH}) find_library(TinyXML_LIBRARY NAMES tinyxml PATH_SUFFIXES "tinyxml" ${TinyXML_LIBRARY_PATH}) mark_as_advanced(TinyXML_INCLUDE_DIR TinyXML_LIBRARY) # Output variables generation include(FindPackageHandleStandardArgs) find_package_handle_standard_args(TinyXML DEFAULT_MSG TinyXML_LIBRARY TinyXML_INCLUDE_DIR) set(TinyXML_FOUND ${TINYXML_FOUND}) # Enforce case-correctness: Set appropriately cased variable... unset(TINYXML_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args if(TinyXML_FOUND) set(TinyXML_INCLUDE_DIRS ${TinyXML_INCLUDE_DIR}) set(TinyXML_LIBRARIES ${TinyXML_LIBRARY}) endif() ros-cmake-modules-0.4.0/cmake/Modules/FindUUID.cmake000066400000000000000000000020121245544212000220750ustar00rootroot00000000000000# Locate the include paths and libraries for the UUID libraries. On # Windows this locates the Rpcrt4 library # # UUID_FOUND - was libuuid (Linux or OSX) or Rpcrt4 (Windows) found # UUID_INCLUDE_DIRS - path to the UUID include files. On Windows this variable # is left empty, but you should still add it to your CMakeLists.txt to ensure # portability # UUID_LIBRARIES - full path to the libraries if(WIN32) find_library(UUID_LIBRARIES NAMES Rpcrt4 PATH) if(UUID_LIBRARIES) set(UUID_FOUND true) endif(UUID_LIBRARIES) else() find_path(UUID_INCLUDE_DIRS uuid/uuid.h) find_library(UUID_LIBRARIES NAMES uuid PATH) if(UUID_INCLUDE_DIRS) set(UUID_FOUND true) endif(UUID_INCLUDE_DIRS) if(NOT UUID_LIBRARIES) set(UUID_LIBRARIES "") endif(NOT UUID_LIBRARIES) endif(WIN32) if(NOT UUID_FOUND) if(UUID_FIND_REQUIRED) if(WIN32) message(FATAL_ERROR "Could not find Rpcrt4") else() message(FATAL_ERROR "Could not find UUID") endif(WIN32) endif(UUID_FIND_REQUIRED) endif(NOT UUID_FOUND) ros-cmake-modules-0.4.0/cmake/Modules/FindXenomai.cmake000066400000000000000000000146611245544212000227440ustar00rootroot00000000000000# (C) Copyright 2005-2014 Johns Hopkins University (JHU), All Rights # Reserved. # # --- begin cisst license - do not edit --- # # This software is provided "as is" under an open source license, with # no warranty. The complete license can be found in license.txt and # http://www.cisst.org/cisst/license.txt. # # --- end cisst license --- # # CMake script for finding Xenomai # # This will find Xenomai on Linux systems and define flags for each of the # supported Xenomai "skins". The current supported skins are: # # - NATIVE # - POSIX # # Input variables: # # - ${Xenomai_ROOT_DIR} (optional): Used as a hint to find the Xenomai root dir # - $ENV{XENOMAI_ROOT_DIR} (optional): Used as a hint to find the Xenomai root dir # # Cache variables: # # - Xenomai_ROOT_DIR # - Xenomai_INCLUDE_DIRS # # Output Variables: # # - Xenomai_FOUND: Boolean that indicates if the package was found. See the # Xenomai_*_FOUND variables below for individual skins. # - Xenomai_VERSION: major.minor.patch Xenomai version string # - Xenomai_XENO_CONFIG: Path to xeno-config program # # - Individual library variables: # - Xenomai_LIBRARY_XENOMAI # - Xenomai_LIBRARY_NATIVE # - Xenomai_LIBRARY_PTHREAD_RT # - Xenomai_LIBRARY_RTDM # - Xenomai_LIBRARY_RTDK ( this will be empty, deprecated after Xenomai 2.6.0) # # - Native Flags: # - Xenomai_NATIVE_FOUND: Boolean that indicates if the native skin was found # - Xenomai_NATIVE_DEFINITIONS # - Xenomai_NATIVE_INCLUDE_DIRS # - Xenomai_NATIVE_LIBRARY_DIRS # - Xenomai_NATIVE_LIBRARIES # - Xenomai_NATIVE_LDFLAGS # # - POSIX Flags: # - Xenomai_POSIX_FOUND: Boolean that indicates if the posix skin was found # - Xenomai_POSIX_DEFINITIONS # - Xenomai_POSIX_INCLUDE_DIRS # - Xenomai_POSIX_LIBRARY_DIRS # - Xenomai_POSIX_LIBRARIES # - Xenomai_POSIX_LDFLAGS # # - RTDM Flags: # - Xenomai_RTDM_FOUND: Boolean that indicates if the RTDM skin was found # - Xenomai_RTDM_DEFINITIONS # - Xenomai_RTDM_INCLUDE_DIRS # - Xenomai_RTDM_LIBRARY_DIRS # - Xenomai_RTDM_LIBRARIES # - Xenomai_RTDM_LDFLAGS if( UNIX ) # Get hint from environment variable (if any) if(NOT $ENV{XENOMAI_ROOT_DIR} STREQUAL "") set(XENOMAI_ROOT_DIR $ENV{XENOMAI_ROOT_DIR} CACHE PATH "Xenomai base directory location (optional, used for nonstandard installation paths)" FORCE) mark_as_advanced(XENOMAI_ROOT_DIR) endif() # set the search paths set( Xenomai_SEARCH_PATH /usr/local /usr $ENV{XENOMAI_ROOT_DIR} ${Xenomai_ROOT_DIR}) # find xeno_config.h find_path( Xenomai_INCLUDE_DIR xeno_config.h PATHS ${Xenomai_SEARCH_PATH} PATH_SUFFIXES xenomai include xenomai/include include/xenomai ) # did we find xeno_config.h? if(Xenomai_INCLUDE_DIR) MESSAGE(STATUS "xenomai found: \"${Xenomai_INCLUDE_DIR}\"") # set the root directory if( "${Xenomai_INCLUDE_DIR}" MATCHES "/usr/include/xenomai" ) # on ubuntu linux, xenomai install is not rooted to a single dir set( Xenomai_ROOT_DIR /usr CACHE PATH "The Xenomai FHS root") set( Xenomai_INCLUDE_POSIX_DIR ${Xenomai_INCLUDE_DIR}/posix ) else() # elsewhere, xenomai install is packaged get_filename_component(Xenomai_ROOT_DIR ${Xenomai_INCLUDE_DIR} PATH CACHE) set( Xenomai_INCLUDE_POSIX_DIR ${Xenomai_ROOT_DIR}/include/posix ) endif() # Find xeno-config find_program(Xenomai_XENO_CONFIG NAMES xeno-config PATHS ${Xenomai_ROOT_DIR}/bin NO_DEFAULT_PATH) # get xenomai version execute_process(COMMAND ${Xenomai_XENO_CONFIG} --version OUTPUT_VARIABLE Xenomai_VERSION) # find the xenomai pthread library find_library( Xenomai_LIBRARY_NATIVE native ${Xenomai_ROOT_DIR}/lib ) find_library( Xenomai_LIBRARY_XENOMAI xenomai ${Xenomai_ROOT_DIR}/lib ) find_library( Xenomai_LIBRARY_PTHREAD_RT pthread_rt ${Xenomai_ROOT_DIR}/lib ) find_library( Xenomai_LIBRARY_RTDM rtdm ${Xenomai_ROOT_DIR}/lib ) # In 2.6.0 RTDK was merged into the main xenomai library if(Xenomai_VERSION VERSION_GREATER 2.6.0) set(Xenomai_LIBRARY_RTDK_FOUND ${Xenomai_LIBRARY_XENOMAI_FOUND}) set(Xenomai_LIBRARY_RTDK ${Xenomai_LIBRARY_XENOMAI}) else() find_library( Xenomai_LIBRARY_RTDK rtdk ${Xenomai_ROOT_DIR}/lib ) endif() # Xenomai libraries for each skin set(Xenomai_NATIVE_LIBRARIES ${Xenomai_LIBRARY_NATIVE} ${Xenomai_LIBRARY_XENOMAI} pthread) set(Xenomai_POSIX_LIBRARIES ${Xenomai_LIBRARY_PTHREAD_RT} ${Xenomai_LIBRARY_XENOMAI} pthread rt) set(Xenomai_RTDM_LIBRARIES ${Xenomai_LIBRARY_RTDM} ${Xenomai_LIBRARY_XENOMAI} pthread rt) # Xenomai LDFLAGS for each skin set(Xenomai_NATIVE_LDFLAGS "") set(Xenomai_POSIX_LDFLAGS "-Wl,@${Xenomai_ROOT_DIR}/lib/posix.wrappers") set(Xenomai_RTDM_LDFLAGS "") # Xenomai compiler definitions for each supported skin set(Xenomai_NATIVE_DEFINITIONS -D_GNU_SOURCE -D_REENTRANT -D__XENO__) set(Xenomai_POSIX_DEFINITIONS ${Xenomai_NATIVE_DEFINITIONS}) set(Xenomai_RTDM_DEFINITIONS ${Xenomai_NATIVE_DEFINITIONS}) # Xenomai library dirs for each skin set( Xenomai_NATIVE_LIBRARY_DIRS ${Xenomai_ROOT_DIR}/lib ) set( Xenomai_POSIX_LIBRARY_DIRS ${Xenomai_NATIVE_LIBRARY_DIRS} ) set( Xenomai_RTDM_LIBRARY_DIRS ${Xenomai_NATIVE_LIBRARY_DIRS} ) # Xenomai library dirs for each skin set( Xenomai_NATIVE_INCLUDE_DIRS ${Xenomai_INCLUDE_DIR} ) set( Xenomai_POSIX_INCLUDE_DIRS ${Xenomai_INCLUDE_DIR} ${Xenomai_INCLUDE_POSIX_DIR} ) set( Xenomai_RTDM_INCLUDE_DIRS ${Xenomai_INCLUDE_DIR} ) # Compatibility set( Xenomai_LIBRARIES ${Xenomai_LIBRARY_XENOMAI} ${Xenomai_LIBRARY_NATIVE} ${Xenomai_LIBRARY_PTHREAD_RT} ${Xenomai_LIBRARY_RTDM} ${Xenomai_LIBRARY_RTDK} ) else( ) MESSAGE(STATUS "Xenomai NOT found in paths: (${Xenomai_SEARCH_PATH})") endif( ) endif( UNIX ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Xenomai DEFAULT_MSG Xenomai_ROOT_DIR Xenomai_INCLUDE_DIR Xenomai_LIBRARY_XENOMAI Xenomai_LIBRARY_RTDK ) set(Xenomai_FOUND ${XENOMAI_FOUND}) # Set appropriately cased variable if(Xenomai_LIBRARY_XENOMAI AND Xenomai_LIBRARY_NATIVE) message(STATUS "Xenomai Native skin found") set(Xenomai_NATIVE_FOUND True) endif() if(Xenomai_LIBRARY_XENOMAI AND Xenomai_LIBRARY_PTHREAD_RT) message(STATUS "Xenomai POSIX skin found") set(Xenomai_POSIX_FOUND True) endif() if(Xenomai_LIBRARY_XENOMAI AND Xenomai_LIBRARY_RTDM) message(STATUS "Xenomai RTDM skin found") set(Xenomai_RTDM_FOUND True) endif() ros-cmake-modules-0.4.0/cmake/cmake_modules-extras.cmake.develspace.in000066400000000000000000000002201245544212000257500ustar00rootroot00000000000000# Append cmake modules from source directory to the cmake module path list(APPEND CMAKE_MODULE_PATH "@CMAKE_CURRENT_SOURCE_DIR@/cmake/Modules") ros-cmake-modules-0.4.0/cmake/cmake_modules-extras.cmake.installspace.in000066400000000000000000000002561245544212000263300ustar00rootroot00000000000000# Append the installed cmake modules to the cmake module path list(APPEND CMAKE_MODULE_PATH "${cmake_modules_DIR}/../../../@CATKIN_PACKAGE_SHARE_DESTINATION@/cmake/Modules") ros-cmake-modules-0.4.0/package.xml000066400000000000000000000012271245544212000171600ustar00rootroot00000000000000 cmake_modules 0.4.0 A common repository for CMake Modules which are not distributed with CMake but are commonly used by ROS packages. William Woodall BSD https://github.com/ros/cmake_modules https://github.com/ros/cmake_modules/issues William Woodall catkin ros-cmake-modules-0.4.0/tests/000077500000000000000000000000001245544212000162035ustar00rootroot00000000000000ros-cmake-modules-0.4.0/tests/test_find_tinyxml/000077500000000000000000000000001245544212000217465ustar00rootroot00000000000000ros-cmake-modules-0.4.0/tests/test_find_tinyxml/CMakeLists.txt000066400000000000000000000011741245544212000245110ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8.3) project(test_find_tinyxml) find_package(catkin REQUIRED COMPONENTS cmake_modules) find_package(TinyXML REQUIRED) message("TinyXML_FOUND: ${TinyXML_FOUND}") message("TinyXML_INCLUDE_DIRS: ${TinyXML_INCLUDE_DIRS}") message("TinyXML_LIBRARIES: ${TinyXML_LIBRARIES}") catkin_package( # INCLUDE ${TinyXML_INCLUDE_DIRS} # Include this if one of your headers uses a header from TinyXML_INCLUDE_DIRS # LIBRARIES ${TinyXML_LIBRARIES} # Include this if people who link against you need to link against TinyXML too # # OR # DEPENDS TinyXML # Use this if you would use both of the above lines ) ros-cmake-modules-0.4.0/tests/test_find_tinyxml/package.xml000066400000000000000000000005451245544212000240670ustar00rootroot00000000000000 test_find_tinyxml 0.0.0 Test package to find TinyXML William Woodall BSD catkin cmake_modules