Skip to content

Commit

Permalink
fix(osqp_interface): modify build error in rolling (#776)
Browse files Browse the repository at this point in the history
* fix(osqp_interface): modify build error in rolling

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* add comment about find_package order

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
  • Loading branch information
wep21 authored Apr 25, 2022
1 parent 86a3ef8 commit ad492f8
Showing 1 changed file with 10 additions and 3 deletions.
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)

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

0 comments on commit ad492f8

Please sign in to comment.