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. 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). 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 <[email protected]> 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 >
_______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
