Options read from home or config directories; documentation built by default
authorDmitriy Morozov <morozov@cs.duke.edu>
Fri, 12 Jan 2007 12:49:29 -0500
changeset 12 0239c3f0a598
parent 11 a0736dd3c671
child 13 b1535347e37d
Options read from home or config directories; documentation built by default
SConstruct
--- a/SConstruct	Mon Jan 01 11:45:28 2007 -0500
+++ b/SConstruct	Fri Jan 12 12:49:29 2007 -0500
@@ -1,8 +1,17 @@
 import os
 
-optns =					Options('config/' + os.uname()[1] + '.py')
-optns.AddOptions(
-						PathOption('cgal_path', 'where CGAL is installed', ''),
+# Get options
+options_filenames =		['config/' + os.uname()[1] + '.py', os.path.expanduser('~/.scons/config.py')]
+
+for fn in options_filenames:
+	if os.path.exists(fn):
+		optns =			Options(fn)
+		print "Found configuration:", fn
+		break
+else:
+		optns =			Options()
+
+optns.AddOptions		(PathOption('cgal_path', 'where CGAL is installed', ''),
 						('cgal_architecture', 'string describing CGAL architecture'),
 						('INCPATH', 'additional include paths separated with :',''),
 						('LIBPATH', 'additional library paths separated with :',''),
@@ -10,8 +19,6 @@
 						PathOption('qt4_libs', 'where Qt4 libraries are installed', ''),
 						('CXX', 'The C++ compiler'))
 
-
-
 # Setup environment
 base_env = 				Environment(options = optns,
 									ENV = os.environ,
@@ -64,8 +71,8 @@
 						 LIBPATH = libpath + cgal_lib_paths, 
 						 LINKFLAGS = cgal_link_flags)
 
-# Build documentation (in doc/)
-env.Doxygen("Doxyfile")
+# Build documentation (in docs/)
+Default(env.Doxygen("Doxyfile"))
 
 # Build stuff in src/, and export it
 external_sources = 		SConscript(['src/SConscript'], exports = ['env'])