views:

42

answers:

1

I was wondering if anyone has experience with maintaining a Qt application on Visual Studio (2008+) that has both Win32 (32-bit) and x64 (64-bit) platforms?

The default Qt project comes with only the 32-bit library. While I know how to build Qt as 64-bit, how do you setup Visual Studio, Qt, etc such that you can easily switch between the two?

+1  A: 

We are currently doing this. Our way for doing this uses inherited property sheets.

We first create a master property sheet that contains all the settings, paths, macros, etc that are common to all configurations. We find placing these in the root directory of the solution to be the most convenient way.

Then for each configuration, debug/release & 32/64bit we made 4 separate build property sheets that -

  1. Each Inherit the master property sheet (use View/Property Manager on VS toolbar).
  2. Configure each sheet to link to the correct Qt library dll.

Now for the tedious part - For each project in your solution, there are 4 separate properties. You now have to inherit each build property sheet into the respective property settings of the project. For example, 32bit release build property sheet has to be inherited by the 32bit release property settings.

Assuming all Qt dll's are in the same directory, all configuration should work the same.

photo_tom
That seems painful, but I'm not aware that there's a better way. qmake can generate makefiles specific to 32-bit and 64-bit systems (as well as debug and release). So, if you don't have to customize them, you can generate VS solution files using QMake. Then, the only real question becomes whether you can find a way to use the same set of source files with the different solutions.
Kaleb Pederson
You are correct about QMake. But we do have a number of custom settings that don't work using QMake as we also use the property sheets to configure runtime options. However, the pain with our technique is only one time when you create a project, so it is not on going.
photo_tom