Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Include option for specific package
Re: Include option for specific package [message #21983 is a reply to message #21944] Sun, 14 June 2009 00:58 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello Mirek,

I added the minimal changes for future: include options for specific package, I hope it is correct. Can you check my changes?

Dirrectory path is same as files <directory>{\<directory>}
Ex: lib\common

If is accepted I can add more wizard things(select directory path dialog, set full path or short path).
Include order, I should add first UPP directory (GetVar("UPP"), after then include directories by package uses and after then add global include path.

The source code is written very clear and professional. Thank you to U++ authors and contribuitors! Of course, exist things that can be optimized (in my point of view)!

I was attached only changed files.

Any suggestions is welcome!
Re: Include option for specific package [message #21986 is a reply to message #21983] Sun, 14 June 2009 09:08 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

I have not possibility to add in a message to files for show an screenshot example:
index.php?t=getfile&id=1784&private=0

Here I tested xlslib example added by Koldo in U++.
Re: Include option for specific package [message #22039 is a reply to message #21986] Mon, 15 June 2009 09:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
Well, to make things sure...

Is all this about

#include <header.h>

in existing code? (instead of #include "header.h" or something like that).

I am not quite sure about it either. In ANY CASE, it should NOT accept absolute paths, or at least, warn about them.

Mirek
Re: Include option for specific package [message #22040 is a reply to message #22039] Mon, 15 June 2009 09:56 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

luzr wrote on Mon, 15 June 2009 10:15

Well, to make things sure...

Is all this about

#include <header.h>

in existing code? (instead of #include "header.h" or something like that).

I am not quite sure about it either. In ANY CASE, it should NOT accept absolute paths, or at least, warn about them.

Mirek


I agree with you about warn when set full path in include option by package.

Another question is where need to add include option by package by order?
After GetVar("UPP")?
can I add it in svn with all changes requested?
Re: Include option for specific package [message #22164 is a reply to message #22040] Sun, 21 June 2009 19:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
I have added "Add to include path" file option that hopefully solves this problem.

IMO, it is less faulty than adding include paths for package and, in the end, maybe even slightly easier to use.

Mirek
Re: Include option for specific package [message #22178 is a reply to message #22164] Tue, 23 June 2009 10:14 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

luzr wrote on Sun, 21 June 2009 20:22

I have added "Add to include path" file option that hopefully solves this problem.

IMO, it is less faulty than adding include paths for package and, in the end, maybe even slightly easier to use.

Mirek


For me, I spent minim 1hour to understand how it works. It is not so simple to understand, I thing that you have little complicated realization. I do not know how the new u++ developers will acomodate with this.

May be I'm single so slowly.

I would like to know other opinions!
Re: Include option for specific package [message #22179 is a reply to message #22178] Tue, 23 June 2009 11:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
Ehm, the only thing to understand is that if you active "Add to include path" for file, then the file can be found using include path. Is that so hard?
Re: Include option for specific package [message #22181 is a reply to message #22179] Tue, 23 June 2009 12:15 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3398
Registered: August 2008
Senior Veteran
Hello luzr

Sorry, I do not understand Crying or Very Sad

For example in case xlslib:

- We have these files to compile

	lib\src\xlslib\blank.cpp,
	lib\src\xlslib\cbridge.cpp,
	lib\src\xlslib\cell.cpp,
        ... total 30 files ...

- These files have includes located in here:

	lib/src/common,
	lib/src/data,
	lib/src/oledoc,
	lib/src/xlslib;

(you can see that all the paths are under package directory)

- And the compiler has to use these directories before the included in Setup/Build Methods

How would it have to be done with the new "Add to include path" option ?

Best regards
Koldo


Best regards
Iñaki
Re: Include option for specific package [message #22182 is a reply to message #22181] Tue, 23 June 2009 12:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
Add any include file you want to include, or take .cpp file in the same dir (in many cases, you will want to have it in package anyway), use "Add to include path" for this include.

[Updated on: Tue, 23 June 2009 12:32]

Report message to a moderator

Re: Include option for specific package [message #22184 is a reply to message #22182] Tue, 23 June 2009 13:18 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

luzr wrote on Tue, 23 June 2009 13:30

Add any include file you want to include, or take .cpp file in the same dir (in many cases, you will want to have it in package anyway), use "Add to include path" for this include.



I thing that this realization is not transparent, especially for new u++ developers.

Is more simple to add maximum 4 directories of include path that find in tens or hundreds source (*.cpp, *h) files if exist "include path by package".

Maybe we need to vote what is good and what is bad between our realizations. If is any new proposes, it is very good.

[Updated on: Tue, 23 June 2009 13:19]

Report message to a moderator

Re: Include option for specific package [message #22185 is a reply to message #21906] Tue, 23 June 2009 14:36 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
tojocky wrote on Wed, 10 June 2009 10:39

Hello All,

I didn't find if exist a method for set include option for specific package.

I thing that it is a possibility to add "compiler option" in package organizer, but if exists more explicit method which i do not know, please tell me.


Hello, Ion.

I think, you can achieve this by using new Assembly. Just add necessary include directories to Package nest.
For example, we have MyApps assembly:
Package nest: C:\MyApps;C:\upp\uppsrc
Output directory: C:\upp\out
Assembly name: MyApps

In building process TheIDE will add directories from Package nest to include search path ("-I") before directories configured in Build methods for specific compiler. Example for MSC9:
"C:\Program Files\Microsoft Visual Studio 9.0\Vc\Bin\cl.exe" -nologo -W3 -GR -c \
-I"C:\MyApps" -I"C:\upp\uppsrc" \
-I"C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include" \
-I"C:\Program Files\Microsoft SDKs\Windows\v6.1\Include"

[Updated on: Tue, 23 June 2009 14:40]

Report message to a moderator

Re: Include option for specific package [message #22187 is a reply to message #22185] Tue, 23 June 2009 15:39 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Sender Ghost wrote on Tue, 23 June 2009 15:36


Hello, Ion.

I think, you can achieve this by using new Assembly. Just add necessary include directories to Package nest.
For example, we have MyApps assembly:
Package nest: C:\MyApps;C:\upp\uppsrc
Output directory: C:\upp\out
Assembly name: MyApps

In building process TheIDE will add directories from Package nest to include search path ("-I") before directories configured in Build methods for specific compiler. Example for MSC9:
"C:\Program Files\Microsoft Visual Studio 9.0\Vc\Bin\cl.exe" -nologo -W3 -GR -c \
-I"C:\MyApps" -I"C:\upp\uppsrc" \
-I"C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include" \
-I"C:\Program Files\Microsoft SDKs\Windows\v6.1\Include"



The goal is to optimize include option!

I have MyApp directory, that contains more packages.
Only few packages use specific include (actual is only xlslib).
Re: Include option for specific package [message #22190 is a reply to message #21986] Tue, 23 June 2009 16:30 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3398
Registered: August 2008
Senior Veteran
Hello Mirek

I have tried to compile xlslib with the available options but I do not know how.

This library has a tree of 42 include files called between them and from 32 .cpp files, that I am not able to compile in a simple portable way.

I think that the Ion proposal included below is the simpler from an user point of view using, as Ion does, relative paths like "lib/src/common".

However I have total confidence in your final decision that I will accept without further discussion.

Best regards
Koldo

tojocky wrote on Sun, 14 June 2009 09:08

I have not possibility to add in a message to files for show an screenshot example:
index.php?t=getfile&id=1784&private=0

Here I tested xlslib example added by Koldo in U++.



Best regards
Iñaki
Re: Include option for specific package [message #22191 is a reply to message #22190] Tue, 23 June 2009 17:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
Well, I am sorry to be stubborn, I am just STRONGLY opposed to the idea that package should have any explicit include paths.

Mirek
Re: Include option for specific package [message #22192 is a reply to message #22184] Tue, 23 June 2009 17:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
tojocky wrote on Tue, 23 June 2009 07:18

luzr wrote on Tue, 23 June 2009 13:30

Add any include file you want to include, or take .cpp file in the same dir (in many cases, you will want to have it in package anyway), use "Add to include path" for this include.



I thing that this realization is not transparent, especially for new u++ developers.

Is more simple to add maximum 4 directories of include path that find in tens or hundreds source (*.cpp, *h) files if exist "include path by package".



That one is simple. It is reflected in file's icon...

Mirek
Re: Include option for specific package [message #22193 is a reply to message #22187] Tue, 23 June 2009 17:25 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
In my current opinion, you just want to use unsuitable tool.
Packages are independent from absolute paths, therefore they are portable.
If you saw U++ code organization you can understand how your code must be organized to accomplish U++ modules approach.
Assembly "knows" about absolute paths and where to find Packages (which is disguised form of include search path directories for compiler). So, changes for paths should be on Assembly level.
I suggest you to use new Assembly, e.g. XlsLibApps with following options:
Package nest: C:\XlsLibApps;C:\XlsLibApps\lib\src\oledoc; \
C:\XlsLibApps\lib\src\xlslib;C:\XlsLibApps\lib\src\common; \
C:\XlsLibApps\lib\src\data;C:\MyApps;C:\upp\uppsrc
Output directory: C:\upp\out
Assembly name: XlsLibApps


to Mirek:
You can improve selection of Package nest directories or just add new option (e.g. ArrayCtrl) for include search paths.

Edit:
Anyway, we all have suitable solutions for this problem. I just want to show another point of view.

[Updated on: Tue, 23 June 2009 17:49]

Report message to a moderator

Re: Include option for specific package [message #22194 is a reply to message #22193] Tue, 23 June 2009 20:06 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
Sender Ghost wrote on Tue, 23 June 2009 11:25

In my current opinion, you just want to use unsuitable tool.
Packages are independent from absolute paths, therefore they are portable.
If you saw U++ code organization you can understand how your code must be organized to accomplish U++ modules approach.
Assembly "knows" about absolute paths and where to find Packages (which is disguised form of include search path directories for compiler). So, changes for paths should be on Assembly level.
I suggest you to use new Assembly, e.g. XlsLibApps with following options:
Package nest: C:\XlsLibApps;C:\XlsLibApps\lib\src\oledoc; \
C:\XlsLibApps\lib\src\xlslib;C:\XlsLibApps\lib\src\common; \
C:\XlsLibApps\lib\src\data;C:\MyApps;C:\upp\uppsrc
Output directory: C:\upp\out
Assembly name: XlsLibApps


to Mirek:
You can improve selection of Package nest directories or just add new option (e.g. ArrayCtrl) for include search paths.



Actually, the intended place for include path is build method...

Anyway, the problem we are trying to solve here is that when adapting existing code as U++ package (in this case, existing library capable of parsing XLS files), you have to solve the issue that sources can have its own directory structure, including special folders for .h.

Up to now, we usually fixed the issue by editing sources (#include <foo/bar.h> -> #include "bar.h"). Anyway, I have to agree that it can get long in teeth over time.

That is why I agree there is some problem to solve. But based on experience with "Add any file" to package, I would like to stay clean of any form hinting to the idea that the package is the place to define include path...

Mirek
Re: Include option for specific package [message #22197 is a reply to message #22191] Tue, 23 June 2009 21:15 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

luzr wrote on Tue, 23 June 2009 18:09

Well, I am sorry to be stubborn, I am just STRONGLY opposed to the idea that package should have any explicit include paths.

Mirek


By "explicit include paths" you mean full path?
If Yes, I can add possibility to restrict to set full path for the include package include option.
Re: Include option for specific package [message #22198 is a reply to message #22197] Tue, 23 June 2009 23:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
tojocky wrote on Tue, 23 June 2009 15:15

luzr wrote on Tue, 23 June 2009 18:09

Well, I am sorry to be stubborn, I am just STRONGLY opposed to the idea that package should have any explicit include paths.

Mirek


By "explicit include paths" you mean full path?



Any path Smile But package based path is more tolerable... Smile

Mirek
Re: Include option for specific package [message #22199 is a reply to message #22198] Wed, 24 June 2009 00:40 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3398
Registered: August 2008
Senior Veteran
I think there have been misunderstandings Smile

luzr wrote on Tue, 23 June 2009 23:26

tojocky wrote on Tue, 23 June 2009 15:15

luzr wrote on Tue, 23 June 2009 18:09

Well, I am sorry to be stubborn, I am just STRONGLY opposed to the idea that package should have any explicit include paths.

Mirek


By "explicit include paths" you mean full path?



Any path Smile But package based path is more tolerable... Smile

Mirek


Have I heard that before ? Twisted Evil

Quote:

I think that the Ion proposal included below is the simpler from an user point of view using, as Ion does, relative paths like "lib/src/common".



... relative paths under package directory.

The thing I did not want to do was precisely this:

Quote:

Up to now, we usually fixed the issue by editing sources (#include <foo/bar.h> -> #include "bar.h").



... as I prefer not to modify library sources, but for "force majeure".

I think Ion and me agree from the beginning that for a wrapper, the library sources tree begins from package folder.

We only want to say the compiler how to look for #includes there.

Best regards
Koldo


Best regards
Iñaki
Previous Topic: Abstract Draw
Next Topic: CeGCC
Goto Forum:
  


Current Time: Sun Nov 10 21:05:24 CET 2024

Total time taken to generate the page: 0.02230 seconds