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(osqp_interface): modify build error in rolling #776

Merged
merged 2 commits into from
Apr 25, 2022
Merged
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
13 changes: 10 additions & 3 deletions common/osqp_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ project(osqp_interface)
# require that dependencies from package.xml be available
find_package(ament_cmake_auto REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(osqp REQUIRED)
get_target_property(OSQP_INCLUDE_DIR osqp::osqp INTERFACE_INCLUDE_DIRECTORIES)

ament_auto_find_build_dependencies(REQUIRED
${${PROJECT_NAME}_BUILD_DEPENDS}
${${PROJECT_NAME}_BUILDTOOL_DEPENDS}
)

# after find_package(osqp_vendor) in ament_auto_find_build_dependencies
find_package(osqp REQUIRED)
get_target_property(OSQP_INCLUDE_SUB_DIR osqp::osqp INTERFACE_INCLUDE_DIRECTORIES)
get_filename_component(OSQP_INCLUDE_DIR ${OSQP_INCLUDE_SUB_DIR} PATH)
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

set(OSQP_INTERFACE_LIB_SRC
src/csc_matrix_conv.cpp
src/osqp_interface.cpp
Expand All @@ -46,7 +49,11 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
autoware_set_compile_options(${PROJECT_NAME})
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-error=old-style-cast -Wno-error=useless-cast)

target_include_directories(osqp_interface PUBLIC "${OSQP_INCLUDE_DIR}")
target_include_directories(osqp_interface
SYSTEM PUBLIC
"${OSQP_INCLUDE_DIR}"
)

ament_target_dependencies(osqp_interface
Eigen3
osqp_vendor
Expand Down