Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Seperating the IDE / build project from the source tree: (2 Items)
   
Seperating the IDE / build project from the source tree  
Dear all, 

for a platform component which is built for multiple target architectures (not only QNX) we would like to organize the 
source tree seperately from the build files and IDE project files, something like this: 

project
   + build
          +  container
                     + <platofrm1>
                     + <platform2>
          + <component1> 
                     + <platform1>
                     + <platform2>
          + <component2>
                     + <platform1> 
                     + <platform2>
          + [...]
  + src
         + <component1>
         + <component2>

The goal is to keep the source tree tidy and free of platform dependent description / build files.  

The second goal is to share the project / build files via Subversion, thus all project / build files shall only 
reference sources with relative paths such that the local working copy location is irrelevant.

We also want to be able to browse / edit / build / debug sources from the IDE of the repsective platform, e.g. QNX 
Momentics. Thus, an IDE project located under the "build" tree should display associated sources from the "src" tree (e.
g. with an external sources link). It is acceptable that the external source location is disovered during the first 
build (after SVN checkout) and the linked folder is only displayed afterwards. 

Is it possible to set that up with the QNX Momentics IDE - without ending up with hardcoded paths in the IDE .project / 
.cproject files ? 
What project type (QNX C Project or Managed Project) is the better way to achieve it ? 

Thanks,
Christopher
Re: Seperating the IDE / build project from the source tree  
Hi, Christopher,

Using the recursive makefiles provided with the QNX SDP, you can 
maintain a single source tree that targets Win32 and Linux operating 
systems in addition to Neutrino.  The project layout looks like

   project
     - Makefile   [LIST=COMPONENT]
     + <component1>
        - Makefile  [LIST=OS]
        - common.mk
        + nto
            - Makefile  [LIST=CPU]
            + <cpu>
               - Makefile   [LIST=VARIANT]
               + <variant>
                  - Makefile   [include ../../../common.mk]
        + win32
            - Makefile  [LIST=CPU]
            + x86
               - Makefile   [LIST=VARIANT]
               + <variant>
                  - Makefile   [include ../../../common.mk]
        + linux
            - Makefile  [LIST=CPU]
            + x86
               - Makefile   [LIST=VARIANT]
               + <variant>
                  - Makefile   [include ../../../common.mk]
     + <component1>
         ...

See the Programmer's Guide documentation for details of how this layout 
works:  
http://www.qnx.com/developers/docs/6.4.1/neutrino/prog/make_convent.html

Platform-specific considerations can be managed using a QNX C/C++ 
Project in the common.mk, with its extended macro syntax for variants.

If you don't want to maintain Makefiles in your source tree, then you 
should be able to accomplish the separation that you describe using 
plain makefile projects (New C/C++ Project, the  "Makefile project -> 
Empty project" template) with the "No toolchain" option.  A managed-make 
project won't work because you will need different toolchains for the 
different platforms, but a managed project only has one toolchain.

Put your Makefiles in the build/<component1>/<platform1> etc. folders 
and have them compile the sources from the src/<component1> etc.  
trees.  For an example of how this might work in the IDE, create a 
Managed Make project with a source folder that links to a folder in some 
other project.  Update the project settings to use the external "Gnu 
Make Builder" and build the project to generate the makefiles.  The 
generated files will use absolute paths where you would want to use 
relative paths for workspace portability, but otherwise the basic 
structure should work similarly.  I expect that it would take a fair 
amount of work to set this up, with duplication across all of the 
platform build folders, which will be a bit of a maintenance headache as 
the source tree evolves.  The QNX SDP's recursive makefiles really do 
greatly simplify this problem.

Where running and debugging is concerned, the IDE provides all of the 
flexibility that you need to configure gdb's library search path, source 
look-up path, etc.  You would need different launch configurations for 
the different platform binaries, of course, each using the appropriate 
gdb, but that's all straightforward to do.  Including sources in your 
project via linked folders makes them appear to be members of that 
project, and all the usual editing functions should "just work."

HTH,

Christian


On 14/06/10 10:43 AM, Christopher Pohl wrote:
> Dear all,
>
> for a platform component which is built for multiple target architectures (not only QNX) we would like to organize the
 source tree seperately from the build files and IDE project files, something like this:
>
> project
>     + build
>            +  container
>                       +<platofrm1>
>                       +<platform2>
>            +<component1>
>                       +<platform1>
>                       +<platform2>
>            +<component2>
>                       +<platform1>
>                       +<platform2>
>            + [...]
>    + src
>           +<component1>
>          ...
View Full Message