[Qt-creator] Qt Creator not loading CMake project

Nick Overdijk nick at astrant.net
Thu Feb 27 16:25:21 CET 2020


Alternatively you can 'bite the bullet' and configure your Kit to have all
the CMake arguments you happen to need. Only hurts once! ;-)

On Thu, Feb 27, 2020 at 4:23 PM Davide Coppola <vivaladav at gmail.com> wrote:

> I tried to start Qt Creator from the command line and unfortunately that
> didn't make any difference.
>
> I dug a little in the output panel in Qt Creator and I can confirm the
> problem is definitely the missing entries in CMakeCache.txt
>
> In particular for the first module CMake is complaining that an xxx_DIR is
> not set and that variable is indeed missing in the cache file.
> I yet don't understand how this is possible considering that I am not
> passing any special flag to cmake when I run it from the command line.
>
> On Thu, Feb 27, 2020 at 7:44 AM Nick Overdijk <nick at astrant.net> wrote:
>
>> I usually start Qt Creator (on macos anyway) with "open ~/Qt/Qt
>> Creator.app" to make sure the environment is the same as in my shell. If
>> that doesn't work, maybe inspect what 'cmake' you are calling from the
>> shell, and which one is being used by Qt Creator (Kits -> CMake tab).
>>
>> Cheers!
>>
>> On Thu, Feb 27, 2020 at 1:33 PM Davide Coppola <vivaladav at gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I have been struggling with a CMake project and Qt Creator for a while
>>> and I was wondering if any CMake expert in your dev team could help me to
>>> figure out what's going on.
>>>
>>> This project has a root directory containing a main CMakeLists.txt and
>>> several sub-dirs each with their own file.
>>>
>>> Everything is fine and a Makefile is generated if I run from the command
>>> line:
>>>
>>> cd build
>>> cmake -DCMAKE_BUILD_TYPE=Debug ..
>>>
>>> Things don't go so well when I try to open the main CMakeLists.txt with
>>> QtCreator... I get an error from the first execution of find_package() in a
>>> sub-directory.
>>>
>>> Something I noticed is that the CMakeCache.txt file in build/ is missing
>>> a lot of entries compared to the one generated when running CMake from the
>>> command line. Once again, no idea why.
>>>
>>> I assume CMake gets a different environment when running in QtCreator
>>> compared to the one when executed from the command line, but I have no idea
>>> how to fix that.
>>>
>>> Any suggestions?
>>> _______________________________________________
>>> Qt-creator mailing list
>>> Qt-creator at qt-project.org
>>> https://lists.qt-project.org/listinfo/qt-creator
>>>
>>
>
> --
> *Davide Coppola*
>
> *website:* http://www.davidecoppola.com
> *blog:* http://blog.davidecoppola.com
>
> [image: Follow Us on Github] <https://github.com/vivaladav>
> <http://www.linkedin.com/in/davidecoppola>
> <http://www.twitter.com/vivaladav>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20200227/b7f9669f/attachment-0001.html>


More information about the Qt-creator mailing list