[Qt-creator] build settings for cross platform? multiple svn checkouts on each development computer
Victor Sardina
Victor.Sardina at noaa.gov
Mon Apr 19 05:56:55 CEST 2010
Coda/nobodyhere:
According to my experience (however little), it works well as long as we
do it the way Adam suggested. As long as we put all relevant system
dependent information in the .pro file, then qmake will generate an
actual makefile tailored for each particular platform that reflects
whatever paths you discretized in the .pro file itself.
I only keep the actual "src" directory and the .pro file in the
repository, as all the rest results from running qmake and make to
compile and link: you can reproduce all those files under each platform
just from the source files, as long as you wrote an appropriate .pro
file for qmake to do the heavy lifting for you. This works for me under
Mac, Linux, and even Solaris (I know it works also under Windows, but I
barely do anything under that platform these days). As an added bonus,
you can do everything from the command line, without having to bother
with any IDE. In other words, you can do all the relevant coding under
one platform in GUI mode per se, and then just copy the source files and
the .pro file to another platform (properly written) and do the
compiling and linking by calling qmake and make.
For instance, to reflect the location of some files under Mac and Linux,
or Windows in the .pro files you can use conditional statements:
macx{
INCLUDEPATH += /usr/local/Trolltech/Qt-4.7.0/include
}
unix{
INCLUDEPATH += /opt/Trolltech/Qt-4.7.0/include
}
linux-g++ {
INCLUDEPATH += /opt/local/Trolltech/Qt-4.7.0/include
}
win32{
INCLUDEPATH += C:\Trolltech\Qt-4.7.0\include
}
The above constitutes a hypothetical example to illustrate the issue.
You can find more example in the qmake related help files. You can
specify source, header files, and many other required pieces that way,
per platform. I found this out because I got tired of having to replace
portions of the code each time just because I happened to change the
working platform one particular day or another.
Hope this helps,
Victor
Coda Highland wrote:
> The makefile is generated directly from the .pro file. This is where
> everything needs to go, especially if you want your project to work if
> you're building it at the command line instead of from within Creator.
>
> The .pro.user file is really just intended for short-term,
> system-specific, non-general details that aren't intended to be shared
> with other users of the source code.
>
> The only thing that's "broken" is that it's not clear from the way
> Creator's UI is laid out that this is the case, and it has to be
> explained like this.
>
> Basically, what you need to keep in mind is that Creator is first and
> foremost a tool for writing code and creating software, not for
> managing projects.
>
> /s/ Adam
>
> On Sun, Apr 18, 2010 at 9:35 PM, nobodyhere <pem.accounts.spam at gmail.com> wrote:
>> This makes Qt Creator sound broken? I mean, what's the point of having it generate your make files for you (in the .pro.user file), if you have to then rewrite them manually anyway (in the .pro file)?
>>
>> regards
>>
>> ----- Original Message -----
>> From: "Coda Highland" <coda at bobandgeorge.com>
>> To: qt-creator at trolltech.com
>> Sent: Sunday, April 18, 2010 8:45:29 PM GMT -06:00 US/Canada Central
>> Subject: Re: [Qt-creator] build settings for cross platform? multiple svn checkouts on each development computer
>>
>> No, we mean the .pro file. qmake's file format supports a lot of logic
>> there, including platform detection (scopes like win32, unix, and
>> macx). Never edit the .pro.user file and avoid using Creator's
>> built-in tools for changing the build settings -- do all the work
>> directly in the .pro file except for things that are SPECIFICALLY
>> relevant to only the checkout you're working on.
>>
>> /s/ Adam
>>
>> On Sun, Apr 18, 2010 at 7:32 PM, nobodyhere <pem.accounts.spam at gmail.com> wrote:
>>> You mean edit and (svn commit) the project's ".pro.user" file? (Not the project's ".pro" file?)
>>>
>>> And the .pro file has hardcoded / absolute paths in it, so how does this let me do a simple (svn checkout and build that just works, with the exact same .pro.user file) for (multiple computers) and (multiple checkouts on the same computer)?
>>>
>>> Is it required to manually edit the .pro.user XML file's text?
>>>
>>> thank you for any leads
>>>
>>> ----- Original Message -----
>>> From: "Danny Price" <deepblue842 at googlemail.com>
>>> To: qt-creator at trolltech.com
>>> Sent: Sunday, April 18, 2010 9:21:30 AM GMT -06:00 US/Canada Central
>>> Subject: Re: [Qt-creator] build settings for cross platform? multiple svn checkouts on each development computer
>>>
>>> Set you build settings, project directories and platform-specific configs in the .pro file.
>>>
>>> On 18 Apr 2010, at 09:26, nobodyhere wrote:
>>>
>>>> Is there information on how to (svn commit) cross platform (Windows, Mac, Linux) build settings for a Qt Creator project, that doesn't have any absolute paths?
>>>>
>>>> I created a new project on Windows, then (svn commit) it. Then I did (svn checkout) of the project on Mac OS. Unfortunately, I had to create a new set of build settings to get it to build / compile? But it seems to be storing this build settings stuff in the [project].pro.user file, with absolute paths?
>>>>
>>>> How can I fix it so that I can simplify for anyone to do multiple fresh (svn checkout)'s of the project on each machine (regardless of OS), and have the build / compile just work (for Windows, Mac, Linux builds) (with multiple checkouts per machine, using relative paths)?
>>>>
>>>> Why are there absolute paths in this [project].user.pro file (for example, the buildDirectory has an absolute path)?
>>>>
>>>> thank you for any leads
>>>> _______________________________________________
>>>> Qt-creator mailing list
>>>> Qt-creator at trolltech.com
>>>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>>
>>> _______________________________________________
>>> Qt-creator mailing list
>>> Qt-creator at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>> _______________________________________________
>>> Qt-creator mailing list
>>> Qt-creator at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>>
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: victor_sardina.vcf
Type: text/x-vcard
Size: 577 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20100418/0e89a77c/attachment.vcf
More information about the Qt-creator-old
mailing list