Skip to content

Commit 05431fd

Browse files
authored
Link libcontroller correctly at runtime (#235)
* Link the libcontroller correctly for runtime * Update
1 parent 33e9616 commit 05431fd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

webots_ros2_driver/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66

77
if (UNIX)
8-
link_directories(webots/lib/linux-gnu)
8+
set(WEBOTS_LIB_BASE webots/lib/linux-gnu)
99
endif (UNIX)
1010
if (WIN32)
11-
link_directories(webots/lib/msys)
11+
set(WEBOTS_LIB_BASE webots/lib/msys)
1212
endif (WIN32)
1313
if (MSVC)
14-
link_directories(webots/lib/darwin19)
14+
set(WEBOTS_LIB_BASE webots/lib/darwin19)
1515
endif (MSVC)
16+
link_directories(${WEBOTS_LIB_BASE})
1617
set(WEBOTS_LIB
1718
${CMAKE_SHARED_LIBRARY_PREFIX}Controller${CMAKE_SHARED_LIBRARY_SUFFIX}
1819
${CMAKE_SHARED_LIBRARY_PREFIX}CppController${CMAKE_SHARED_LIBRARY_SUFFIX}
@@ -112,6 +113,10 @@ install(TARGETS ${PROJECT_NAME}_imu
112113
RUNTIME
113114
DESTINATION lib/${PROJECT_NAME}
114115
)
116+
install(
117+
DIRECTORY ${WEBOTS_LIB_BASE}/
118+
DESTINATION lib/
119+
)
115120

116121
# Prevent pluginlib from using boost
117122
target_compile_definitions(driver PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")

0 commit comments

Comments
 (0)