PDA

View Full Version : Changing the -spec flag for qmake needs Makefile deletion



yop
12th March 2006, 17:44
I have tested with Qt 3.3.5 (linux) and Qt 4.1.0 (linux). Here's the case: I have gcc and icc installed in my linux box. For a Qt project if I run qmake -spec linux-g++ I get a Makefile that builds flawlesly with g++. If I delete the Makefile and run qmake -spec linux-icc I get a Makefile that also builds flawlesly using icc. The problem is that if I don't delete the gcc Makefile and run qmake -spec linux-icc I get the gcc Makefile again. Probably qmake just checks if the project has changed (new libs, source files, deps whatever) to generate a Makefile, but when the compiler changes does nothing. Is there a clever way around this? My question is for the QtWorkbench plugin I'm writing for Code::Blocks (you can get some info here (http://forums.codeblocks.org/index.php?topic=2253.0)) and deleting the Makefile "by hand" is not an option. Let's see if anyone else can come up with something. Thanks for your time,
Yorgos

jacek
12th March 2006, 17:57
Maybe you could just "touch" the .pro file?

yop
12th March 2006, 18:56
Maybe you could just "touch" the .pro file?
The .pro file is recreated in every build, so the modification time is different. Also since the same aproach is also used in widows, is there something resembling "touch" in windows? I just mentioned the linux case cause this is where I have two compilers working with Qt. I will install Qt 3.2 (the free one that comes with the book) in windows for some extra tests at a later time.

jacek
12th March 2006, 19:12
The .pro file is recreated in every build, so the modification time is different.
AFAIR if .pro file was modified after the Makefile, make will run qmake. Maybe you should set the QMAKESPEC environment variable?

yop
12th March 2006, 20:07
AFAIR if .pro file was modified after the Makefile, make will run qmake.
You are right but this doesn't change the fact that the same Makefile is created. Let me tell you about the steps I take. I create the .pro file depending on the users selections, I run qmake, I build using the created Makefile. Most of the .pro contents (SOURCES, FORMS, HEADERS and many others) are calculated and updated when the user builds the project, so between consecutive builds there is always a "new" .pro file.
Maybe you should set the QMAKESPEC environment variable?I have but it also didn't work. Also since it is intended to be a tool for other users as well, I don't want to mess with their enviroment behind the scenes.

yop
13th March 2006, 20:22
Well distcleaning worked :o . I guess I had to see it from another point of view to get it done (or read the Makefile a little closer ;) )