Skip to content

Commit

Permalink
fix: requested changes implemented
Browse files Browse the repository at this point in the history
fix: added header-only include location correctly
  • Loading branch information
dfbakin committed Apr 14, 2024
1 parent e79bbd0 commit 95834c0
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 29 deletions.
14 changes: 6 additions & 8 deletions packages/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ find_package(yaml_cpp_vendor REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(Boost REQUIRED)
find_package(camera_srvs REQUIRED)
find_package(lock_free_queue REQUIRED)
find_package(common REQUIRED)

add_library(mvsdk SHARED IMPORTED)
set_target_properties(mvsdk PROPERTIES IMPORTED_LOCATION "/lib/libMVSDK.so")
Expand All @@ -28,11 +28,9 @@ add_executable(calibration src/calibration_main.cpp src/calibration.cpp
src/params.cpp)

target_include_directories(
camera
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../lock_free_queue/include>"
"/usr/include")
camera PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>" "/usr/include")

target_include_directories(
calibration PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"/usr/include")
Expand All @@ -44,7 +42,7 @@ ament_target_dependencies(
OpenCV
sensor_msgs
yaml_cpp_vendor
lock_free_queue)
common)

ament_target_dependencies(
calibration
Expand All @@ -61,7 +59,7 @@ ament_target_dependencies(
Boost
camera_srvs)

target_link_libraries(camera mvsdk queue_lib)
target_link_libraries(camera mvsdk common::common)

install(TARGETS camera calibration DESTINATION lib/${PROJECT_NAME})

Expand Down
2 changes: 1 addition & 1 deletion packages/camera/include/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <opencv2/core/core.hpp>

#include "CameraApi.h"
#include "lock_free_queue.h"
#include "common/lock_free_queue.h"
#include "params.h"

#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<depend>yaml_cpp_vendor</depend>
<depend>Boost</depend>
<depend>camera_srvs</depend>
<depend>lock_free_queue</depend>
<depend>common</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
29 changes: 29 additions & 0 deletions packages/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.8)
project(common)

find_package(ament_cmake REQUIRED)

add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(
${PROJECT_NAME}
INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

install(
TARGETS ${PROJECT_NAME}
EXPORT "export_${PROJECT_NAME}"
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES
DESTINATION include)

install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
add_subdirectory("tests")
endif()

ament_export_targets("export_${PROJECT_NAME}")
ament_package()
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lock_free_queue</name>
<name>common</name>
<version>0.0.0</version>
<description>lock_free_queue</description>
<description>common</description>
<license>MIT</license>
<maintainer email="[email protected]">Denis Bakin</maintainer>

Expand Down
4 changes: 4 additions & 0 deletions packages/common/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ament_add_gtest(queue_test src/test.cpp)
target_include_directories(
queue_test PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
target_link_libraries(queue_test ${PROJECT_NAME})
File renamed without changes.
17 changes: 0 additions & 17 deletions packages/lock_free_queue/CMakeLists.txt

This file was deleted.

0 comments on commit 95834c0

Please sign in to comment.