mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 10:00:23 +08:00
Refactoring RTABMapConfig.cmake with targets (#904)
* Config: Using cmake targets * fixed RTABMAP_DEPRECATED build error * fixed melodic build * cleanup * Fixed qhull exported library error * Update svg depend private * removed g2o from public interface * Fixed Windows with external project * removed some required dep * Fixed nsis error (also fixed unspecified components) * updated workflow rules
This commit is contained in:
@@ -4,73 +4,13 @@ IF(DEFINED PROJECT_NAME)
|
||||
set(internal TRUE)
|
||||
ENDIF(DEFINED PROJECT_NAME)
|
||||
|
||||
if(internal)
|
||||
# inside rtabmap project (see below for external build)
|
||||
SET(RTABMap_INCLUDE_DIRS
|
||||
${PROJECT_BINARY_DIR}/corelib/include
|
||||
${PROJECT_SOURCE_DIR}/utilite/include
|
||||
${PROJECT_SOURCE_DIR}/corelib/include
|
||||
${PROJECT_SOURCE_DIR}/guilib/include
|
||||
)
|
||||
SET(RTABMap_LIBRARIES
|
||||
rtabmap_core
|
||||
rtabmap_gui
|
||||
rtabmap_utilite
|
||||
)
|
||||
else()
|
||||
if(NOT internal)
|
||||
# external build
|
||||
PROJECT( MyProject )
|
||||
|
||||
FIND_PACKAGE(RTABMap REQUIRED)
|
||||
FIND_PACKAGE(OpenCV REQUIRED)
|
||||
FIND_PACKAGE(PCL 1.7 REQUIRED)
|
||||
|
||||
# Find Qt5 first
|
||||
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui Svg QUIET)
|
||||
IF(NOT Qt5_FOUND)
|
||||
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtSvg)
|
||||
ENDIF(NOT Qt5_FOUND)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0020)
|
||||
cmake_policy(SET CMP0020 NEW)
|
||||
endif()
|
||||
|
||||
SET(INCLUDE_DIRS
|
||||
${RTABMap_INCLUDE_DIRS}
|
||||
${OpenCV_INCLUDE_DIRS}
|
||||
${PCL_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
IF(QT4_FOUND)
|
||||
INCLUDE(${QT_USE_FILE})
|
||||
ENDIF(QT4_FOUND)
|
||||
|
||||
SET(LIBRARIES
|
||||
${RTABMap_LIBRARIES}
|
||||
${OpenCV_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
${PCL_LIBRARIES}
|
||||
)
|
||||
|
||||
# Hack as CameraRealsense2.h needs realsense2 include dir
|
||||
IF(realsense2_FOUND)
|
||||
SET(INCLUDE_DIRS
|
||||
${INCLUDE_DIRS}
|
||||
${realsense2_INCLUDE_DIRS}
|
||||
)
|
||||
ENDIF(realsense2_FOUND)
|
||||
|
||||
# Hack as CameraK4A.h needs k4a include dir
|
||||
IF(k4a_FOUND)
|
||||
SET(INCLUDE_DIRS
|
||||
${INCLUDE_DIRS}
|
||||
${k4a_INCLUDE_DIRS}
|
||||
)
|
||||
ENDIF(k4a_FOUND)
|
||||
|
||||
INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
|
||||
|
||||
IF(QT4_FOUND)
|
||||
QT4_WRAP_CPP(moc_srcs MapBuilder.h MapBuilderWifi.h)
|
||||
ELSE()
|
||||
@@ -80,6 +20,8 @@ ENDIF()
|
||||
SET(srcs
|
||||
main.cpp)
|
||||
|
||||
set(LIBRARIES "")
|
||||
|
||||
IF(APPLE)
|
||||
FIND_LIBRARY(CoreWLAN_LIBRARY CoreWLAN)
|
||||
FIND_LIBRARY(Foundation_LIBRARY Foundation)
|
||||
@@ -96,7 +38,7 @@ IF(APPLE)
|
||||
ENDIF(APPLE)
|
||||
|
||||
ADD_EXECUTABLE(wifi_mapping ${srcs} ${moc_srcs})
|
||||
TARGET_LINK_LIBRARIES(wifi_mapping ${LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(wifi_mapping rtabmap_gui ${LIBRARIES})
|
||||
|
||||
if(internal)
|
||||
SET_TARGET_PROPERTIES( wifi_mapping
|
||||
|
||||
Reference in New Issue
Block a user