SConstruct: reduce the remaining defs
no need to use functions anymore, since only the clean and phony targets are left
This commit is contained in:
parent
795217b542
commit
e64a17d1ba
2 changed files with 55 additions and 76 deletions
125
SConstruct
125
SConstruct
|
|
@ -53,85 +53,58 @@ import Platform
|
|||
|
||||
#####################################################################
|
||||
|
||||
|
||||
def defineBuildTargets(env):
|
||||
""" define the source file/dirs comprising each artifact to be built.
|
||||
setup sub-environments with special build options if necessary.
|
||||
We use a custom function to declare a whole tree of srcfiles.
|
||||
"""
|
||||
|
||||
# define Icons to render and install
|
||||
vector_icon_dir = env.subst(env.path.srcIcon+'svg')
|
||||
prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
|
||||
icons = ( [env.IconRender(f) for f in scanSubtree(vector_icon_dir, ['*.svg'])]
|
||||
+ [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
|
||||
)
|
||||
|
||||
#define Configuration files to install
|
||||
config = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
|
||||
+ env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
|
||||
)
|
||||
|
||||
# call subdir SConscript(s) for independent components
|
||||
SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
|
||||
|
||||
|
||||
|
||||
def definePostBuildTargets(env):
|
||||
""" define further actions after the core build (e.g. Documentation).
|
||||
define alias targets to trigger the installing.
|
||||
"""
|
||||
Import('lumiera plugins tools gui testsuite')
|
||||
build = env.Alias('build', lumiera + plugins + tools +gui)
|
||||
|
||||
# additional files to be cleaned when cleaning 'build'
|
||||
env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
|
||||
env.Clean ('build', [ 'src/pre.gch' ])
|
||||
|
||||
doxydoc = env.Doxygen('doc/devel/Doxyfile')
|
||||
env.Alias ('doc', doxydoc)
|
||||
env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
|
||||
|
||||
env.Alias ('all', build + testsuite + doxydoc)
|
||||
env.Default('build')
|
||||
# SCons default target
|
||||
|
||||
|
||||
def defineInstallTargets(env):
|
||||
""" define additional artifacts to be installed into target locations.
|
||||
@note: we use customised SCons builders defining install targets
|
||||
for all executables automatically. see LumieraEnvironment.py
|
||||
"""
|
||||
Import('lumiera plugins tools gui testsuite')
|
||||
|
||||
env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
|
||||
# env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
|
||||
|
||||
env.Alias('install', gui)
|
||||
env.Alias('install', '$DESTDIR')
|
||||
|
||||
#####################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### === MAIN === ####################################################
|
||||
|
||||
env = Setup.setupBasicEnvironment()
|
||||
|
||||
if not (isCleanupOperation(env) or isHelpRequest()):
|
||||
env = Platform.configurePlatform(env)
|
||||
|
||||
# the various things we build.
|
||||
# Each entry actually is a SCons-Node list.
|
||||
# Passing these entries to other builders defines dependencies.
|
||||
# 'lumiera' : the App
|
||||
# 'gui' : the GTK UI (plugin)
|
||||
# 'plugins' : plugin shared lib
|
||||
# 'tools' : small tool applications (e.g mpegtoc)
|
||||
|
||||
defineBuildTargets(env)
|
||||
definePostBuildTargets(env)
|
||||
defineInstallTargets(env)
|
||||
|
||||
#####################################################################
|
||||
|
||||
# define Icons to render and install
|
||||
vector_icon_dir = env.subst(env.path.srcIcon+'svg')
|
||||
prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
|
||||
icons = ( [env.IconRender(f) for f in scanSubtree(vector_icon_dir, ['*.svg'])]
|
||||
+ [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
|
||||
)
|
||||
|
||||
#define Configuration files to install
|
||||
config = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
|
||||
+ env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
|
||||
)
|
||||
|
||||
doxydoc = env.Doxygen('doc/devel/Doxyfile')
|
||||
env.Alias ('doc', doxydoc)
|
||||
env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
|
||||
# env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
|
||||
|
||||
|
||||
|
||||
### === MAIN BUILD === ##############################################
|
||||
|
||||
# call subdir SConscript(s) for to define the actual build targets
|
||||
SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
|
||||
|
||||
# artifacts defined by the build targets
|
||||
Import('lumiera plugins tools gui testsuite')
|
||||
|
||||
|
||||
|
||||
# additional files to be cleaned when cleaning 'build'
|
||||
env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
|
||||
env.Clean ('build', [ 'src/pre.gch' ])
|
||||
|
||||
|
||||
|
||||
### === Alias Targets === ###########################################
|
||||
|
||||
build = env.Alias('build', lumiera + plugins + tools +gui)
|
||||
|
||||
env.Alias ('all', build + testsuite + doxydoc)
|
||||
env.Default('build')
|
||||
# SCons default target
|
||||
|
||||
env.Alias('install', gui)
|
||||
env.Alias('install', '$DESTDIR')
|
||||
|
||||
#####################################################################
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from Buildhelper import scanSubtree
|
|||
|
||||
Import('env icons config')
|
||||
|
||||
# define the source file/dirs comprising each artifact to be built.
|
||||
|
||||
lLib = env.SharedLibrary('lumiera', srcSubtree('lib'), install=True)
|
||||
lApp = env.SharedLibrary('lumieracommon', srcSubtree('common'), install=True, LIBS=lLib)
|
||||
|
|
@ -23,6 +24,11 @@ lumiera = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
|
|||
+ config
|
||||
)
|
||||
|
||||
# Install the lumiera application:
|
||||
# symlink the executable into the bin dir
|
||||
env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
|
||||
|
||||
|
||||
# building Lumiera Plugins
|
||||
plugins = [] # currently none
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue