Create Cmake package from existing installation

Viewed 87

We are using Robot Operative System (ROS) in a standalone C++ application. Dependencies to ROS are linked in using

target_include_directories(${LIBRARY}
 /opt/ros/foxy/include/
)

This is probably not best practice, but ROS dependencies are on the way of being cut from the project. Now the issue is that we want to run clang-tidy over the repository, and this setup makes clang-tidy check ROS which we off course do not want.

An easy way to disable clang-tidy is by just setting an environment variable for a target empty, like so

set_target_properties(${MY_TARGET}
            PROPERTIES CXX_CLANG_TIDY ""
        )

The problem is that ROS is not a proper Cmake target. An idea would be to make a "fake" ros target, just so clang-tidy would know what files to skip. Is this feasible?

0 Answers
Related