How to have a project that can compile on multiple platforms
-
How would that be setup in QtCreator (because I tried and that's what I ended up with my solution).
But even if it works, I don't think it will resolve the issue with user settings file, as it seems to be platform specific.
-
What we do here, we develop on one platform and we delegate building to controlled environment (buildbox, like cruisecontrol).
This way, you an independant status of your project, on all platforms that you want to support which reflects exact status of your configuration management.
Another solution is to build using command line, which doesn't care about "user preferences", which are for QtCreator only:
@
qmake -r
make (or nmake on windows/VC)
@Hope this helps,
-
How do you distribute your code between the different platforms?
Your xxx.pro.user problem is only an issue, if you copy complete directories or use a shared directory (probably via a network volume/drive). Both are a Bad Idea™...
-
I am using a network drive, since it is part of a very thorough backup policy. Why is that a bad idea?
-
Because you easily can mess up things, let alone modifying one source file on two editors simultaneously.
I strongly suggest using some (distributed) source code management system for synchronizing things. I personally use mercurial for this, but git and bazaar do the trick too. I would avoid introducing subversion or even CVS on new projects nowadays. They all work on filesystems too. So you can use the network drive as a kind of "central repository" where the actual exchange happens.
This way you have the advantage that no .pro.user files are checked in and you can manage them on their respective platforms.
And as a minor advantage: With distributed source control management, you have (at least paratial) backups on every machine involved.
And everyone wants to have their source code in a SCM anyways, won't they? :-)
-
I guess you're right, even though I'm the only one working on this project.
So in this scenario, I'd keep my .pro as it is, and just not check in the .pro.user files? -
[quote author="hsfougaris" date="1301672624"]I guess you're right, even though I'm the only one working on this project.
So in this scenario, I'd keep my .pro as it is, and just not check in the .pro.user files?[/quote]Yep! That's exactly what I do here too.
-
[quote author="Volker" date="1301673063"][quote author="hsfougaris" date="1301672624"]I guess you're right, even though I'm the only one working on this project.
So in this scenario, I'd keep my .pro as it is, and just not check in the .pro.user files?[/quote]Yep! That's exactly what I do here too.[/quote]
How exactly do you configure Qt on the "other" computers to use the distributed SCM?
I installed mercurial on my main development PC, created a repository, configured it in QtCreator, and everything works fine...
I run hg serve on this PC.
I can pull from the command line of the other PC the project, but what would I specify so it does all this automating pulling/committing (when requested) to the remote repository?
(I'm new to this so forgive me if this is a stupid question) -
You could write a script, that is called before make start. But I do not recommend this. Some time you will eventually end up with having modified the sources on both machines. In my opinion, syncing manually is a more reliable approach in this case (think of merge conflicts that need manual resolution).
On Windows, I use "TortoiseHg":http://tortoisehg.bitbucket.org/ - command line tools on Windows are... ahm.. suboptimal to use :-) They have a Mac OS X port too, but I never tried this - OS X command line (bash to be precise) is a joy to work with.
-
Agreed with Volker : pre build hook to sync your files can lead to madness.
My advice, if you really want to have a per-commit build on all platforms : put cruise control (or any other continuus integration tool) in place and let it listen to your repository.
This way, each time you commit (or on demand), you can trigger a build on all your platforms, with an environment which is under better control.
On a side note, compared to using shared environment on a folder, using a version control manager allows you to revert mistakes :-)
-
The Mercurial/Creator specific part has been moved to "this thread":http://developer.qt.nokia.com/forums/viewthread/4932/