How would you do this with an IDE ?
I am reading a book, the source code of its chapters come in a directory hierarchy as follows:
Build and makefile:
Opening a project for each chapter and specifying the extra include directories is too much manual work.(to get code completion for the extra classes provided)
Is there a way I can point at the root of the build directory and have an IDE (Eclipse, Kdevelop, QtCreator, a text editor.. anything) load the appropriate source files on demand (based on the makefiles, which also lists the extra includes)?
What? I don't get it.
If there are files included locally with every project, it should already contain references to those include directories, no?
If it's a global include directory, why don't you just configure a global path in your IDE?
Originally Posted by Adak
Originally Posted by Salem
They are global..(with some rather irregular exceptions, but those can be ignored for another 10 or so chapters).
Originally Posted by Elysia
Thank for the suggestion, I'm definitely going to do it.
I was looking for a more 'script'-ic solution, which parses the makefiles in the subdirs and automatically open a project for each, configuring the include and shared object paths from the makefiles.
Make a script that creates a qtcreator project file based on the Makefile for you
What platform are you working on?
Almost every popular file system (except the ones Windows uses) supports symbolic links.
So if you're lucky (i.e. not using Windows) you can go into a directory the IDE knows about and create symbolic links to each sample code directory. That way, they'll look like subdirectories from the IDE's directory.
If you have to use Windows, Microsoft has a junction tool that makes something very similar to a symbolic link, though it only works for directories.
Windows supports symbolic links and hard links to files.
Well, my sig says that I do not use Windows. (Lucky me... :P )
Originally Posted by KenJackson
The idea has merit...thank you. If I create soft links for the include folder (of the separate files) in /usr/include , that would make them accessible from many places without having to create messy makefiles.