Build system (was Re: Future of KDE Development)
Guillaume Laurent
glaurent at telegraph-road.org
Mon Feb 14 20:02:19 GMT 2005
On Monday 14 February 2005 19:30, Anders Lund wrote:
> On Monday 14 February 2005 17:02, Guillaume Laurent wrote:
> > The current build system is *way* scarier IMHO :-)
>
> Then, when writing a KDE application or plugin or library, you can do with
> a *very* small and simple Makefile.am. Whatever choice we make for a
> replacement, we should be sure that we can achieve the same ease.
See for yourself :-). This is a sample SConscript file from the bksys package,
building a small KDE app with a DCOP interface and a client.
--
Guillaume.
http://www.telegraph-road.org
-------------- next part --------------
## This script demonstrates to build and install
## a kde program having a dcop interface and a client
## for it with scons
##
## Thomas Nagy, 2004
## This file can be reused freely for any project (see COPYING)
############################
## load the config
## use the environment set in the top-level
## SConstruct file
Import( "env" )
myenv=env.Copy()
#############################
## the programs to build
test2_sources = [
'main.cpp',
'test2.cpp',
'test2view.cpp',
'pref.cpp',
'test2iface_skel.cpp' # use this to indicate the .h file to process
]
test2_client_sources = [
'test2_client.cpp'
]
# main program
## By default, the header (.h) files corresponding to source (.cpp) files
## are scanned to find the moc and dcop interfaces to process
## If a header is unreachable (the correponding implementation is
## to be generated), you will have to tell scons explicitely like in
## the following example :
myenv.Dcop( ['test2iface.h'] )
myenv.Program( target = "test2", source = test2_sources )
# client
myenv.Program( target = "test2_client", source = test2_client_sources )
############################
## customization
## additional paths for compiling the source files
myenv.Append(CPPPATH = ['./', '../'])
## necessary libraries
myenv['LIBS'].append('kio')
myenv['LIBS'].append('kdecore')
myenv['LIBS'].append('kdeprint')
## this shows how to add other link flags
#myenv['LINKFLAGS'].append('-export-dynamic')
#############################
## the install targets
if env['INSTALL_ALL'] == 1:
## the main program
env['INST_TARGETS'].append( env.Install( env['KDEBIN'], 'test2' ) )
## the dcop client
env['INST_TARGETS'].append( env.Install( env['KDEBIN'], 'test2_client' ) )
## the rc file
env['INST_TARGETS'].append( env.Install( env['KDEDATA']+'/test2', 'test2ui.rc' ) )
## the desktop file
env['INST_TARGETS'].append( env.Install( env['KDEMENU']+'/Utilities', 'test2.desktop' ) )
More information about the kde-core-devel
mailing list