[Qt-creator] CMake Server Integration Feedback

Mike Jackson imikejackson at gmail.com
Thu Jan 5 21:52:06 CET 2017

Tobias Hunger wrote:
> Hi Mike,
> On Thu, Jan 5, 2017 at 6:12 PM, Mike Jackson<imikejackson at gmail.com>  wrote:
>> Just pulled the latest QtCreator 4.3 beta build and installed CMake 3.7.1 on
>> my macOS 10.10.5 machine. First impressions are this is really cool. I more
>> or less like the new layout that QtCreator presents. I do have some
>> questions/feedback that could probably be fixed by our project updating some
>> of our cmake code.
> Good:-)
>> See attached image.
>> A lot of our "sub projects" do not list a<Source Directory>  but all of the
>> source codes listed under<Other Locations>. What cmake variable is
>> QtCreator keying off of? I would be happy to make sure the proper variable
>> is setup. At some point in the past we moved away from using the CMake
>> "Project" command in all the sub-directories to help fix something else
>> (Maybe Xcode or Creator or Visual Studio generation).
> <Other Locations>  is used for files that are outside of what cmake
> considers to be the source or build directory of that target.
> You already found that out:-)

With the magic of .gitignore I was able to move these "external" 
projects inside of the top level directory so this is solved. I'll pass 
this trick onto our other developers

>> The top level project listed is not really the top level project at all. It
>> is some sub-project where the CMake code probably uses the "Project"
>> command. Is there a way to indicate to QtCreator that the _first_ "Project"
>> command that is found is used as the top level project?
> Yes, there is a bug there. Creator currently picks the first project
> it gets from cmake. Apparently cmake does not keep the projects in the
> order they are encountered (which is what I assumed it would do).
> Fixing that is on my todo list.

A reasonable assumption :-) But looking forward to the fix..

>> Is there a way to cut down on the number of embedded folders that are shown
>> (/Users/mjackson/Workspace/DREAM3D_Plugins/$PLUGIN_NAME in my example) by
>> setting some sort of PROJECT_ROOT_DIR cmake variable? That might be nice to
>> have.
> There is no such variable AFAIK. CMake assumes that all sources are
> below the top-level cmake file and creator follows that.

With my changes to my cmake codes the project display is starting to 
look better. It still feels like I have a lot of extra folders included 
in each of my sub projects. Does QtCreator get this list from the 
"include_directories()" command from CMake? I can see our code might be 
a bit sloppy when it comes to defining those include directories. Or we 
are getting carry over from other projects and getting their 
include_directories? I'll try some stuff out and try to report back.

>> Again, this is looking really awesome for CMake&  QtCreator integration.
>> CMake really feels like a first class citizen in QtCreator.
> Thanks! It is fun to make this work:-)
> Best Regards,
> Tobias

Mike J.

More information about the Qt-creator mailing list