catkin / catkin_tools

Command line tools for working with catkin
Apache License 2.0
163 stars 146 forks source link

catkin build does not output messages or generate compile_commands.json after setting in CMakeLists.txt #772

Open talking-toaster opened 5 months ago

talking-toaster commented 5 months ago

System Info

Build / Run Issue

Expected Behavior

Actual Behavior

CLI output in Gists: https://gist.github.com/talking-toaster/986e9987b000f62a5a6cc99191ea1527

Steps to Reproduce the Issue

I am working on a ROS package and have encountered an issue where modifications made in the CMakeLists.txt file do not seem to affect the output of catkin build. Specifically, I added the following lines to my CMakeLists.txt:

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

After adding these, I expected to see the status message regarding CMAKE_CXX_FLAGS during the build process and a compile_commands.json file to be generated in the build directory. Unfortunately, neither of these outcomes occurs.

Here are the steps I've taken:

Added the above lines to CMakeLists.txt. Ran catkin clean to clear any existing build data. Ran catkin build to rebuild the package. Despite these steps, the expected message does not appear in the build output, and the compile_commands.json file is not found.

However, when using catkin_make, both the message is displayed, and the compile_commands.json file is generated as expected.