diff --git a/test_problems/surfkin/Interface.h b/test_problems/surfkin/Interface.h index d2c653c79..43e8c2da1 100644 --- a/test_problems/surfkin/Interface.h +++ b/test_problems/surfkin/Interface.h @@ -1,11 +1,19 @@ -#ifndef CXX_INTERFACE -#define CXX_INTERFACE +/* + * $Id$ + */ +#ifndef CXX_INTERFACE_H +#define CXX_INTERFACE_H #include - +#ifdef SRCDIRTREE +#include "SurfPhase.h" +#include "InterfaceKinetics.h" +#include "importCTML.h" +#else #include "kernel/SurfPhase.h" #include "kernel/InterfaceKinetics.h" #include "kernel/importCTML.h" +#endif namespace Cantera { diff --git a/test_problems/surfkin/Makefile.in b/test_problems/surfkin/Makefile.in index 738a153b0..a7bb383df 100644 --- a/test_problems/surfkin/Makefile.in +++ b/test_problems/surfkin/Makefile.in @@ -15,6 +15,10 @@ PROG_NAME = surfdemo # and from C/C++ separately OBJS = surfdemo.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@ @@ -31,7 +35,11 @@ FORT_LIBS = @FLIBS@ CXX = @CXX@ # C++ compile flags +ifeq ($(src_dir_tree), 1) +CXX_FLAGS = -DSRCDIRTREE @CXXFLAGS@ +else CXX_FLAGS = @CXXFLAGS@ +endif # external libraries EXT_LIBS = @LOCAL_LIBS@ -lctcxx @@ -46,7 +54,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/surfkin/surfdemo.cpp b/test_problems/surfkin/surfdemo.cpp index 4e4a192ba..3be7e72c4 100644 --- a/test_problems/surfkin/surfdemo.cpp +++ b/test_problems/surfkin/surfdemo.cpp @@ -1,12 +1,18 @@ -// -// Replace this sample main program with your program -// -// - +/* + * $Id$ + * + * Sample program that solves an implicit problem for surface + * site fractions. + */ +#ifdef SRCDIRTREE +#include "ct_defs.h" +#include "../silane_equil/IdealGasMix.h" +#include "Interface.h" +#else #include "Cantera.h" #include "IdealGasMix.h" #include "Interface.h" - +#endif using namespace Cantera; int main() {