forked from bayesian-object-tracking/dbot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
corrected variable exports
- Loading branch information
Showing
8 changed files
with
351 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
############################################################################### | ||
# | ||
# CMake script for finding the Eigen library. | ||
# | ||
# http://eigen.tuxfamily.org/index.php?title=Main_Page | ||
# | ||
# Copyright (c) 2006, 2007 Montel Laurent, <[email protected]> | ||
# Copyright (c) 2008, 2009 Gael Guennebaud, <[email protected]> | ||
# Copyright (c) 2009 Benoit Jacob <[email protected]> | ||
# 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}) | ||
|
||
|
||
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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
############################ | ||
# Documentation Generation # | ||
############################ | ||
# | ||
# How to generate the documentation: | ||
# | ||
# $ cd /path/to/osr | ||
# $ mkdir build | ||
# $ cd build | ||
# $ cmake .. | ||
# $ make doc_osr | ||
# | ||
# The documentation will be generated within /path/to/osr/build/doc | ||
# | ||
|
||
set(DOC_SYNC_LOCATION "" | ||
CACHE STRING "Sync location (URL or PATH where to sync the doc to.)") | ||
|
||
set(TARGET_FAILED_SCRIPT_TEMPLATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/target_failed.cmake.in) | ||
|
||
set(TARGET_FAILED_SCRIPT | ||
${CMAKE_CURRENT_BINARY_DIR}/cmake/target_failed.cmake) | ||
|
||
set(VERSION_SCRIPT | ||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake) | ||
|
||
if(DOXYGEN_FOUND) | ||
execute_process(COMMAND "${DOXYGEN_EXECUTABLE}" "--version" | ||
OUTPUT_VARIABLE DOXYGEN_VERSION | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
if(DOXYGEN_VERSION VERSION_LESS MIN_DOXYGEN_VERSION) | ||
set(DOXYGEN_WARN_MSG_OLD "Doxygen version is too old!") | ||
set(DOXYGEN_WARN_MSG_FOUND "Found Doxygen ${DOXYGEN_VERSION}.") | ||
set(DOXYGEN_WARN_MSG_REQ "Required is at least ${MIN_DOXYGEN_VERSION}") | ||
|
||
set(DOXYGEN_WARN_MSG "\n${DOXYGEN_WARN_MSG_OLD}\n") | ||
set(DOXYGEN_WARN_MSG "${DOXYGEN_WARN_MSG} (${DOXYGEN_WARN_MSG_FOUND}") | ||
set(DOXYGEN_WARN_MSG "${DOXYGEN_WARN_MSG} ${DOXYGEN_WARN_MSG_REQ})") | ||
message(WARNING ${DOXYGEN_WARN_MSG}) | ||
|
||
set(FATAL_ERROR_MESSAGE ${DOXYGEN_WARN_MSG}) | ||
configure_file( | ||
${TARGET_FAILED_SCRIPT_TEMPLATE} | ||
${TARGET_FAILED_SCRIPT} @ONLY) | ||
|
||
add_custom_target(doc_osr | ||
COMMAND ${CMAKE_COMMAND} -P ${TARGET_FAILED_SCRIPT}) | ||
add_custom_target(doc_osr_and_sync | ||
COMMAND ${CMAKE_COMMAND} -P ${TARGET_FAILED_SCRIPT}) | ||
else(DOXYGEN_VERSION VERSION_LESS MIN_DOXYGEN_VERSION) | ||
# doc_osr target | ||
add_custom_target(doc_osr | ||
COMMAND ${CMAKE_COMMAND} | ||
-D PROJECT_SOURCE_DIR:string=${PROJECT_SOURCE_DIR} | ||
-D PROJECT_BINARY_DIR:string=${PROJECT_BINARY_DIR} | ||
-P ${VERSION_SCRIPT} | ||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Generating API documentation with Doxygen" VERBATIM) | ||
|
||
# doc_osr_and_sync target | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/sync_doc.cmake.in | ||
${CMAKE_CURRENT_BINARY_DIR}/cmake/sync_doc.cmake @ONLY) | ||
|
||
add_custom_target(doc_osr_and_sync | ||
COMMAND ${CMAKE_COMMAND} | ||
-D PROJECT_SOURCE_DIR:string=${PROJECT_SOURCE_DIR} | ||
-D PROJECT_BINARY_DIR:string=${PROJECT_BINARY_DIR} | ||
-P ${VERSION_SCRIPT} | ||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile | ||
COMMAND ${CMAKE_COMMAND} -P | ||
${CMAKE_CURRENT_BINARY_DIR}/cmake/sync_doc.cmake | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Generating API documentation with Doxygen" VERBATIM) | ||
|
||
endif(DOXYGEN_VERSION VERSION_LESS MIN_DOXYGEN_VERSION) | ||
else(DOXYGEN_FOUND) | ||
set(DOXYGEN_WARN_MSG "Doxygen not found.") | ||
message(${DOXYGEN_WARN_MSG}) | ||
|
||
set(FATAL_ERROR_MESSAGE ${DOXYGEN_WARN_MSG}) | ||
configure_file( | ||
${TARGET_FAILED_SCRIPT_TEMPLATE} | ||
${TARGET_FAILED_SCRIPT} @ONLY) | ||
|
||
add_custom_target(doc_osr | ||
COMMAND ${CMAKE_COMMAND} -P ${TARGET_FAILED_SCRIPT}) | ||
endif(DOXYGEN_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
include(ExternalProject) | ||
include(CMakeParseArguments) | ||
|
||
if(TARGET gtest) | ||
|
||
set(gtest_LIBRARY gtest) | ||
set(gtest_main_LIBRARY gtest_main) | ||
set(${PROJECT_NAME}_TEST_LIBS ${gtest_LIBRARY} ${gtest_main_LIBRARY}) | ||
|
||
else(TARGET gtest) | ||
|
||
message("No gtest found. Downloading and building gtest framework ...") | ||
|
||
set(gtest_LIBRARY ${PROJECT_NAME}_gtest) | ||
set(gtest_main_LIBRARY ${PROJECT_NAME}_gtest_main) | ||
set(${PROJECT_NAME}_TEST_LIBS ${gtest_LIBRARY} ${gtest_main_LIBRARY}) | ||
|
||
set(GTEST_FRAMEWORK ${PROJECT_NAME}_gtest_framework) | ||
|
||
ExternalProject_Add( | ||
${GTEST_FRAMEWORK} | ||
URL https://googletest.googlecode.com/files/gtest-1.6.0.zip | ||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest | ||
INSTALL_COMMAND "" # do not install this library | ||
CMAKE_ARGS -Dgtest_disable_pthreads=ON -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
) | ||
|
||
ExternalProject_Get_Property(${GTEST_FRAMEWORK} source_dir binary_dir) | ||
|
||
set(gtest_INCLUDE_DIR ${source_dir}/include) | ||
set(gtest_LIBRARY_PATH | ||
${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest.a) | ||
set(gtest_main_LIBRARY_PATH | ||
${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main.a) | ||
|
||
add_library(${gtest_LIBRARY} STATIC IMPORTED GLOBAL) | ||
set_target_properties(${gtest_LIBRARY} | ||
PROPERTIES | ||
IMPORTED_LOCATION ${gtest_LIBRARY_PATH} | ||
IMPORTED_LINK_INTERFACE_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") | ||
add_dependencies(${gtest_LIBRARY} ${GTEST_FRAMEWORK}) | ||
|
||
add_library(${gtest_main_LIBRARY} STATIC IMPORTED GLOBAL) | ||
set_target_properties(${gtest_main_LIBRARY} | ||
PROPERTIES | ||
IMPORTED_LOCATION ${gtest_main_LIBRARY_PATH} | ||
IMPORTED_LINK_INTERFACE_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") | ||
add_dependencies(${gtest_main_LIBRARY} ${gtest_LIBRARY}) | ||
|
||
include_directories(${gtest_INCLUDE_DIR}) | ||
|
||
endif(TARGET gtest) | ||
|
||
function(${PROJECT_NAME}_add_test) | ||
set(options) | ||
set(oneValueArgs NAME) | ||
set(multiValueArgs SOURCES LIBS) | ||
cmake_parse_arguments(${PROJECT_NAME} | ||
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
set(TEST_NAME "${${PROJECT_NAME}_NAME}_test") | ||
|
||
add_executable(${TEST_NAME} ${${PROJECT_NAME}_SOURCES}) | ||
target_link_libraries(${TEST_NAME} | ||
${${PROJECT_NAME}_TEST_LIBS} ${${PROJECT_NAME}_LIBS}) | ||
add_test(${TEST_NAME} ${TEST_NAME}) | ||
endfunction(${PROJECT_NAME}_add_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
############################ | ||
# Info gen. functions # | ||
############################ | ||
# I'm sure there is a better way of doing this... | ||
execute_process( | ||
COMMAND bash -c | ||
"v=`ps -o stat= -p $PPID` | ||
[[ $v == *+* ]] || [[ $v == *s* ]] && echo YES || echo NO" | ||
OUTPUT_VARIABLE ISATTY | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
if(ISATTY STREQUAL "YES") | ||
string(ASCII 27 Esc) | ||
set(COLOR_BORDER "${Esc}[35m") | ||
set(COLOR_HEADER "${Esc}[34m") | ||
set(COLOR_BOLD "${Esc}[1m") | ||
set(COLOR_CLEAR "${Esc}[m") | ||
else(ISATTY STREQUAL "YES") | ||
set(COLOR_BORDER "") | ||
set(COLOR_HEADER "") | ||
set(COLOR_BOLD "") | ||
set(COLOR_CLEAR "") | ||
endif(ISATTY STREQUAL "YES") | ||
|
||
function(info_begin) | ||
message(STATUS "${COLOR_BORDER}=================================================${COLOR_CLEAR}") | ||
endfunction(info_begin) | ||
|
||
function(info_end) | ||
message(STATUS "${COLOR_BORDER}=====${COLOR_CLEAR}") | ||
endfunction(info_end) | ||
|
||
function(info_project project_name project_version) | ||
message(STATUS "${COLOR_BORDER}== ${COLOR_CLEAR} ${COLOR_HEADER}${project_name}${COLOR_CLEAR}") | ||
message(STATUS "${COLOR_BORDER}== ${COLOR_CLEAR} Version: ${COLOR_BOLD}${project_version}${COLOR_CLEAR}") | ||
endfunction(info_package) | ||
|
||
function(info_header list_header) | ||
message(STATUS "${COLOR_BORDER}== ${COLOR_CLEAR} ") | ||
message(STATUS "${COLOR_BORDER}== ${COLOR_CLEAR} ${COLOR_BOLD}${list_header}") | ||
endfunction(info_header) | ||
|
||
function(info_item item_name item_value) | ||
message(STATUS "${COLOR_BORDER}== ${COLOR_CLEAR} - ${item_name}:${COLOR_BOLD} ${item_value}") | ||
endfunction(info_item) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
set(DOC_SYNC_LOCATION "@DOC_SYNC_LOCATION@") | ||
|
||
if(DOC_SYNC_LOCATION) | ||
message("\n --- Sync documentation to ${DOC_SYNC_LOCATION} ... \n ") | ||
execute_process( | ||
COMMAND rsync -ruv --force --delete ${CMAKE_CURRENT_BINARY_DIR}/doc/html/ ${DOC_SYNC_LOCATION}) | ||
else(DOC_SYNC_LOCATION) | ||
message(FATAL_ERROR "Please specify the doc location via DOC_SYNC_LOCATION !") | ||
endif(DOC_SYNC_LOCATION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
message(FATAL_ERROR "@FATAL_ERROR_MESSAGE@") |
Oops, something went wrong.