[Qt-creator] Qt Creator 4.3.1 - CMake fails without arguments

Tobias Hunger Tobias.Hunger at qt.io
Wed Jul 19 14:30:26 CEST 2017


Hi Tancredi-Paul,

On Wed, Jul 19, 2017 at 10:56 AM, Tancredi-Paul Grozav <pgrozav at computervoice.ro> wrote:
>   I have one problem with Qt Creator 4.3.1. My CMake project is configured
> so that if CMake is ran without parameters it throws an error saying that it
> needs some variables passed. This leads to Qt not being able to open the
> project.
>
>   I'm not sure if this a problem with the IDE, it seems to run cmake
> (without arguments) before allowing me to set the project configuration and
> pass any required parameter (in Build Settings) for cmake to finish
> successfully.

This is mostly correct.

Creator does pass some settings to cmake right from the start. These are all those you define for your kits (Tools>Options>Build & Run>Kits). This is a good place to put all the settings you need all the time and contains the configured compilers and Qt versions by default.

Once cmake ran (and -- in your case -- failed), you can edit settings in project mode. Unfortunately the settings are empty when cmake was not successful, which is rather annoying, but I hope I to see this fixed in cmake in time. You can still add settings there manually via the "add" button. Not nice, but it should get the job done for the time being.

>   Is this a problem in the IDE, or should I update the CMake files so that
> they run successfully even without parameters?

Making it as simple as possible for new people to get aboard is in my experience a worthwhile thing to do. So, yes, simplifying your build system for new users is something you should consider doing, but not for Qt Creators sake:-)

Best Regards,
Tobias


More information about the Qt-creator mailing list