Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Include existing source tree into QNX C++ Project in Momentics v4.7.0, Linux: (3 Items)
   
Include existing source tree into QNX C++ Project in Momentics v4.7.0, Linux  
I asked this first in Core Tools but then realized I'm in a wrong branch.

Basically, the problem is I seems can't import an exiting source tree preserving complete directory structure into a QNX
 C++ Project in Momentics. The tree gets imported and appears under project in Project Explorer but the source files are
 excluded from the build. I'm just getting

make[2]: Nothing to be done for `all'.

The only working way to add existing files into QNX C++ Project I found so far is to drag & drop files manually from 
Nautilus into Project Explorer in Momentics. Now this is an acceptable solution if I had a bunch of files but I have 
hundreds and hundreds of them. They are all organized into a nice and clean structure on the disk. I hate the idea to 
manually drag & drop them into one flat group in Project Explorer in Momentics. There is no way I can then find any file
 in there to edit it.

Strangely enough, importing an existing source tree (preserving the directory structure) works ok in same Momentics IDE 
if I go with "C/C++ Project" rather than "QNX C++ Project". Used this a lot in stock Eclipse builds too. 

Any ideas how to fix this?

Thanks.
Re: Include existing source tree into QNX C++ Project in Momentics v4.7.0, Linux  
Hi!

Maybe I have one possible sollution for you.

If you have used makefiles in your project your want to import, you can do :

1. set the workspace-directory of momentics on directory 1 level below all of your source code
2. create a new common C or C++ Project (not QNX-C Project) for each makefile. Chose "Empty Makefile Project" and "QNX 
Toolchain" . Name the project like the subdirectory where the makefile and sources lies (ignore the warning of existing 
directory)
3. create your own make targets e.g. "all" , "clean" etc. in the ShowView "Make Targets"
4. maybe you have to change/configure your makefile e.g. CC=qcc -lang-c  ... 

Example:

workspace dir : "xxxsrc"
xxxsrc/p1/makefile and sources for binary1 or objects -> new C-Project named p1
xxxsrc/p2/makefile and sources for binary2 or objects -> new C-Project named p2
... etc.

you can choose different workspaces too

there is also another possible sollution importing or linking your files from somewhere (Import... - General - File 
System ...) after creating a new "C Project" in a totally different workspace. 
Re: Include existing source tree into QNX C++ Project in Momentics v4.7.0, Linux  
Hi,

I ran into the exact same problem described by the OP.

After importing, the tree structure in a QNX C/C++ Project, I had to manually add each sub-folder ONE BY ONE to the 
project's "Extra Source Path" list. Eventually, Momentics consented taking my files into account for the build. FYI, 
this option is located in:

Project's preferences -> QNX C/C++ Project -> Compiler -> Category: Extra Source Path -> Add from: Project -> <select 
your folders>

Why do I have to tell the IDE to take into account the file I just imported? What is the point of importing my tree 
structure then?
Moreover, it seems that each sub-folder gets added to the include path, which I do NOT want.

Also, the solution presented by Mike Lorenz seems weird: What is the point of using an IDE with an import feature if I 
have to hack the Makefiles?

Can Momentics import source files and also take them into account during the build in one operation?

Thanks and regards
Julien Lemaitre