From 6fb5a0029db793828644856697ee445b9cc990e6 Mon Sep 17 00:00:00 2001 From: Mederic Fourmy <mederic.fourmy@gmail.com> Date: Mon, 2 May 2022 16:28:16 +0200 Subject: [PATCH] Fixed a few bugs in cmake refactoring --- CMakeLists.txt | 10 +++++++--- cmake_modules/wolfobjectslamConfig.cmake.in | 8 +++----- demos/CMakeLists.txt | 12 +++++------- demos/yaml/cosyslam_imu.yaml | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6e7769..776697e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,8 @@ set(PLUGIN_NAME wolf${PROJECT_NAME}) MESSAGE("Starting ${PROJECT_NAME} CMakeLists ...") +SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin) +SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) set(INCLUDE_INSTALL_DIR include/iri-algorithms/wolf) set(LIB_INSTALL_DIR lib/) @@ -95,6 +97,7 @@ ENDIF(BUILD_DEMOS OR BUILD_TESTS) #find dependencies. # ============EXAMPLE================== FIND_PACKAGE(wolfcore REQUIRED) +FIND_PACKAGE(Eigen3 3.3 REQUIRED) # Define the directory where will be the configured config.h SET(WOLF_CONFIG_DIR ${PROJECT_BINARY_DIR}/conf/${PROJECT_NAME}/internal) @@ -206,11 +209,13 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() +#Link the created libraries TARGET_LINK_LIBRARIES(${PLUGIN_NAME} wolfcore) +TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Eigen3::Eigen) -#Build tests -#===============EXAMPLE========================= +#===============Build tests========================= + IF(BUILD_TESTS) MESSAGE("Building tests.") add_subdirectory(test) @@ -230,7 +235,6 @@ INSTALL(TARGETS ${PLUGIN_NAME} EXPORT ${PLUGIN_NAME}Targets ) install(EXPORT ${PLUGIN_NAME}Targets DESTINATION lib/${PLUGIN_NAME}/cmake) - #Â Configure the package installation include(CMakePackageConfigHelpers) configure_package_config_file( diff --git a/cmake_modules/wolfobjectslamConfig.cmake.in b/cmake_modules/wolfobjectslamConfig.cmake.in index 5c17be9..1c767ce 100644 --- a/cmake_modules/wolfobjectslamConfig.cmake.in +++ b/cmake_modules/wolfobjectslamConfig.cmake.in @@ -3,11 +3,9 @@ set(@PLUGIN_NAME@_VERSION 0.0.1) @PACKAGE_INIT@ -set_and_check(@PLUGIN_NAME@_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") -set(@PLUGIN_NAME@_INCLUDE_DIRS @PLUGIN_NAME@_INCLUDE_DIR) -set_and_check(@PLUGIN_NAME@_LIB_INSTALL_DIR "@PACKAGE_LIB_INSTALL_DIR@") -set(@PLUGIN_NAME@_LIB_INSTALL_DIRS @PLUGIN_NAME@_LIB_INSTALL_DIR) - +# forwards the correct parameters given to FIND_DEPENDENCIES +include(CMakeFindDependencyMacro) +FIND_DEPENDENCY(Eigen3 3.3 REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/@PLUGIN_NAME@Targets.cmake") diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 2cb70d5..c224672 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -12,8 +12,8 @@ FIND_PACKAGE(catkin REQUIRED COMPONENTS std_msgs geometry_msgs tf - wolf_ros_objectslam wolf_ros_node + wolf_ros_objectslam ) FIND_PACKAGE(wolfimu REQUIRED) @@ -21,28 +21,26 @@ INCLUDE_DIRECTORIES( ${rosbag_INCLUDE_DIRS} ${wolf_ros_objectslam_INCLUDE_DIRS} ${std_msgs_INCLUDE_DIRS} - ${wolfimu_INCLUDE_DIRS} ) - ADD_EXECUTABLE(demo_toy_pbe demo_toy_pbe.cpp) TARGET_LINK_LIBRARIES(demo_toy_pbe - ${wolfcore_LIBRARIES} + wolfcore ${PLUGIN_NAME} ${catkin_LIBRARIES} ) ADD_EXECUTABLE(cosyslam cosyslam.cpp) TARGET_LINK_LIBRARIES(cosyslam - ${wolfcore_LIBRARIES} + wolfcore ${PLUGIN_NAME} ${catkin_LIBRARIES} ) ADD_EXECUTABLE(cosyslam_imu cosyslam_imu.cpp) TARGET_LINK_LIBRARIES(cosyslam_imu - ${wolfcore_LIBRARIES} + wolfcore + wolfimu ${PLUGIN_NAME} ${catkin_LIBRARIES} - ${wolfimu_LIBRARIES} ) diff --git a/demos/yaml/cosyslam_imu.yaml b/demos/yaml/cosyslam_imu.yaml index dd0ddd2..a7e80b0 100644 --- a/demos/yaml/cosyslam_imu.yaml +++ b/demos/yaml/cosyslam_imu.yaml @@ -1,5 +1,5 @@ # rosbag name -bag: "/demos/bag/tless_circular_cp.bag" +bag: "/demos/bag/shortIMU.bag" # Camera to IMU transformation unfix_extrinsic: false -- GitLab