[Qt-creator] [QtCreator] CMAKE_INSTALL_PREFIX overwritten with /usr/local

Tobias Hunger Tobias.Hunger at qt.io
Mon Oct 31 14:11:42 CET 2016


On Mon, 2016-10-31 at 13:20 +0100, Christoph Mathys wrote:
> Hi Tobias,
> 
> On Thu, Oct 27, 2016 at 3:57 PM, Tobias Hunger <Tobias.Hunger at qt.io> wrote:
> > On Thu, 2016-10-27 at 15:40 +0200, Christoph Mathys wrote:
> > > Is there a way to stop QtCreator from always passing
> > > CMAKE_INSTALL_PREFIX? Or if not, can it automatically use the value
> > > that is already configured in cmake instead of assuming /usr/local?
> > 
> > No idea, sorry. I do not know where that setting comes from in your setup.
> > It is
> > definitely not set in mine.
> 
> Hmm, I had another look. Indeed, CMAKE_INSTALL_PREFIX is not found on
> the cmake call done by QtCreator, sorry for that misinformation. I
> guess I had some FUd kit configurations while experimenting.
> 
> But I still loose the setting of CMAKE_INSTALL_PREFIX when I change
> anything in the current kit, for example edit its name. QtCreator then
> invokes cmake, and for some reason cmake falls back to the default
> prefix /usr/local. The same cmake call executed in a shell behaves as
> expected. Does QtCreator manipulate CMakeCache.txt in any way in case
> the kit is altered?

Yes, it does that: Creator assumes to be in charge of the build directory and
will delete the cmake cache file whenever it thinks that is necessary. That
should be whenever the kit changes in a way that makes creator assume that cmake
will not be able to run anymore -- that is mostly when it thinks the generator
has changed and maybe some more equally critical things that cmake can not
handle on the fly.

It will then pass the kit and the project configuration as defined in Creator
and regenerate the cache file with that information. So setting
CMAKE_INSTALL_PREFIX from Creator should work.

Best Regards,
Tobias

-- 
Tobias Hunger, Senior Software Engineer | The Qt Company
The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho. Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B


More information about the Qt-creator mailing list