forked from srobo/libkoki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
39 lines (26 loc) · 1.09 KB
/
SConstruct
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
import os
# Install prefix:
DESTDIR = os.getenv( "DESTDIR", default = "" )
# things that the install target should install
install = []
def dest( fname ):
"Prefix the given filename with DESTDIR"
return "{0}{1}".format( os.getenv( "DESTDIR", default = "" ),
fname )
env = Environment( CPPPATH = "#include",
CCFLAGS = "-O3 -g -std=gnu99 -Werror",
tools = [ "default", "doxygen" ],
toolpath = "." )
env.ParseConfig( "pkg-config --cflags --libs opencv glib-2.0 yaml-0.1" )
# An environment that links against libkoki
lk_env = env.Clone()
lk_env.Append( LIBS = "koki", LIBPATH = "#lib" )
# Our pkg-config stuff
pkg_builder = Builder( action = "./create-pkg-config $SOURCE $TARGET".format( dest("") ) )
env.Append( BUILDERS = { "PkgConfig": pkg_builder } )
pkg = env.PkgConfig( "libkoki.pc", "libkoki.pc.in" )
install += [ env.Install( dir = dest( "/usr/lib/pkgconfig" ),
source = pkg ) ]
Export("env lk_env dest install")
SConscript( Glob( "*/SConscript" ) )
env.Alias( "install", install )