Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to use linked folders?: (3 Items)
   
How to use linked folders?  
I'm having difficulty setting up a QNX C++ project to use linked folders.  First, some background information.

I am using Momentics IDE 4.7.0 on Windows XP.

The project is being ported from another development environment to QNX.  We are using a source control product that is 
old and poorly integrated into Eclipse.  The directory structure is currently set up something like this:

(base)/
  +-project_a
  |
  +-project_b
  |
  +-project_c
  |
  +-shared_x
  | +-source
  |
  +-shared_y
  |  +-source
  |
  +-shared_z
     +-source

'project_a', 'project_b', and 'project_c' are QNX C++ projects.  They need to reference all the '.cpp' and '.h' files in
 'shared_x/source', 'shared_y/source', and 'shared_z/source'.  The shared source files can't be prebuilt because they 
all reference an include file 'project.h' which contains project-specific constants and definitions.  So the QNX 
projects only contain this include file locally, and all the shared source code must be built in the context of the 
project.  '(base)' is the source control product's working directory and will be different on each developers PC.  
Because of the legacy nature of the development, I do not have much leeway in rearranging the directory structure.  The 
shared files are also used by Microsoft Development Studio and another third-part development product.

So I tried using linked folders to implement this directory structure in the QNX projects.  Since '(base)' can be 
different for each developer, I created a path variable called 'WORKSPACE' as the base for the shared folders and 
created links to all three shared directories.

When I tried building the project, it didn't compile any of the shared files.  So I changed the linked folders to Source
 linked folders.  They still didn't compile.  Finally, in the QNX Compile project settings, I created entries in the "
extra source paths" field for each shared directory.  This worked for building.  HOWEVER, the extra source paths were 
save as absolute paths, and when I changed WORKSPACE, these paths did NOT change.

I then tried to trick the IDE into using relative paths.  I deleted all the linked folders and created dummy static 
library projects for each shared directory.  I could then set the extra source paths with workspace-relative variables. 
 This worked for building the project.  HOWEVER, if I edited a shared file and then built the project, the edited file 
was NOT saved before building.

So I tried one more trick.  In the shared library projects, I set the file associations so that all .ccp and .h files 
were declared C header files.  In the main project, I added the static library projects as project references so the 
main project would build them first.  Building a project with all header files is a null operation.  When I edit a 
shared file and manually build its static library project, the file was saved before building. HOWEVER, when I build the
 main project, it does build the referenced project first, but the IDE did NOT save the edited file.

So, I've settled on an inelegant but working solution.  I'm using linked folders with the '(base)' set to "V:".  All 
developers must use the Windows 'subst' command to mount their workspace directory to the V drive before starting 
Momentics.

Why, oh why can't I create workspace-relative linked folders in the Momentics IDE?
Re: How to use linked folders?  
If you using QNX projects you cannot use link folders - link folders is purely eclipse concept and can work only eclipse
 base builders (such as managed project).
QNX project used make system - and all files should be in actual filesystem.
In QNX project you can easily specify extra sources and extra includes you need in your project - so it can pick files 
from folders outside of your project.
I don't remember names of variables, the common include folder you can definitely do through IDE controls - check 
compiler tab.

On 11/11/10 09:55 AM, Robert Murrell wrote:
> I'm having difficulty setting up a QNX C++ project to use linked folders.  First, some background information.
> 
> I am using Momentics IDE 4.7.0 on Windows XP.
> 
> The project is being ported from another development environment to QNX.  We are using a source control product that 
is old and poorly integrated into Eclipse.  The directory structure is currently set up something like this:
> 
> (base)/
>   +-project_a
>   |
>   +-project_b
>   |
>   +-project_c
>   |
>   +-shared_x
>   | +-source
>   |
>   +-shared_y
>   |  +-source
>   |
>   +-shared_z
>      +-source
> 
> 'project_a', 'project_b', and 'project_c' are QNX C++ projects.  They need to reference all the '.cpp' and '.h' files 
in 'shared_x/source', 'shared_y/source', and 'shared_z/source'.  The shared source files can't be prebuilt because they 
all reference an include file 'project.h' which contains project-specific constants and definitions.  So the QNX 
projects only contain this include file locally, and all the shared source code must be built in the context of the 
project.  '(base)' is the source control product's working directory and will be different on each developers PC.  
Because of the legacy nature of the development, I do not have much leeway in rearranging the directory structure.  The 
shared files are also used by Microsoft Development Studio and another third-part development product.
> 
> So I tried using linked folders to implement this directory structure in the QNX projects.  Since '(base)' can be 
different for each developer, I created a path variable called 'WORKSPACE' as the base for the shared folders and 
created links to all three shared directories.
> 
> When I tried building the project, it didn't compile any of the shared files.  So I changed the linked folders to 
Source linked folders.  They still didn't compile.  Finally, in the QNX Compile project settings, I created entries in 
the "extra source paths" field for each shared directory.  This worked for building.  HOWEVER, the extra source paths 
were save as absolute paths, and when I changed WORKSPACE, these paths did NOT change.
> 
> I then tried to trick the IDE into using relative paths.  I deleted all the linked folders and created dummy static 
library projects for each shared directory.  I could then set the extra source paths with workspace-relative variables. 
 This worked for building the project.  HOWEVER, if I edited a shared file and then built the project, the edited file 
was NOT saved before building.
> 
> So I tried one more trick.  In the shared library projects, I set the file associations so that all .ccp and .h files 
were declared C header files.  In the main project, I added the static library projects as project references so the 
main project would build them first.  Building a project with all header files is a null operation.  When I edit a 
shared file and manually build its static library project, the file was saved before building. HOWEVER, when I build the
 main project, it does build the referenced project first, but the IDE did NOT save the edited file.
> 
> So, I've settled on an inelegant but working solution.  I'm using linked folders with the '(base)' set to "V:".  All 
developers must use the Windows 'subst' command to mount their workspace directory to the V...
View Full Message
Re: How to use linked folders?  
> If you using QNX projects you cannot use link folders - link folders is purely
>  eclipse concept and can work only eclipse base builders (such as managed 
> project).
> QNX project used make system - and all files should be in actual filesystem.
> In QNX project you can easily specify extra sources and extra includes you 
> need in your project - so it can pick files from folders outside of your 
> project.
> I don't remember names of variables, the common include folder you can 
> definitely do through IDE controls - check compiler tab.

The problem with extra source paths is that they use absolute file paths.  I want to use relative file paths like:

$(WORKSPACE)/shared_a/source

The other problem is that the IDE does not automatically save these extra source files when the project is built.

And link folders do work in a QNX project.  I can create the links, and they show up under the project when I add extra 
source paths.  They are converted to absolute paths when I add them.