1 (edited by JohnWasilewski 2013-03-14 13:55:03)

Topic: Multiple project versions in the same project

I build both 32-bit and 64-bit executables. 
64 because that's what I need for myself.
32 because colleagues using my programs sometimes have Windows 32-bit systems.

What I describe below is for TWO projects and executables in the same project directory - a 32bit and a 64bit version.

Although I don't deal here with how to manage more than two .prj files and executables in one project, the same process could equally be used to create in the same project directory, for example:
   - A development version of the project
   - A 32bit release version
   - A 64bit release version

HOW TO DO IT

The technique enables us to select any one of the above at the click of the mouse on the 'open project' menu, whilst  keeping all of them synchronised.  At least i think this is right.  Someone please tell me if it's not.

I do it by having, in the same project directory, two .prj project files and one SOURCE subdirectory.
The project files have different settings, but they both pull in the same source files from the same subdirectory.
If I debug/edit/ improve, and even sometimes actually make a program work, then everything I've done to the source files works equally on both the 32bit and 64bit versions.

Jeff gave me a useful tip the other day, and I've realised some other, related ones, of my own.

Here are all of them so far:

1.  FIRST, repeat all of the following for all user-made own library
     projects for which the current project links the  .a  library file.

2. Now select project options for the 32bit project,
    - Switch on 'Always generate makefile'
    - Select 32-bit architecture
    - Overwrite the default build directory name with eg Build32
    - Overwrite the default module directory name with eg Module32
    - Set a target executable name with '32' in the name somewhere
    - add whatever other options are wanted
    - Add an icon (optional)
    - SAVE the project (or SAVE-AS)

3. In the 32-bit project outline
    - Add all user source files
    - Add all libraries - (taking care to add only 32-bit ones)
    - SAVE the project (or SAVE-AS) and give the 32-bit project name

4. Now use all the 32-bit options as above to select project options for the 64bit project,
    - Change to 64-bit architecture
    - Overwrite the 32-bit build directory name with eg Build64
    - Overwrite the 32-bit module directory name with eg Module64
    - Change the target executable name to include '64' in the name somewhere
    - add whatever other options are wanted
    - Change the icon (optional)
    - DO NOT SAVE
    - SAVE-AS and give the 64-bit project name

5. For the 64-bit project outline
    - Keep 'Always generate makefile' switched on
    - Keep all the same user source files
    - Remove all 32-bit libraries
    - Add all 64-bit libraries (taking care to add only 64-bit ones)
    - SAVE the project (or SAVE-AS)

You can then flip back and forth between 32-bit and 64-bit projects, and it won't matter which one you are in when editing source files.
---
John

Re: Multiple project versions in the same project

Jeff, if you put a button or three, somewhere, you might be able to automate this a bit.

You could, for example, enable users to create versions A, B and C of a project, switching between them with a mouse click.
Users not wanting to use this could find themselves automatically in version A, where they could just do as we all do now.
You could ghost or hide the B and C options somehow if not wanted.

The labelling alongside the selector could call them A, B and C, but it could also suggest
their uses as   DEV,   REL-32  and  REL-64.

The letter A, B or C could auto-append the BUILD and MODULES subdirectory name setting. 

By default, any  .for  .f90  .f95  etc   source files added to or removed from one would be added/removed to/from all three but adding or removing binary files would affect only the currently selected sub-project.

Changing other options (eg 32/64 bit architecture) would affect only the currently-selected sub-project.
---
John