Ask Your Question
0

ament_target_dependencies() the first argument must be a valid target name

asked 2022-04-11 15:14:40 -0500

zsnafu gravatar image

I'm getting the following error. I'm not exactly sure why:

-- project name baxter_base_service
CMake Error at /opt/ros/foxy/share/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake:42 (message):
  ament_target_dependencies() the first argument must be a valid target name
Call Stack (most recent call first):
  CMakeLists.txt:81 (ament_target_dependencies)

This is why I have in my Cmake file:

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(base_service_interfaces REQUIRED)
find_package(baxter_base_service_interfaces REQUIRED)
#List of dependencies
set (
  BASE_DEPENDENCY_LIST
  ament_cmake
  rclcpp
  base_service_interfaces
  baxter_base_service_interfaces
)
#add_library(${PROJECT_NAME} ${SRC_FILES})

message(STATUS "project name ${PROJECT_NAME}")
ament_target_dependencies(${PROJECT_NAME} ${DEPENDENCY_LIST}
)

Would some one be able to help me with this error?

${PROJECT_NAME}"

is set to

baxter_base_service

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-04-13 00:22:31 -0500

aprotyas gravatar image

It looks like the add_library call is commented out, so CMake never registers ${PROJECT_NAME} as a target. You should not see this problem once you actually define a target (either through add_library or add_executable) named ${PROJECT_NAME}

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-04-11 15:03:48 -0500

Seen: 94 times

Last updated: Apr 13