Qt Creator: won't load source tree / config targets properly



  • Qt creator doesn't load config targets properly, even though the config loading won't display any errors. The source tree is also empty. The only file shown is CMakeLists.txt ...

    System Information :

    cmake version 3.5.1
    
    Qt Creator 4.2.2
    Based on Qt 5.8.0 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)
    From revision 991f5eb6a5
    Built on Apr  3 2017 04:08:48
    
    Qt 5.8.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6)) on "xcb" 
    OS: Ubuntu 16.04.2 LTS [linux version 4.4.0-77-generic]
    

    Run CMake output:

    ...
    -- Configuring done
    ...
    -- Generating done
    -- Build files have been written to:  /home/...
    

    Any idea, of what should I look for ?


  • Moderators

    @QtBSt said in Qt Creator: won't load source tree / config targets properly:

    Any idea, of what should I look for ?

    Yes, it starts with posting more details on what, how and what OS you are doing all this. Also some "code" lines may be helpful.



  • @koahnig

    I updated the requested information. Which qt / cmake warning shall I look for, to understand why noting is displayed ?



  • @koahnig said in Qt Creator: won't load source tree / config targets properly:
    Also some "code" lines may be helpful.

    What kind of "code" would you expect here ? The cmake files are huge, and they worked with previous versions (< 3.5.1 QT Creator)/

    To me it is strange, that no error / warning regarding the source tree is issued. and I cannot find any hint why ?


  • Moderators

    @QtBSt

    You should take the word code too literal. It is clear that no C++ source is causing the issue.
    Your initial post did not contain much detail at all. If I am not completely wrong, it was basically the first line only. The more you give to others to understand what you are doing the better it will be for you.

    At the moment I would say possibly the cmake file could give others a chance to understand parts of your problem. However, I have no real experience with cmake, therefore I am of no help here.

    Probably you should check with other project files for the same issue. Ideal is typically to have a small example showing the problem.



  • I just found out, that it is because of the CMake generator specifites in Build & Run -> Kits. I had "Unix Makefiles" generator, switching to "CodeBlocks" as a second generator helped loading the files.

    Now the big question is : why is it like this, and why there was no hint about it ?



  • Creator should default to the Codeblocks versions of make and ninja generators. So that should work out of the box;-) IIRC it should also warn when you select a cmake generator without Codeblocks support in the kits page.

    Why is it like that? Because Creator parses the Codeblocks files to extract information about the cmake project. So without the Codeblocks file it does not have any information on what you are building.

    Having said so: the uocoming Qt Creator 4.3 with a new cmake (3.7 or later with server-mode enabled) any generator will work.

    PS: You want to give ninja a try. Just install ninja, mak sure it is in the PATH anr switch to the ninja generator (with Codeblocks).



  • @hunger :

    Creator should default to the Codeblocks versions of make and ninja generators. So that should work out of the box;-)
    Why is it like that? Because Creator parses the Codeblocks files to extract information about the cmake project. So without the Codeblocks file it does not have any information on what you are building.

    Of course, this is well documented :). But it tunred out the above is not completely true. Than once run with a codeblock generator, if I switch off the second generator again (i.e. remove the second generator, which is Codeblock), the source tree is displayed normally, and no warnings are to be seen again.

    @hunger :

    IIRC it should also warn when you select a cmake generator without Codeblocks support in the kits page.

    It should, but it doesn't. I just checked it. Could you give an example how this message should look like ?

    @hunger :

    PS: You want to give ninja a try. Just install ninja, mak sure it is in the PATH anr switch to the ninja generator (with Codeblocks).

    With ninja it will also work. But I set make, because I wanted to test icecc with Qt creator. It turned out this is not an issue. Qt creator works with icecc with both ninja and make.


Log in to reply