Author Topic: Recursive Include Directories  (Read 15159 times)

Offline Wavesonics

  • Multiple posting newcomer
  • *
  • Posts: 43
Recursive Include Directories
« on: December 14, 2006, 02:17:48 am »
I have a project with a rather deep directory structure, and I want to be able to be able to set the top directory as an include directory for the compiler and have it be recursive, so all the sub directories are checked for header includes as well.

Is there any way of doing this?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Recursive Include Directories
« Reply #1 on: December 14, 2006, 02:22:32 am »
This is a compiler question, no one can answer your question without knowing the compiler.
I don't know of any compiler that does what you want be I don't know very many compilers.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Wavesonics

  • Multiple posting newcomer
  • *
  • Posts: 43
Re: Recursive Include Directories
« Reply #2 on: December 14, 2006, 02:26:28 am »
Yes i know it's a compiler issue, I'm using gcc, g++ specifically. But I was woundering if maybe Code Blocks had a nice little feature to be intelegent and add all the sub directories as paths as well.

Maybe I should put this in feature request...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Recursive Include Directories
« Reply #3 on: December 14, 2006, 06:51:44 am »
Look at "settings" -> "Compiler and Debugger"
Under tab "Other"
Has options to add file being compiled directory and top level directory options.
It is NOT want you asked for but it all that I know that codeblocks does.

Note: You do know about "project" -> "Build options" "directories" -> "compiler" Tab this is the normal place to add include search directories. If you do NOT know about that please try it first.

Note: You can add each directory one at a time manually. I think compiler other options not sure on that.
I was thinking to add these folders "..", "../..", "../../.." that may solve your problem, note I would never do it because I like knowing exactly what folders are being searched.

Tim S
« Last Edit: December 14, 2006, 07:02:04 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Recursive Include Directories
« Reply #4 on: December 14, 2006, 08:40:37 am »
if maybe Code Blocks had a nice little feature to be intelegent and add all the sub directories as paths as well.
This wouldn't be intelligent at all. Imagine you have a header that appears twice - doing such "magic" you are proposing here would be very error prone.
The best and cleanest way is to really think about what folders you need to include and include them manually. The good thing about that: You do need to do it once only. And if you start a new project - just do it as this from the very beginning and you won't come in such a situation ever.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Recursive Include Directories
« Reply #5 on: December 14, 2006, 05:30:54 pm »
Explicit include paths also make the code much easier to follow for someone who has never seen it before.