2007-06-30 04:41:52 +02:00
|
|
|
# -*- python -*-
|
|
|
|
|
##
|
2011-12-03 01:56:30 +01:00
|
|
|
## SConstruct - SCons based build-system for Lumiera
|
2007-06-30 04:41:52 +02:00
|
|
|
##
|
|
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
# Copyright (C) Lumiera.org
|
|
|
|
|
# 2008, Hermann Vosseler <Ichthyostega@web.de>
|
2007-06-30 04:41:52 +02:00
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
2007-07-18 19:02:13 +02:00
|
|
|
# published by the Free Software Foundation; either version 2 of
|
2007-06-30 04:41:52 +02:00
|
|
|
# the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
|
|
|
2011-01-30 22:12:55 +01:00
|
|
|
# NOTE: scons -h for help.
|
|
|
|
|
# Read more about the SCons build system at: http://www.scons.org
|
|
|
|
|
# Basically, this script just /defines/ the components and how they
|
|
|
|
|
# fit together. SCons will derive the necessary build steps.
|
|
|
|
|
|
|
|
|
|
|
2007-07-02 05:27:20 +02:00
|
|
|
#-----------------------------------Configuration
|
2011-01-30 22:12:55 +01:00
|
|
|
TOOLDIR = './admin/scons' # SCons plugins
|
2011-01-30 15:27:21 +01:00
|
|
|
SCRIPTDIR = './admin'
|
2007-07-02 05:27:20 +02:00
|
|
|
#-----------------------------------Configuration
|
2011-12-03 01:56:30 +01:00
|
|
|
|
2007-06-30 04:41:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-21 09:59:24 +02:00
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
sys.path.append(TOOLDIR)
|
2010-01-15 03:27:09 +01:00
|
|
|
sys.path.append(SCRIPTDIR)
|
2008-08-21 09:59:24 +02:00
|
|
|
|
|
|
|
|
from Buildhelper import *
|
|
|
|
|
from LumieraEnvironment import *
|
|
|
|
|
|
2007-06-30 04:41:52 +02:00
|
|
|
|
2012-01-09 04:10:00 +01:00
|
|
|
import Setup
|
|
|
|
|
import Options
|
|
|
|
|
import Platform
|
|
|
|
|
|
2007-07-02 11:38:46 +02:00
|
|
|
|
2012-01-09 04:58:21 +01:00
|
|
|
#####################################################################
|
2007-06-30 04:41:52 +02:00
|
|
|
|
|
|
|
|
|
2012-01-09 02:56:29 +01:00
|
|
|
def defineBuildTargets(env):
|
2007-07-18 19:02:13 +02:00
|
|
|
""" define the source file/dirs comprising each artifact to be built.
|
2007-07-03 00:13:12 +02:00
|
|
|
setup sub-environments with special build options if necessary.
|
|
|
|
|
We use a custom function to declare a whole tree of srcfiles.
|
2007-07-18 19:02:13 +02:00
|
|
|
"""
|
2008-12-14 04:35:36 +01:00
|
|
|
|
2012-01-09 02:27:59 +01:00
|
|
|
# define Icons to render and install
|
|
|
|
|
vector_icon_dir = env.subst(env.path.srcIcon+'svg')
|
|
|
|
|
prerendered_icon_dir = env.subst(env.path.srcIcon+'prerendered')
|
2012-01-09 02:56:29 +01:00
|
|
|
icons = ( [env.IconRender(f) for f in scanSubtree(vector_icon_dir, ['*.svg'])]
|
|
|
|
|
+ [env.IconResource(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
|
|
|
|
|
)
|
2012-01-09 02:27:59 +01:00
|
|
|
|
|
|
|
|
#define Configuration files to install
|
2012-01-09 02:56:29 +01:00
|
|
|
config = ( env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
|
|
|
|
|
+ env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
|
|
|
|
|
)
|
2012-01-09 02:27:59 +01:00
|
|
|
|
2007-07-03 00:13:12 +02:00
|
|
|
# call subdir SConscript(s) for independent components
|
2012-01-09 02:56:29 +01:00
|
|
|
SConscript(dirs=['src','src/tool','research','tests'], exports='env icons config')
|
2007-06-30 04:41:52 +02:00
|
|
|
|
|
|
|
|
|
2007-08-24 16:41:16 +02:00
|
|
|
|
2012-01-09 02:56:29 +01:00
|
|
|
def definePostBuildTargets(env):
|
2011-12-03 06:10:12 +01:00
|
|
|
""" define further actions after the core build (e.g. Documentation).
|
2007-06-30 04:41:52 +02:00
|
|
|
define alias targets to trigger the installing.
|
2007-07-18 19:02:13 +02:00
|
|
|
"""
|
2012-01-09 02:56:29 +01:00
|
|
|
Import('lumiera plugins tools gui testsuite')
|
|
|
|
|
build = env.Alias('build', lumiera + plugins + tools +gui)
|
|
|
|
|
|
2007-07-02 05:27:20 +02:00
|
|
|
# additional files to be cleaned when cleaning 'build'
|
2008-01-27 03:58:24 +01:00
|
|
|
env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
|
2011-01-30 19:20:02 +01:00
|
|
|
env.Clean ('build', [ 'src/pre.gch' ])
|
2008-07-11 05:35:48 +02:00
|
|
|
|
2012-01-09 02:56:29 +01:00
|
|
|
doxydoc = env.Doxygen('doc/devel/Doxyfile')
|
2008-09-05 15:54:23 +02:00
|
|
|
env.Alias ('doc', doxydoc)
|
|
|
|
|
env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
|
2011-01-29 16:45:22 +01:00
|
|
|
|
2012-01-09 02:56:29 +01:00
|
|
|
env.Alias ('all', build + testsuite + doxydoc)
|
2011-01-30 22:12:55 +01:00
|
|
|
env.Default('build')
|
|
|
|
|
# SCons default target
|
2007-08-24 16:41:16 +02:00
|
|
|
|
|
|
|
|
|
2012-01-09 02:56:29 +01:00
|
|
|
def defineInstallTargets(env):
|
2011-01-30 18:56:51 +01:00
|
|
|
""" 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
|
2007-08-24 16:41:16 +02:00
|
|
|
"""
|
2012-01-09 02:56:29 +01:00
|
|
|
Import('lumiera plugins tools gui testsuite')
|
|
|
|
|
|
2011-01-30 19:20:02 +01:00
|
|
|
env.SymLink('$DESTDIR/bin/lumiera',env.path.installExe+'lumiera','../lib/lumiera/lumiera')
|
2012-01-09 02:56:29 +01:00
|
|
|
# env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=doxydoc)
|
2011-01-30 19:43:51 +01:00
|
|
|
|
2012-01-09 02:56:29 +01:00
|
|
|
env.Alias('install', gui)
|
2011-01-30 19:43:51 +01:00
|
|
|
env.Alias('install', '$DESTDIR')
|
2007-08-24 16:41:16 +02:00
|
|
|
|
2007-07-02 05:27:20 +02:00
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### === MAIN === ####################################################
|
|
|
|
|
|
2012-01-09 04:58:21 +01:00
|
|
|
env = Setup.setupBasicEnvironment()
|
2007-06-30 04:41:52 +02:00
|
|
|
|
2007-07-02 05:27:20 +02:00
|
|
|
if not (isCleanupOperation(env) or isHelpRequest()):
|
2012-01-09 04:58:21 +01:00
|
|
|
env = Platform.configurePlatform(env)
|
2007-07-02 05:27:20 +02:00
|
|
|
|
|
|
|
|
# the various things we build.
|
|
|
|
|
# Each entry actually is a SCons-Node list.
|
|
|
|
|
# Passing these entries to other builders defines dependencies.
|
2008-03-10 05:07:21 +01:00
|
|
|
# 'lumiera' : the App
|
2009-02-08 04:21:12 +01:00
|
|
|
# 'gui' : the GTK UI (plugin)
|
2007-07-02 05:27:20 +02:00
|
|
|
# 'plugins' : plugin shared lib
|
|
|
|
|
# 'tools' : small tool applications (e.g mpegtoc)
|
|
|
|
|
|
2012-01-09 02:56:29 +01:00
|
|
|
defineBuildTargets(env)
|
|
|
|
|
definePostBuildTargets(env)
|
|
|
|
|
defineInstallTargets(env)
|
2007-06-30 04:41:52 +02:00
|
|
|
|