Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix boost linking errors for Windows #957

Merged
merged 6 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions moveit_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ find_package(rclcpp REQUIRED)
find_package(eigen3_cmake_module REQUIRED)
find_package(Eigen3 REQUIRED)

# Finds Boost Components
include(ConfigExtras.cmake)

find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBFCL REQUIRED "fcl>=0.5.0")
# replace LIBFCL_LIBRARIES with full paths to the libraries
Expand Down Expand Up @@ -52,6 +49,9 @@ find_package(pluginlib REQUIRED)
# TODO: Port python bindings
# find_package(pybind11 REQUIRED)

# Finds Boost Components
include(ConfigExtras.cmake)

Comment on lines +52 to +54
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you just moved this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to revert the previous commit as well. Is that what you were implying was missing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further up in this file you removed these two lines and then added them back here. I'm confused about what difference that would make.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per what Jafar said, the first solution involves moving the include(ConfigExtras.cmake) line after all the find_pakage calls. When we do this, the include(ConfigExtras.cmake) will be the last one to call find_package(Boost ...), so Boost_LIBRARIES will not be overwritten by any dependencies, allowing us to use ament_* to link.

That's what I did when I removed those two lines from above and added them back there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explination. I misunderstood what this would do.

# Set target file path for version.h
set(VERSION_FILE_PATH ${CMAKE_BINARY_DIR}/include)

Expand Down
1 change: 0 additions & 1 deletion moveit_core/distance_field/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ament_target_dependencies(${MOVEIT_LIB_NAME}
tf2_eigen
OCTOMAP
)
target_link_libraries(${MOVEIT_LIB_NAME} Boost::iostreams)

install(DIRECTORY include/ DESTINATION include)

Expand Down
2 changes: 1 addition & 1 deletion moveit_core/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ install(DIRECTORY include/ DESTINATION include)
find_package(ament_index_cpp REQUIRED)
set(MOVEIT_TEST_LIB_NAME moveit_test_utils)
add_library(${MOVEIT_TEST_LIB_NAME} SHARED src/robot_model_test_utils.cpp)
target_link_libraries(${MOVEIT_TEST_LIB_NAME} moveit_robot_model Boost::regex)
target_link_libraries(${MOVEIT_TEST_LIB_NAME} moveit_robot_model)
ament_target_dependencies(${MOVEIT_TEST_LIB_NAME}
ament_index_cpp
Boost
Expand Down
7 changes: 3 additions & 4 deletions moveit_ros/occupancy_map_monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-pedantic)
endif()

# Finds Boost Components
include(ConfigExtras.cmake)

if(APPLE)
find_package(X11 REQUIRED)
endif()
Expand All @@ -27,6 +24,9 @@ find_package(octomap REQUIRED)
find_package(geometric_shapes REQUIRED)
find_package(tf2_ros REQUIRED)

# Finds Boost Components
include(ConfigExtras.cmake)

include_directories(include)
include_directories(SYSTEM
${EIGEN3_INCLUDE_DIRS}
Expand All @@ -52,7 +52,6 @@ set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_V
ament_target_dependencies(${MOVEIT_LIB_NAME}
${THIS_PACKAGE_INCLUDE_DEPENDS}
)
target_link_libraries(${MOVEIT_LIB_NAME} Boost::thread)

add_executable(moveit_ros_occupancy_map_server src/occupancy_map_server.cpp)
ament_target_dependencies(moveit_ros_occupancy_map_server
Expand Down
6 changes: 3 additions & 3 deletions moveit_ros/perception/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wpedantic)
endif()

# Finds Boost Components
include(ConfigExtras.cmake)

if(WITH_OPENGL)
# Prefer newer vendor-specific OpenGL library
if(POLICY CMP0072)
Expand Down Expand Up @@ -62,6 +59,9 @@ find_package(Eigen3 REQUIRED)
find_package(OpenMP REQUIRED)
find_package(OpenCV)

# Finds Boost Components
include(ConfigExtras.cmake)

set(THIS_PACKAGE_INCLUDE_DIRS
depth_image_octomap_updater/include
lazy_free_space_updater/include
Expand Down
1 change: 0 additions & 1 deletion moveit_ros/planning_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ add_subdirectory(move_group_interface)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ros_testing REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)
Ace314159 marked this conversation as resolved.
Show resolved Hide resolved

# TODO (vatanaksoytezer): Enable once this test is not flaky
# Move group interface cpp ompl constrained planning integration test
Expand Down
1 change: 0 additions & 1 deletion moveit_ros/planning_interface/ConfigExtras.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Extras module needed for dependencies to find boost components

find_package(Boost REQUIRED)
Ace314159 marked this conversation as resolved.
Show resolved Hide resolved
#if(Boost_VERSION LESS 106700)
# set(BOOST_PYTHON_COMPONENT python)
#else()
Expand Down