User forums > Using Code::Blocks
Any easy way to add many search directory locations?
nebulism:
Hello again everyone,
I decided to scrap developing my own makefile and I am just sticking with C::B's automatic one.
I am getting the build options -> search directories -> compiler -> add (directory location for header) to work. My question is, there are many directories (over 40) that I would need to add to get my program to compile. Is there any quick way of adding many directories?
For instance, say I have header 1-40.hh. They lie in this structure: somerootfolder->folder1, folder2, folder3, etc. This is how Geant4 structures all of its classes/headers.
Thank you as always,
JP
ollydbg:
I don't think there is a fast way to add so many paths of include files. You can just add one by one manually.
dmoore:
my ShellExtensions plugin has a file browser that lets you multi-select files, right click and add them all to the currently active project. follow the link to the project page in my sig.
muonics:
Hi - I love that your shellextensions plugin allows for multiple file selection, however I don't think it is the answer to the original posters issue which is to have folders automatically added to the Search Directories under Build Options... when you add files to your project.
Otherwise you have only added the files, but codeblocks complains that it can't find the file because it doesn't know to look in the folder that the file was added from.
ie:
if you have a file structure like
myCodeblocksProject.cbp
src/
main.cpp
folderA/
headerA.h
folderB/
headerB.h
To add headerA.h in src/folderA/ to your project you have to first add the file with add files.... then you have to go to Build Options.... and add src/folderA/ to the Search Directories... panel.
It would save soooo much time if when you do add files....... and select headerA.h there was an option to automatically add src/folderA/ to the project Search Directories. Otherwise for projects with large amounts of source code it can sometimes take 30mins to an hour to manually add all the Search Directories. It seems like it would make sense to have the Add files recursively... option be able to add the relevant Search Directories as well.
ps: I don't expect your ShellExtensions plugin to do this (though it would be awesome) but this is sort of hoping that it is added to the IDE itself (along with multiple file selection).
dmoore:
this is quite an old post you are revisiting. you are right that I misread the OP.
you can also achieve what you need with a script that simply echoes the needed files to stdout. then use a backtick to call the script which will substitue the output of the script into the compiler command line.
This is how many of the code::blocks templates work on linux: e.g. for gtk add something like `pkg-config gtk+ --cflags` to the compiler options
Navigation
[0] Message Index
[#] Next page
Go to full version