Fixed the program so that it can be run from srcdirtree and install tree

This commit is contained in:
Harry Moffat 2006-03-03 14:43:34 +00:00
parent c876f55003
commit 6bf3be84c3
3 changed files with 35 additions and 9 deletions

View file

@ -1,11 +1,19 @@
#ifndef CXX_INTERFACE
#define CXX_INTERFACE
/*
* $Id$
*/
#ifndef CXX_INTERFACE_H
#define CXX_INTERFACE_H
#include <string>
#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 {

View file

@ -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@

View file

@ -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() {