diff --git a/configure.ac b/configure.ac index effbc6d57dae978b412ae1a4ce1c2354aa276b85..709f18f37dfa050ddd9db3c02d9346e6c7226b9e 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,7 @@ AC_CONFIG_FILES([ Makefile src/Makefile src/octave/Makefile + src/python/Makefile doc/Makefile doc/doxygen/Makefile doc/doxygen/Doxyfile diff --git a/src/Makefile.am b/src/Makefile.am index 1a32ffaab3115630d96680fc6f277dfa6a310e36..afb99399d5107697b2bf164d680273ec3a8b0dc8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,6 @@ SUBDIRS = octave check_PROGRAMS = \ - test-python \ test-gradient-method bin_PROGRAMS = \ @@ -14,13 +13,10 @@ run-one-body-sample: one-body-sample one_body_sample_SOURCES = \ one-body-sample.cc -test_python_SOURCES = \ - test-python.cc - test_gradient_method_SOURCES = \ test-gradient-method.cc -TESTS= test-python test-gradient-method +TESTS= test-gradient-method # Some are for clang, others are for gcc AM_CXXFLAGS = \ @@ -38,7 +34,6 @@ AM_CXXFLAGS = \ AM_CPPFLAGS = \ $(DUNE_CPPFLAGS) \ $(ALUGRID_CPPFLAGS) \ - $(PYTHON_CPPFLAGS) \ -I$(top_srcdir) # The libraries have to be given in reverse order (most basic libraries @@ -47,12 +42,10 @@ AM_CPPFLAGS = \ # here as well. LDADD = \ $(DUNE_LDFLAGS) $(DUNE_LIBS) \ - $(ALUGRID_LDFLAGS) $(ALUGRID_LIBS) \ - $(PYTHON_LIBS) + $(ALUGRID_LDFLAGS) $(ALUGRID_LIBS) AM_LDFLAGS = \ $(ALUGRID_LDFLAGS) \ - $(DUNE_LDFLAGS) \ - $(PYTHON_LDFLAGS) + $(DUNE_LDFLAGS) # don't follow the full GNU-standard # we need automake 1.5 diff --git a/src/python/Makefile.am b/src/python/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..b1410531d0988b198a00099f47c0c9fd93330d90 --- /dev/null +++ b/src/python/Makefile.am @@ -0,0 +1,23 @@ +SUBDIRS = + +check_PROGRAMS = \ + test-python + +TESTS = test-python + +test_python_SOURCES = \ + test-python.cc +test_python_CPPFLAGS= \ + $(AM_CPPFLAGS) -DDUNE_NICE_FUNCTION_MODULE_PATH="\"$(srcdir)\"" + +AM_CPPFLAGS = \ + $(DUNE_CPPFLAGS) \ + $(PYTHON_CPPFLAGS) \ + -I$(top_srcdir) + +LDADD = \ + $(DUNE_LDFLAGS) $(DUNE_LIBS) \ + $(PYTHON_LIBS) +AM_LDFLAGS = \ + $(DUNE_LDFLAGS) \ + $(PYTHON_LDFLAGS) diff --git a/src/nicefunction.py b/src/python/nicefunction.py similarity index 100% rename from src/nicefunction.py rename to src/python/nicefunction.py diff --git a/src/test-python.cc b/src/python/test-python.cc similarity index 79% rename from src/test-python.cc rename to src/python/test-python.cc index 28a3658ad010657eac694df84c2bf8822c296f10..75f4c5eb205a68e4da1a26b8c9dbc161eef5a113 100644 --- a/src/test-python.cc +++ b/src/python/test-python.cc @@ -4,6 +4,10 @@ #include "config.h" #endif +#ifndef DUNE_NICE_FUNCTION_MODULE_PATH +#error DUNE_NICE_FUNCTION_MODULE_PATH unset +#endif + #ifndef HAVE_PYTHON #error Python is necessary #else @@ -27,8 +31,10 @@ int main() { Python::start(); Python::run("import sys"); - Python::run( - "sys.path.append('../../src')"); // FIXME: use path to source here + std::string importString("sys.path.append('"); + importString += DUNE_NICE_FUNCTION_MODULE_PATH; + importString += "')"; + Python::run(importString.c_str()); Python::Reference module = Python::import("nicefunction"); Python::Reference funcRef = module.get("Functions");