ros-industrial / ros_qtc_plugin

ROS Qt Creator Plug-in (https://ros-qtc-plugin.readthedocs.io)
398 stars 214 forks source link

How do I overlay another workspace? #390

Closed bhazza closed 5 years ago

bhazza commented 5 years ago

Qt Creator 4.9.2 (installed using Bionic online installer), ROS Melodic on Ubuntu 18.04: I have imported an existing ROS workspace (containing only a src folder with my ROS package in) into QT as per Import ROS Workspace instructions. The ROS package within the src folder depends on another of my ROS packages from a different workspace. When I attempt to build the newly imported project in Qt Creator it complains "Could not find a package configuration file provided by ...", presumably because the newly imported project does not overlay the other workspace (compile output indicates: "This workspace overlays: /opt/ros/melodic" only).

If I build the same project from a terminal that has sourced the ../devel/setup.bash from the other workspace it works fine.

With a previous version of this plugin (& Qt Creator 4.4.1, ROS Kinetic & Ubuntu 16.04) I was able to avoid this issue by first building the project from the terminal, and then importing it as per the instructions linked above. If I then built within Qt Creator it would build fine, and the compile output would indicate it was overlaying the other project as expected. However, if I try to do the same on my new setup (i.e. QTC 4.9.2, Melodic, Ubuntu 18.04) it also correctly overlays the other workspace, but I then run into trouble because doing this means that the code model isn't generated, and so I get various other issues.

I have tried manually setting the CMAKE_PREFIX_PATH environment variable within QT Creator project settings, but this is immediately overwritten when I initiate a build, which I assume is expected behaviour.

Any help would be much appreciated!

bhazza commented 5 years ago

Closing because it turns out I can import the project into Qt Creator after first building it from the terminal, which solves the overlay problem.