summaryrefslogtreecommitdiffstats
path: root/src/SConscript
blob: 66e701dfe54ccf91781c354fbc9c2989c5646ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /usr/bin/env python
## This script demonstrates how to build and install
## a simple kde program having KconfigXT settings
## with scons
##
## Thomas Nagy, 2004, 2005

## This file can be reused freely for any project (see COPYING)

############################
## load the config

## Use the environment and the tools set in the top-level
## SConstruct file (set with 'Export') - this is very important

Import( 'env' )
myenv=env.Copy()

#############################
## the programs to build

# The sources for our program - only .ui, .skel and .cpp are accepted
abakus_sources = """
abakus.cpp
abakuslistview.cpp
dragsupport.cpp
editor.cpp
evaluator.cpp
function.cpp
lexer_lex.cpp
mainwindow.cpp
node.cpp
numerictypes.cpp
parser_yacc.cpp
result.cpp
resultlistview.cpp
resultlistviewtext.cpp
rpnmuncher.cpp
valuemanager.cpp
dcopIface.skel
"""

if myenv.get('mpfr', 'no') == 'yes':
    myenv.Append(LIBS = ['mpfr', 'gmp'])
else:
    abakus_sources = abakus_sources + " hmath.cpp number.c"

myenv.KDEprogram( "abakus", abakus_sources )
myenv.KDEicon( 'abakus' )

# Mark these as being created by flex and bison if it's installed.
if myenv.Dictionary().has_key('PARSER_INCLUDED'):
    myenv.CXXFile( "lexer_lex.cpp", "lexer.ll" )
    myenv.CXXFile( "parser_yacc.cpp", "parser.yy", YACCFLAGS="-d" )

if myenv['HAVE_ASNEEDED']:
    myenv.Append(LINKFLAGS = '-Wl,--as-needed')

myenv.Append(CXXFLAGS = '-Wno-non-virtual-dtor')

############################
## Customization

## Additional include paths for compiling the source files
## Always add '../' (top-level directory) because moc makes code that needs it
myenv.KDEaddpaths_includes('#/src/  #/')

## Necessary libraries to link against
myenv.KDEaddlibs( 'qt-mt kio kdecore kdeprint kdeui' )

#############################
## Data to install

## The ui.rc file and the tips go into datadir/appname/
myenv.KDEinstall( 'KDEDATA', 'abakus', 'abakusui.rc' )

## Warning : there is a difference between the normal destop file used for the menu
##     and the servicetype desktop file, so they go in different directories
##     you will find more information in 'test3'
myenv.KDEinstall( 'KDEMENU', 'Utilities', 'abakus.desktop')