From 6e02cbd8e33fdd5cc384d7b900ab22de134c5a9d Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 3 Mar 2006 15:29:44 +0000 Subject: [PATCH] Fixed this test so that it can work in the srcdirtree environment. --- test_problems/diamondSurf/Makefile.in | 12 ++++++++++++ test_problems/diamondSurf/runDiamond.cpp | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/test_problems/diamondSurf/Makefile.in b/test_problems/diamondSurf/Makefile.in index eaf0990c8..776c48c21 100644 --- a/test_problems/diamondSurf/Makefile.in +++ b/test_problems/diamondSurf/Makefile.in @@ -17,6 +17,10 @@ PROG_NAME = runDiamond # and from C/C++ separately OBJS = runDiamond.o +# Location of the current build. Will assume that tests are run +# in the source directory tree location +src_dir_tree = 1 + # additional flags to be passed to the linker. If your program # requires other external libraries, put them here LINK_OPTIONS = @EXTRA_LINK@ @@ -33,7 +37,11 @@ FORT_LIBS = @FLIBS@ CXX = @CXX@ # C++ compile flags +ifeq ($(src_dir_tree), 1) +CXX_FLAGS = -DSRCDIRTREE @CXXFLAGS@ +else CXX_FLAGS = @CXXFLAGS@ +endif # Ending C++ linking libraries LCXX_END_LIBS = @LCXX_END_LIBS@ @@ -45,7 +53,11 @@ CANTERA_LIBDIR=@buildlib@ CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx # the directory where Cantera include files may be found. +ifeq ($(src_dir_tree), 1) +CANTERA_INCDIR=../../Cantera/src +else CANTERA_INCDIR=@ctroot@/build/include/cantera +endif # flags passed to the C++ compiler/linker for the linking step LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ diff --git a/test_problems/diamondSurf/runDiamond.cpp b/test_problems/diamondSurf/runDiamond.cpp index 70b71d2e3..294959dfc 100644 --- a/test_problems/diamondSurf/runDiamond.cpp +++ b/test_problems/diamondSurf/runDiamond.cpp @@ -31,6 +31,14 @@ static void printUsage() } +#ifdef SRCDIRTREE +#include "ct_defs.h" +#include "ctml.h" +#include "GasKinetics.h" +#include "importCTML.h" +#include "ThermoPhase.h" +#include "InterfaceKinetics.h" +#else #include "Cantera.h" #include "kernel/ct_defs.h" #include "kernel/ctml.h" @@ -38,6 +46,7 @@ static void printUsage() #include "kernel/importCTML.h" #include "kernel/ThermoPhase.h" #include "kernel/InterfaceKinetics.h" +#endif using namespace Cantera;