Am Sep 10, 2009 um 12:17 AM schrieb ext Miles Gazic:

> I found the place in the code where the make command is constructed  
> (makestep.cpp, MakeStep::init() and MakeStep::updateDetails()), and  
> the places in the code that parse the .pro file  
> (qt4runconfiguration.cpp's Qt4RunConfiguration::updateTarget() and  
> qt4nodes.cpp's Qt4PriFileNode::createProFileReader()).   
> Unfortunately I cannot see how to either add the make option "-f  
> filename" from the places that parse the .pro file, or add parsing  
> of the .pro file to the place that sets up make options.  The two  
> places in the code are too uncoupled to accomplish what I am trying  
> to do, as far as I can tell.
>
> However, backtracking a step, I'll tell you what my end goal is (and  
> why I started looking into using QMAKE_MAKEFILE):  I want to be able  
> to automatically have qtcreator put all generated files in a  
> directory different from the directory the .pro file is located in.   
> The reason I want generated files to go into a different subdir is  
> to keep the source directory clean.  I realized that qmake partially  
> supports that with the OBJECTS_DIR, MOC_DIR, DESTDIR, UI_DIR  
> options, but it's really annoying that I can't get the Makefile to  
> go to that directory as well, or change the makefile's name to a  
> different name (which works in qmake, but not in qtcreator.  If it  
> can't go to a different directory, I need the Makefile to have a  
> different name so that it doesn't overwrite my Makefile that already  
> exists, that I have in my qt app directories to invoke qmake for qt  
> projects, so that my top-level build (which is gnu-make based) will  
> work).
>
> When building solely from the command line I can simply cd to my  
> "obj" directory and invoke qmake from there, and it'll generate a  
> makefile in that dir that when executed puts all generated files in  
> that dir, and everything is perfect.

I'm not sure why you think that in this case "everything is perfect",  
if you think that setting the option to build there in Qt Creator is  
not.
Other users checking out your project also don't get the operation "cd  
to the 'obj' directory and run qmake && make from there"  
automatically, right?

> However, I am unable to get qtcreator to automatically use that  
> directory when I debug.  CD'ing before opening qtcreator has no  
> effect, because qtcreator will put all generated files in the  
> directory the .pro is located in (so you can open qtcreator by  
> double-clicking a .pro file through a gui file manager, I assume).

Cd-ing into a directory before running Qt Creator is something you'd  
need to do everytime before you want to build/debug from Qt Creator,  
the way you propose. I don't see what the advantage of that in  
comparison to setting the shadow build option in Qt Creator once, the  
first time you open that project.

If you do *different* builds, like a release build in one directory,  
and a debug build in another, and want to switch between these, you  
should create two different build configurations in Qt Creator, with  
the two different build directories. Which you can switch via the  
"Build" menu and the context menu of you project in the project tree  
atm.

> I was able to modify qtcreator to use a couple command-line options,  
> that can make it work like I'd like.  One is "--workhere" that makes  
> the working directory set to the current directory that qtcreator is  
> invoked from, the other is "--workdir=/path/to/work/dir", that sets  
> the working directory to the path specified in the option.  Any  
> possibility that my "--workhere" and "--workdir" options would get  
> accepted if I submit the patches?
>
> Another option I'd be *very* happy with is if there was an option  
> like "shadowBuild" that was able to be read from a .pro file, but  
> when investigating that, I ran into the same problems as trying to  
> implement checks for QMAKE_MAKEFILE: I'd need to have access to info  
> from the .pro file in makestep.cpp, and I don't know how to do  
> that.  Plus, I'm hesitant to add a setting to a .pro file that isn't  
> recognized by qmake, and I doubt the qmake developers will be happy  
> about adding a setting that's equivalent to a simple "cd" before  
> invoking qmake.  The reason the existing qtcreator option  
> shadowBuild doesn't work for me is because it's stored in  
> a .pro.user file, which I don't want to check in to revision  
> control, because of all the user defined settings that are in there.
>
> Thanks,
> Miles
>
> On Wed, Sep 9, 2009 at 3:15 AM, Daniel Teske  
> <daniel.te...@nokia.com> wrote:
>
>
> The tricky case is if someone sets QMAKE_MAKEFILE to different values
> based on different scopes. That's currently impossible to support.
> Otherwise it should be doable. Though I haven't looked at that in  
> detail.
>
> daniel
>
> <ATT00001.txt>

-- 
Eike Ziller
Software Engineer
Nokia, Qt Development Frameworks
Phone  +49 (0)30 6392 3255
Fax    +49 (0)30 6392 3256
E-mail eike.zil...@nokia.com





_______________________________________________
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to