diff options
-rw-r--r-- | SConstruct | 18 | ||||
-rw-r--r-- | doc/SConscript | 4 | ||||
-rw-r--r-- | src/SConscript | 2 |
3 files changed, 22 insertions, 2 deletions
@@ -1,4 +1,20 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -SConscript('src/SConscript', variant_dir='build', duplicate=0) +def build_lib(): + SConscript('src/SConscript', variant_dir='build', duplicate=0) + +def build_doc(): + SConscript('doc/SConscript') + +if not BUILD_TARGETS: + # Default target: lib + build_lib() +else: + if 'lib' in BUILD_TARGETS: + build_lib() + if 'doc' in BUILD_TARGETS: + # Note: building the doc requires the lib to be built and the pyexiv2 + # module to be in the python path. + build_doc() + diff --git a/doc/SConscript b/doc/SConscript index aac5b70..3ecab1d 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -25,4 +25,6 @@ def build_doc(target, source, env): return sphinx.statuscode env = Environment() -env.Command(output, sources, build_doc) +doc = env.Command(output, sources, build_doc) +env.Alias('doc', doc) + diff --git a/src/SConscript b/src/SConscript index bada7dc..0df0dde 100644 --- a/src/SConscript +++ b/src/SConscript @@ -27,6 +27,7 @@ env.Append(LIBS=libs) # Build shared library libpyexiv2 cpp_sources = ['exiv2wrapper.cpp', 'exiv2wrapper_python.cpp'] libpyexiv2 = env.SharedLibrary('exiv2python', cpp_sources) +env.Alias('lib', libpyexiv2) # Install the shared library and the Python modules, invoked using # 'scons install'. If DESTDIR is specified on the command line when invoking @@ -41,3 +42,4 @@ else: env.Install(install_dir, [libpyexiv2]) env.Install(os.path.join(install_dir, 'pyexiv2'), glob('pyexiv2/*.py')) env.Alias('install', install_dir) + |