Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: jmccay on November 15, 2005, 03:58:23 am

Title: Directory structure.
Post by: jmccay on November 15, 2005, 03:58:23 am
I was wondering what directory structures everyone else uses for libraries.  Do you seperate libraries & headers?  Do you keep the entire development directory structure?  Do you maintain a current directory with the library you use for everyday coding & a different directory for cvs updates & compiles.
jmccay
Title: Re: Directory structure.
Post by: takeshimiya on November 15, 2005, 04:13:06 am
Everybody uses different structures, and it also depends on the size and scope of the project.
Title: Re: Directory structure.
Post by: thomas on November 15, 2005, 08:45:16 am
It does not matter an awful lot, you can have a long and happy life either way. Everybody should do what he thinks is best. Personally, I keep headers, libraries, and all that makes up one "unit" together, and separate from the rest. Not only libraries and headers, but also the compiler and the IDE. I believe, this is "best".

This strategy allows me to use a global compiler variable for lib/include configuration and switch between different versions quickly and painlessly when necessary.
It also allows me to replace Code::Blocks with a fresh version without touching anything in MinGW and without worrying about any headers and libraries (and vice versa).

Title: Re: Directory structure.
Post by: jmccay on November 19, 2005, 02:01:37 am
Can you give some hard examples like a tree.  I don't like the way I have it set up now, so I am hoping to get ideas on how to do it better.  Especially using multiple version of the same library.

Joe
Title: Re: Directory structure.
Post by: thomas on November 19, 2005, 03:57:58 pm
It could look like this, for example:
Code
|
+--- 3rdParty
|       |
| +--- wxWindows-2.4.2
|       |      |
|       |      +--- lib
|       |      +--- ...
|       |
| +--- wxWidgets-2.6.1
| +--- wxWidgets-2.6.1
|
+--- MinGW
| |
| +--- bin
| +--- include
| +--- lib
| |
| ...
|
+--- CodeBlocks
| |
| +--- lib
| +--- include
| +--- codeblocks.exe
| |
| ...
|
...
That way, you have to set the respective path variables in your projects (can use global user variables if you use CVS), and everything is very configurable and flexible. If you update Code::Blocks or use a different MinGW version tomorrow, it does not matter. Everything will still work fine.
Title: Re: Directory structure.
Post by: jmccay on November 23, 2005, 03:11:22 am
Path Variables as in?  Sorry, for these simple qustions.  While I know C/C++ (and other languages) and have plenty of experience structure like this I didn't learn.  VC++, or the companies I worked for, hid that stuff pretty well.

jmccay
Title: Re: Directory structure.
Post by: thomas on November 23, 2005, 02:28:27 pm
Put the directories where your stuff is located in there:

(http://img358.imageshack.us/img358/7748/dirs2nw.png)

If you use HEAD, you can use global user variables for those locations too, this is a lot more comfortable.
Title: Re: Directory structure.
Post by: jmccay on November 25, 2005, 10:27:04 pm
HEAD, I am assuming you are refering to the unix command, prints the first amount of lines specified at the command line.  I know I can put the directories in there, but I must admit, I am missing the connection with the unix head command.  I was thinking about it, and can you put a custom variable under the custom variables tab and reference it in the directories list?  Like:

LIB_DIR=c:\libraries

and then in the directories tab:

$LIB_DIR$\wxWidgets_2.6.2

Can this be done?  Where does HEAD fit in?  Unless you're talking about a cvs command.  I don't know a lot about cvs.

  As for global user variables, are you talking about OS variables?  I guess I don't understand the use of HEAD you are refering too.
jmccay
Title: Re: Directory structure.
Post by: mandrav on November 25, 2005, 10:35:50 pm
HEAD is the most recent CVS version :)

Quote
I was thinking about it, and can you put a custom variable under the custom variables tab and reference it in the directories list?  Like:

LIB_DIR=c:\libraries

and then in the directories tab:

$LIB_DIR$\wxWidgets_2.6.2

Can this be done?

Yes, this is exactly the purpose of those variables :)

Quote
As for global user variables, are you talking about OS variables?

No, he was talking about the new feature called "global compiler variables" which can be found in HEAD (cvs!). It's *like* custom variables but they differ in two important ways:

1) they 're global (i.e. *not* project-specific)
2) if the project you 're opening contains unknown global variables, the user is prompted to define them.

For more info look into the wiki entry about global user variables (http://wiki.codeblocks.org/index.php/Global_user_variables).
Title: Re: Directory structure.
Post by: jmccay on November 28, 2005, 02:39:13 am
Cool.  I'll have to check it out.  Time to take a look at that build I downloaded with last major chance.
jmccay