Splitting up a large project into subfolders?
Sascha Cunz
scunz at ng-projekt.de
Fri Jun 11 00:57:04 UTC 2004
On Thursday 10 June 2004 16:13, Simon Ejsing wrote:
> Hi, I have a C++ project I'm working on, and by now it's becomming more
> and more complex, so I want to split it into folders, but I can't figure
> out how to do that with the automake manager... It seems automake is
> blocking me from having files in seperate directories for the same target.
>
> What I want to do is to have eg. "texture.h", "texture.cpp" and possibly
> more files in a sub directory named "texture", these files should be
> compiled and linked against the rest of the project as if they were a part
> of that target. Is there any way to do this? If I try to create the files
> with the wizard, it will put the files into a subproject, and if I add them
> as existing files, it wants to symlink the files, which is not what I want.
>
> I suppose the right way is to create a subproject for the files, but how
> can I generate regular .o files and link them into the main project?
Hi Simon,
like Steven I can feel your pain here.
Well, it is common to archive the same by creating subdirectories containing
staticly or dynamically linked libraries. ( See what Andras Mantia suggested
here )
However, I have heard of people using "subdir/file1.cpp subdir/file2.cpp" in
Makefile.am. And they are telling that it works. KDevelop has no way of
creating such a Makefile.am with the user interface.
Actually, i never tried whether kdevelop can handle "subdir/file1.cpp" entries
in Makefile.am correctly. I would not know anything off my head which would
make kdevelop deny working with such a Makefile.am (once it exists).
As i think, this solution is pretty much what you're looking for, i'd suggest
to try moving the texture.cpp and texture.h files into a sub directory called
texture and then modifiy the Makefile.am manually with a text editor. I
_think_ you have to change "texture.cpp" to "texture/texture.cpp" (same
for .h file). Then open the project in kdevelop (Automake manager can get
confused, if you change Makefile.am while project is open).
As i've never really tried to do that, this is more like a "call for problems"
than a final solution. I'm pretty sure that KDevelop will have trouble with
files from subdirs being in a Makefile.am. So i'd appreciate any feedback on
what's to be done in kdevelop to work under the above conditions.
Cheers Sascha
More information about the KDevelop-devel
mailing list