Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to include a singe external source file into a QNX project?: (4 Items)
   
How to include a singe external source file into a QNX project?  
I have a project that needs to reference a single source file in an external directory containing many source files.  I 
cant use the "extra source path" attribute of the project because that will try to build all the source files under that
 directory.  I used the native Eclipse link mechanism to reference this one file in the project but that caused 
dependency checking problems.  It seems that QNX projects do not like linked files.  Is there another mechanism for 
adding a single external source file to a QNX project?
Re: How to include a singe external source file into a QNX project?  
Hi, Robert,

The QNX Project uses make to build, and because make runs outside of the
Eclipse context, it has no idea about linked resources.

To add a single external file your project, you can edit the common.mk to
add something like this after the "include $(MKFILES_ROOT)/qmacros.mk":

    vpath %.c $(PROJECT_ROOT)/../path/to/external/sources
    SRCS+=extra.c

This will add the folder containing the extra source file to your vpath,
which EXTRA_SRCVPATH does, but doesn't additionally add all of the sources
in that folder.  In this example, the "extra.c" file is assumed to be in the
../path/to/external/sources folder relative to the current project root
folder.

HTH,

Christian



On 10-12-02 9:42 AM, "Robert Murrell" <community-noreply@qnx.com> wrote:

> I have a project that needs to reference a single source file in an external
> directory containing many source files.  I cant use the "extra source path"
> attribute of the project because that will try to build all the source files
> under that directory.  I used the native Eclipse link mechanism to reference
> this one file in the project but that caused dependency checking problems.  It
> seems that QNX projects do not like linked files.  Is there another mechanism
> for adding a single external source file to a QNX project?
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post76830
> 
> 

-- 
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>; 

Re: How to include a singe external source file into a QNX project?  
> Hi, Robert,
> 
> The QNX Project uses make to build, and because make runs outside of the
> Eclipse context, it has no idea about linked resources.
> 
> To add a single external file your project, you can edit the common.mk to
> add something like this after the "include $(MKFILES_ROOT)/qmacros.mk":
> 
>     vpath %.c $(PROJECT_ROOT)/../path/to/external/sources
>     SRCS+=extra.c
> 
> This will add the folder containing the extra source file to your vpath,
> which EXTRA_SRCVPATH does, but doesn't additionally add all of the sources
> in that folder.  In this example, the "extra.c" file is assumed to be in the
> ../path/to/external/sources folder relative to the current project root
> folder.
> 
> HTH,
> 
> Christian

This helps somewhat but I dislike having to hardcode filenames into common.mk.  Why can't the QNX plugin to Eclipse look
 for linked resources and modify its make files accordingly?
Re: How to include a singe external source file into a QNX project?  
Hi, Robert,

I think your suggestion is a good idea.  I've entered it into our database
for consideration in a future release.  I expect we'll have to think
carefully about how to encode paths in the makefile as relative to the
project root, etc.  There will be several use cases to account for.

Thanks!

Christian


On 10-12-02 12:16 PM, "Robert Murrell" <community-noreply@qnx.com> wrote:

>> > Hi, Robert,
>> >
>> > The QNX Project uses make to build, and because make runs outside of the
>> > Eclipse context, it has no idea about linked resources.
>> >
>> > To add a single external file your project, you can edit the common.mk to
>> > add something like this after the "include $(MKFILES_ROOT)/qmacros.mk":
>> >
>> >     vpath %.c $(PROJECT_ROOT)/../path/to/external/sources
>> >     SRCS+=extra.c
>> >
>> > This will add the folder containing the extra source file to your vpath,
>> > which EXTRA_SRCVPATH does, but doesn't additionally add all of the sources
>> > in that folder.  In this example, the "extra.c" file is assumed to be in >>
the
>> > ../path/to/external/sources folder relative to the current project root
>> > folder.
>> >
>> > HTH,
>> >
>> > Christian
> 
> This helps somewhat but I dislike having to hardcode filenames into common.mk.
> Why can't the QNX plugin to Eclipse look for linked resources and modify its
> make files accordingly?
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post76903
> 
> 

-- 
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>;