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

cmake --build <path> --target help does not list the "tests" target when using Ninja generator #118

Open
alexwpitt opened this issue Mar 18, 2022 · 0 comments

Comments

@alexwpitt
Copy link

alexwpitt commented Mar 18, 2022

The "help" target is used to check if a particular target exists:

output = subprocess.check_output([
CMAKE_EXECUTABLE, '--build', path, '--target', 'help'], cwd=path)

But when using the Ninja generator, the "tests" target does not seem to appear in the output of that command, and therefore is not built by a colcon build on a ROS package containing cmake such as:

if(CATKIN_ENABLE_TESTING)
  find_package(rostest REQUIRED)
  add_rostest_gtest(dummy_node_test test/dummy_node.test test/DummyNodeTest.cpp)
  target_include_directories(dummy_node_test SYSTEM PRIVATE ${catkin_INCLUDE_DIRS})
  target_link_libraries(dummy_node_test ${catkin_LIBRARIES})
endif()

This causes colcon test failures if rostest tries to launch the unbuilt test binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant