Home » U++ TheIDE » U++ TheIDE: Packages » Subdirectories in packages
Subdirectories in packages [message #32686] |
Thu, 02 June 2011 07:37 ![Go to next message Go to next message](theme/default/images/down.png) |
|
Hello!
Right now I'm trying to use OpenCV 2.2. It's special feature is that all its headers are organized using subfolders (which is great BTW). Now I'm trying to make a package of these headers and meet few problems at once:
1. I can't import whole subtree of headers into package. More like I can, but all the hieracity "flattens" and, obviously, all cross-references between headers breaks.
2. If I just copy whole include dir into my package dir and add each file (tiresome, yep ) manually using "Insert package directory file(s)" (why can't I do it to dirs BTW?), it still doesn't solve my problem, because, somehow, all includes in these headers are invalid once again 'cause they do not include package name! Let me show you an example:
I made a package opencv22 and filled it with headers (with subdirs).
Then, I add "#include <opencv22/opencv2/opencv.hpp>" into my header. It worked.
But then I have a string "#include "opencv2/core/core_c.h"" in this file, which is invalid. The valid ones are "#include "core/core_c.h"" and "#include <opencv22/opencv2/core/core_c.h>".
I really wouldn't like to correct each and every #include directive in opencv code. Maybe there is a better way to fix it?
For clarity I attach package I made.
-
Attachment: opencv22.rar
(Size: 328.94KB, Downloaded 385 times)
|
|
|
Re: Subdirectories in packages [message #32687 is a reply to message #32686] |
Thu, 02 June 2011 08:08 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
|
Hello GaroRobe!
GaroRobe wrote on Thu, 02 June 2011 07:37 | 1. I can't import whole subtree of headers into package. More like I can, but all the hieracity "flattens" and, obviously, all cross-references between headers breaks.
|
Well, I'm not sure why it is designed like this, but I don't like it as well It would be rather easy to implement this functionality, but so far I was always too lazy I always ended up opening the *.upp file in text editor and copying in the list of all files, with the directories as necessary. In Linux, you can get such list easily using 'find' command line utility, on windows it might or might not be possible to get the file list using 'dir' or something (I don't remember any more... ).
GaroRobe wrote on Thu, 02 June 2011 07:37 | 2. If I just copy whole include dir into my package dir and add each file (tiresome, yep ) manually using "Insert package directory file(s)" (why can't I do it to dirs BTW?), it still doesn't solve my problem, because, somehow, all includes in these headers are invalid once again 'cause they do not include package name!
...
I really wouldn't like to correct each and every #include directive in opencv code. Maybe there is a better way to fix it?
For clarity I attach package I made.
|
This can be solved at package level, by adding "internal include" in package organizer. Adding a name of directory will add it to include paths for the give package. The trick in this case is that you add just a single dot "." (meaning current directory). So it will search for the include files in your package dir, where the "core/core_c.h" file will be find ![Wink](images/smiley_icons/icon_wink.gif)
I will add the a request for structured import into the task tracker, I'm pretty sure someone will implement it soon (might even do it myself ).
Hope this helped,
Honza
|
|
|
Re: Subdirectories in packages [message #32688 is a reply to message #32687] |
Thu, 02 June 2011 08:19 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
|
Thanks! Actually helped. I tried "./opencv22", but it didn't help. So had to add "."... I see...
Case closed. Hope to see recursive files import feature soon (guess it's a chance for me to peek at TheIDE internals as well).
|
|
|
Re: Subdirectories in packages [message #32703 is a reply to message #32686] |
Thu, 02 June 2011 14:18 ![Go to previous message Go to previous message](theme/default/images/up.png) |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
GaroRobe wrote on Thu, 02 June 2011 07:37 | I can't import whole subtree of headers into package. More like I can, but all the hieracity "flattens" and, obviously, all cross-references between headers breaks.
|
Hello.
Long time ago I created GetUppFromDir command line utility. It have -r (recursive processing of subdirectories) option for this case. It also useful to create U++ packages from scratch.
Edit:
GaroRobe wrote on Thu, 02 June 2011 08:19 | Hope to see recursive files import feature soon
|
Implemented for 4193 release.
[Updated on: Thu, 08 December 2011 22:52] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Sep 01 07:38:57 CEST 2024
Total time taken to generate the page: 0.00538 seconds
|