msckf_vio/CMakeLists.txt

175 lines
3.6 KiB
CMake
Raw Normal View History

2018-01-10 05:19:32 +01:00
cmake_minimum_required(VERSION 2.8.12)
2018-01-08 20:41:37 +01:00
project(msckf_vio)
2018-01-10 05:19:32 +01:00
add_compile_options(-std=c++11 -Wall)
2018-01-08 20:41:37 +01:00
# Modify cmake module path if new .cmake files are required
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
tf
nav_msgs
sensor_msgs
geometry_msgs
eigen_conversions
tf_conversions
random_numbers
message_generation
2018-01-10 05:19:32 +01:00
nodelet
2018-01-08 20:41:37 +01:00
image_transport
cv_bridge
message_filters
pcl_conversions
pcl_ros
2018-01-10 05:19:32 +01:00
std_srvs
2018-01-08 20:41:37 +01:00
)
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Cholmod REQUIRED)
find_package(SPQR REQUIRED)
2018-01-10 05:19:32 +01:00
##################
## ROS messages ##
##################
2018-01-08 20:41:37 +01:00
add_message_files(
FILES
FeatureMeasurement.msg
CameraMeasurement.msg
TrackingInfo.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
2018-01-10 05:19:32 +01:00
###################################
## catkin specific configuration ##
###################################
2018-01-08 20:41:37 +01:00
catkin_package(
INCLUDE_DIRS include
2018-01-10 05:19:32 +01:00
LIBRARIES msckf_vio image_processor
2018-01-08 20:41:37 +01:00
CATKIN_DEPENDS
roscpp std_msgs tf nav_msgs sensor_msgs geometry_msgs
2018-01-10 05:19:32 +01:00
eigen_conversions tf_conversions random_numbers message_runtime
2018-01-08 20:41:37 +01:00
image_transport cv_bridge message_filters pcl_conversions
pcl_ros std_srvs
2018-01-10 05:19:32 +01:00
DEPENDS Boost EIGEN3 OpenCV CHOLMOD SPQR
2018-01-08 20:41:37 +01:00
)
2018-01-10 05:19:32 +01:00
###########
## Build ##
###########
2018-01-08 20:41:37 +01:00
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
${CHOLMOD_INCLUDES}
${SPQR_INCLUDES}
)
# Msckf Vio
add_library(msckf_vio
src/msckf_vio.cpp
)
add_dependencies(msckf_vio
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(msckf_vio
${catkin_LIBRARIES}
${CHOLMOD_LIBRARIES}
${SPQR_LIBRARIES}
)
# Msckf Vio nodelet
add_library(msckf_vio_nodelet
src/msckf_vio_nodelet.cpp
)
add_dependencies(msckf_vio_nodelet
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(msckf_vio_nodelet
msckf_vio
${catkin_LIBRARIES}
)
# Image processor
add_library(image_processor
src/image_processor.cpp
)
add_dependencies(image_processor
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(image_processor
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
# Image processor nodelet
add_library(image_processor_nodelet
src/image_processor_nodelet.cpp
)
add_dependencies(image_processor_nodelet
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(image_processor_nodelet
image_processor
${catkin_LIBRARIES}
)
2018-01-10 05:19:32 +01:00
#############
## Install ##
#############
install(TARGETS
msckf_vio msckf_vio_nodelet image_processor image_processor_nodelet
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
2018-01-08 20:41:37 +01:00
)
2018-01-10 05:19:32 +01:00
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN "*_nodelet.h" EXCLUDE
2018-01-08 20:41:37 +01:00
)
2018-01-10 05:19:32 +01:00
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
2018-01-08 20:41:37 +01:00
)
2018-01-10 05:19:32 +01:00
#############
## Testing ##
#############
if(CATKIN_ENABLE_TESTING)
# Feature initialization test
catkin_add_gtest(test_feature_init
test/feature_initialization_test.cpp
)
add_dependencies(test_feature_init
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(test_feature_init
${catkin_LIBRARIES}
)
# Math utils test
catkin_add_gtest(test_math_utils
test/math_utils_test.cpp
)
endif()