[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: Splitting up a large project into subfolders?
From:       Andras Mantia <amantia () kde ! org>
Date:       2004-06-10 19:07:40
Message-ID: 20040610190334.AA544734B () smtp ! zappmobile ! ro
[Download RAW message or body]

Simon Ejsing wrote:

> 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?
> 
You must use static libaries. One library for each subdirectory. Example:
cppproject
    subdir1
       texture.h
       texture.cpp
    main.cpp

In the Makefile.am of subdir1 you put:
noinst_LTLIBRARIES = libsubdir1.la
libsubdir1_la_SOURCES = texture.h texture.cpp

In the Makefile.am of cppproject:
bin_PROGRAMS= your_app
your_app_SOURCES=main.cpp
your_app_LDADD = $(top_builddir)/subdir1/libsubdir1.la
AM_CPPFLAGS= -I$(top_srcdir)/subdir1

This is the minimum, so you can use texture.h in main.cpp by simply using 
#include "texture.h"
and the texture.o will be put in libsubdir1.a which will be linked with the
main.o to create your_app.

I don't know the steps how you can do this from KDevelop, but I'm pretty
sure it's possible. You just have to create a right target (the libraries)
and set the flags.

Of course, if you use system libraries and header files, you must add the
correct flags to the *_LDADD, AM_CPPFLAGS and *_LDFLAGS lines.
Get an existing KDE app and verify how it's done there.

IMHO this is an user question and it's far from being a bug. There are many
project in KDE that are using subdirectories and subprojects.

Andras


_______________________________________________
Kdevelop-devel mailing list
Kdevelop-devel@barney.cs.uni-potsdam.de
http://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic