2013-12-11 00:12:44 +00:00
|
|
|
# - Config file for the RTABMap package
|
2017-06-15 15:59:52 -04:00
|
|
|
# Components:
|
|
|
|
|
# core (required)
|
|
|
|
|
# gui (optional)
|
|
|
|
|
# utilite (required)
|
2013-12-11 00:12:44 +00:00
|
|
|
# It defines the following variables
|
|
|
|
|
# RTABMap_INCLUDE_DIRS - include directories for RTABMap
|
|
|
|
|
# RTABMap_LIBRARIES - libraries to link against
|
2015-08-13 15:34:59 -04:00
|
|
|
# RTABMap_CORE - core library
|
|
|
|
|
# RTABMap_UTILITE - utilite library
|
|
|
|
|
# RTABMap_GUI - gui library (set if RTABMap is built with Qt)
|
2013-12-11 00:12:44 +00:00
|
|
|
|
|
|
|
|
# Compute paths
|
|
|
|
|
get_filename_component(RTABMap_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
|
|
set(RTABMap_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
|
|
|
|
|
|
2015-08-13 15:34:59 -04:00
|
|
|
#core lib
|
2016-03-23 19:07:44 -04:00
|
|
|
find_library(RTABMap_CORE_RELEASE NAMES rtabmap_core NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
|
|
|
|
find_library(RTABMap_CORE_DEBUG NAMES rtabmap_cored NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
2015-08-13 15:34:59 -04:00
|
|
|
|
|
|
|
|
IF(RTABMap_CORE_DEBUG AND RTABMap_CORE_RELEASE)
|
|
|
|
|
SET(RTABMap_CORE
|
|
|
|
|
debug ${RTABMap_CORE_DEBUG}
|
|
|
|
|
optimized ${RTABMap_CORE_RELEASE}
|
|
|
|
|
)
|
|
|
|
|
ELSEIF(RTABMap_CORE_DEBUG)
|
|
|
|
|
SET(RTABMap_CORE ${RTABMap_CORE_DEBUG})
|
2016-03-23 19:07:44 -04:00
|
|
|
ELSE()
|
|
|
|
|
SET(RTABMap_CORE ${RTABMap_CORE_RELEASE})
|
2015-08-13 15:34:59 -04:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
#utilite lib
|
2016-03-23 19:07:44 -04:00
|
|
|
find_library(RTABMap_UTILITE_RELEASE NAMES rtabmap_utilite NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
|
|
|
|
find_library(RTABMap_UTILITE_DEBUG NAMES rtabmap_utilited NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
2015-08-13 15:34:59 -04:00
|
|
|
|
|
|
|
|
IF(RTABMap_UTILITE_DEBUG AND RTABMap_UTILITE_RELEASE)
|
|
|
|
|
SET(RTABMap_UTILITE
|
|
|
|
|
debug ${RTABMap_UTILITE_DEBUG}
|
|
|
|
|
optimized ${RTABMap_UTILITE_RELEASE}
|
|
|
|
|
)
|
|
|
|
|
ELSEIF(RTABMap_UTILITE_DEBUG)
|
|
|
|
|
SET(RTABMap_UTILITE ${RTABMap_UTILITE_DEBUG})
|
2016-03-23 19:07:44 -04:00
|
|
|
ELSE()
|
|
|
|
|
SET(RTABMap_UTILITE ${RTABMap_UTILITE_RELEASE})
|
2015-08-13 15:34:59 -04:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
set(RTABMap_LIBRARIES ${RTABMap_CORE} ${RTABMap_UTILITE})
|
|
|
|
|
|
2017-06-15 15:59:52 -04:00
|
|
|
list(LENGTH RTABMap_FIND_COMPONENTS RTABMap_FIND_COMPONENTS_LENGTH)
|
2017-06-29 15:31:05 -04:00
|
|
|
set(WITH_GUI ON)
|
2017-06-15 15:59:52 -04:00
|
|
|
if(${RTABMap_FIND_COMPONENTS_LENGTH} GREATER 0)
|
|
|
|
|
list (FIND RTABMap_FIND_COMPONENTS "gui" _index)
|
2017-06-29 15:31:05 -04:00
|
|
|
if (${_index} EQUAL -1)
|
|
|
|
|
set(WITH_GUI OFF)
|
2017-06-15 15:59:52 -04:00
|
|
|
endif()
|
|
|
|
|
endif(${RTABMap_FIND_COMPONENTS_LENGTH} GREATER 0)
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 15:34:59 -04:00
|
|
|
#gui lib (OFF if RTAB-Map is not built with Qt)
|
2017-06-15 15:59:52 -04:00
|
|
|
if(@CONF_WITH_GUI@ AND ${WITH_GUI})
|
2016-03-23 19:07:44 -04:00
|
|
|
find_library(RTABMap_GUI_RELEASE NAMES rtabmap_gui NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
|
|
|
|
find_library(RTABMap_GUI_DEBUG NAMES rtabmap_guid NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
2015-08-13 15:34:59 -04:00
|
|
|
|
|
|
|
|
IF(RTABMap_GUI_DEBUG AND RTABMap_GUI_RELEASE)
|
|
|
|
|
SET(RTABMap_GUI
|
|
|
|
|
debug ${RTABMap_GUI_DEBUG}
|
|
|
|
|
optimized ${RTABMap_GUI_RELEASE}
|
|
|
|
|
)
|
|
|
|
|
ELSEIF(RTABMap_GUI_RELEASE)
|
|
|
|
|
SET(RTABMap_GUI ${RTABMap_GUI_RELEASE})
|
|
|
|
|
ELSEIF(RTABMap_GUI_DEBUG)
|
|
|
|
|
SET(RTABMap_GUI ${RTABMap_GUI_DEBUG})
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
set(RTABMap_LIBRARIES ${RTABMap_LIBRARIES} ${RTABMap_GUI})
|
2017-06-15 15:59:52 -04:00
|
|
|
elseif(${WITH_GUI})
|
|
|
|
|
MESSAGE(ERROR "Asked for \"gui\" module but RTABMap hasn't been built with gui support.")
|
|
|
|
|
endif()
|
2015-08-13 15:34:59 -04:00
|
|
|
|
2016-06-01 13:13:30 -04:00
|
|
|
# Dependencies
|
2017-06-15 15:59:52 -04:00
|
|
|
if(@CONF_VTK_QT@ AND ${WITH_GUI})
|
2016-09-29 12:40:51 -04:00
|
|
|
find_package(VTK COMPONENTS vtkGUISupportQt NO_MODULE) # to define vtkGUISupportQt target
|
2017-06-15 15:59:52 -04:00
|
|
|
endif(@CONF_VTK_QT@ AND ${WITH_GUI})
|
2017-06-14 19:55:23 -04:00
|
|
|
SET(RTABMap_LIBRARIES ${RTABMap_LIBRARIES} "@CONF_DEPENDENCIES@")
|
2016-06-01 13:13:30 -04:00
|
|
|
|
2015-08-13 15:34:59 -04:00
|
|
|
#backward compatibilities
|
2016-03-23 19:07:44 -04:00
|
|
|
set(RTABMAP_CORE ${RTABMap_CORE})
|
|
|
|
|
set(RTABMAP_UTILITE ${RTABMap_UTILITE})
|
2015-08-13 15:34:59 -04:00
|
|
|
if(RTABMap_GUI)
|
|
|
|
|
set(RTABMAP_GUI ${RTABMap_GUI})
|
2016-05-09 11:17:51 -04:00
|
|
|
set(RTABMAP_QT_VERSION @CONF_QT_VERSION@)
|
|
|
|
|
endif(RTABMap_GUI)
|
2017-06-14 19:55:23 -04:00
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2017-06-15 15:59:52 -04:00
|
|
|
find_package_handle_standard_args(RTABMap DEFAULT_MSG RTABMap_LIBRARIES RTABMap_INCLUDE_DIRS)
|
|
|
|
|
mark_as_advanced(RTABMap_LIBRARIES RTABMap_INCLUDE_DIRS RTABMap_LIBRARY_DIRS)
|