From 287de5e1fb46016380172174f130a6eebd97e796 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Tue, 5 Feb 2013 00:32:05 +0000 Subject: [PATCH] Added gtest to Cantera's application environment. --- SConstruct | 1 + ext/SConscript | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index dc22b7483..52293483f 100644 --- a/SConstruct +++ b/SConstruct @@ -952,6 +952,7 @@ elif env['layout'] == 'debian': else: env['PYTHON_INSTALLER'] = 'direct' + addInstallActions = ('install' in COMMAND_LINE_TARGETS or 'uninstall' in COMMAND_LINE_TARGETS) diff --git a/ext/SConscript b/ext/SConscript index 554ba369e..b4b4beea5 100644 --- a/ext/SConscript +++ b/ext/SConscript @@ -151,11 +151,32 @@ for subdir, extensions, prepFunction in libs: # Build the shared library liby = build(localenv.SharedLibrary(pjoin('..', 'lib', sharedLibName), objects)) install('$inst_libdir', liby) - - +# --------------------------------------------------- +# GTEST +# --------------------------------------------------- +# OK, handle the construction of the gtest library. Gtest applications require the construction of +# a library object that will get linked in at link time and a set of include files that will available +# at compile time. +# +# Create a local environment for creating the libgtest.a static library +# -> we need to the gtest include files +# -> I don't know about pthreads within gtest. localenv = env.Clone() localenv.Prepend(CPPPATH=[Dir('#ext/gtest'), Dir('#ext/gtest/include')], - CPPDEFINES={'GTEST_HAS_PTHREAD': 0}) -build(localenv.Library(pjoin('../lib', 'gtest'), - source=['gtest/src/gtest-all.cc'])) + CPPDEFINES={'GTEST_HAS_PTHREAD': 0}) +# +# Create a build object for libgtest.a and a source file, gtest-all.cc that includes all of the gtest sources +# +llib = build(localenv.Library(pjoin('../lib', 'gtest'), + source=['gtest/src/gtest-all.cc'])) +# +# Add libgtest.a to the install directions +# +install('$inst_libdir', llib) +# +# Add all of the gtest include files to the install directions +# +install(localenv.RecursiveInstall, '$inst_incroot', '#/ext/gtest/include') +# --------------------------------------------------- +