Skip to content

Commit

Permalink
fix: header-only library built
Browse files Browse the repository at this point in the history
  • Loading branch information
dfbakin committed Mar 23, 2024
1 parent 39d19b2 commit cafde85
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 49 deletions.
10 changes: 5 additions & 5 deletions packages/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ 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)


add_library(mvsdk SHARED IMPORTED)
set_target_properties(mvsdk PROPERTIES IMPORTED_LOCATION "/lib/libMVSDK.so")

# add_library(queue_lib SHARED IMPORTED)
# set_target_properties(queue_lib PROPERTIES IMPORTED_LOCATION "/handy/install/lock_free_queue/lib/libqueue_lib.so")
add_library(queue_lib INTERFACE)

add_executable(camera src/camera_main.cpp src/camera.cpp src/params.cpp src/camera_status.cpp)
add_executable(calibration src/calibration_main.cpp src/calibration.cpp src/params.cpp)
Expand All @@ -40,7 +40,8 @@ ament_target_dependencies(
cv_bridge
OpenCV
sensor_msgs
yaml_cpp_vendor)
yaml_cpp_vendor
lock_free_queue)

ament_target_dependencies(
calibration
Expand All @@ -57,8 +58,7 @@ ament_target_dependencies(
Boost
camera_srvs)

target_link_libraries(camera mvsdk)
# target_link_libraries(camera queue_lib)
target_link_libraries(camera mvsdk queue_lib)

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_impl.h"
#include "lock_free_queue.h"
#include "params.h"

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

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
9 changes: 4 additions & 5 deletions packages/lock_free_queue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ find_package(ament_cmake_gtest REQUIRED)

add_compile_options(-Wall -Wextra -Wpedantic -Wno-dev)

add_library(queue_lib SHARED src/lock_free_queue.cpp)
target_include_directories(queue_lib PUBLIC
add_library(queue_lib INTERFACE)
target_include_directories(queue_lib INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")

install(TARGETS queue_lib LIBRARY DESTINATION lib)

ament_add_gtest(queue_test tests/src/test.cpp src/lock_free_queue.cpp)
ament_add_gtest(queue_test tests/src/test.cpp)
target_include_directories(queue_test PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
target_link_libraries(queue_test queue_lib)

ament_package()
36 changes: 0 additions & 36 deletions packages/lock_free_queue/include/lock_free_queue_decl.h

This file was deleted.

1 change: 0 additions & 1 deletion packages/lock_free_queue/src/lock_free_queue.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion packages/lock_free_queue/tests/src/test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "lock_free_queue_impl.h"
#include "lock_free_queue.h"

#include <gtest/gtest.h>

Expand Down

0 comments on commit cafde85

Please sign in to comment.