File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,23 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
66endif ()
77
88find_package (ament_cmake REQUIRED)
9+ include (FindPkgConfig)
10+ pkg_check_modules(LIBMODBUS REQUIRED libmodbus)
11+
12+ set (DEPENDS
13+ modbus
14+ )
915
1016include_directories (
1117 "include"
1218 "src"
1319)
1420
1521add_executable (hande_driver src/hande_driver.cpp src/application.cpp src/protocol_logic.cpp src/communication.cpp)
16- target_link_libraries (hande_driver ${catkin_LIBRARIES} )
17- target_link_libraries (hande_driver /lib/x86_64-linux-gnu/libmodbus.so)
22+ target_link_libraries (hande_driver ${catkin_LIBRARIES} ${DEPENDS} )
1823
1924add_executable (communication_test src/communication_test.cpp)
20- target_link_libraries (communication_test ${catkin_LIBRARIES} )
21- target_link_libraries (communication_test /lib/x86_64-linux-gnu/libmodbus.so)
25+ target_link_libraries (communication_test ${catkin_LIBRARIES} ${DEPENDS} )
2226
2327target_include_directories (hande_driver PUBLIC
2428 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
You can’t perform that action at this time.
0 commit comments