Skip to content
Snippets Groups Projects
Commit 7c1e6f04 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Move python-related files to a subdir

Fix search path for modules as well
parent 82d7d2b0
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ AC_CONFIG_FILES([ ...@@ -21,6 +21,7 @@ AC_CONFIG_FILES([
Makefile Makefile
src/Makefile src/Makefile
src/octave/Makefile src/octave/Makefile
src/python/Makefile
doc/Makefile doc/Makefile
doc/doxygen/Makefile doc/doxygen/Makefile
doc/doxygen/Doxyfile doc/doxygen/Doxyfile
......
SUBDIRS = octave SUBDIRS = octave
check_PROGRAMS = \ check_PROGRAMS = \
test-python \
test-gradient-method test-gradient-method
bin_PROGRAMS = \ bin_PROGRAMS = \
...@@ -14,13 +13,10 @@ run-one-body-sample: one-body-sample ...@@ -14,13 +13,10 @@ run-one-body-sample: one-body-sample
one_body_sample_SOURCES = \ one_body_sample_SOURCES = \
one-body-sample.cc one-body-sample.cc
test_python_SOURCES = \
test-python.cc
test_gradient_method_SOURCES = \ test_gradient_method_SOURCES = \
test-gradient-method.cc test-gradient-method.cc
TESTS= test-python test-gradient-method TESTS= test-gradient-method
# Some are for clang, others are for gcc # Some are for clang, others are for gcc
AM_CXXFLAGS = \ AM_CXXFLAGS = \
...@@ -38,7 +34,6 @@ AM_CXXFLAGS = \ ...@@ -38,7 +34,6 @@ AM_CXXFLAGS = \
AM_CPPFLAGS = \ AM_CPPFLAGS = \
$(DUNE_CPPFLAGS) \ $(DUNE_CPPFLAGS) \
$(ALUGRID_CPPFLAGS) \ $(ALUGRID_CPPFLAGS) \
$(PYTHON_CPPFLAGS) \
-I$(top_srcdir) -I$(top_srcdir)
# The libraries have to be given in reverse order (most basic libraries # The libraries have to be given in reverse order (most basic libraries
...@@ -47,12 +42,10 @@ AM_CPPFLAGS = \ ...@@ -47,12 +42,10 @@ AM_CPPFLAGS = \
# here as well. # here as well.
LDADD = \ LDADD = \
$(DUNE_LDFLAGS) $(DUNE_LIBS) \ $(DUNE_LDFLAGS) $(DUNE_LIBS) \
$(ALUGRID_LDFLAGS) $(ALUGRID_LIBS) \ $(ALUGRID_LDFLAGS) $(ALUGRID_LIBS)
$(PYTHON_LIBS)
AM_LDFLAGS = \ AM_LDFLAGS = \
$(ALUGRID_LDFLAGS) \ $(ALUGRID_LDFLAGS) \
$(DUNE_LDFLAGS) \ $(DUNE_LDFLAGS)
$(PYTHON_LDFLAGS)
# don't follow the full GNU-standard # don't follow the full GNU-standard
# we need automake 1.5 # we need automake 1.5
......
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)
File moved
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
#include "config.h" #include "config.h"
#endif #endif
#ifndef DUNE_NICE_FUNCTION_MODULE_PATH
#error DUNE_NICE_FUNCTION_MODULE_PATH unset
#endif
#ifndef HAVE_PYTHON #ifndef HAVE_PYTHON
#error Python is necessary #error Python is necessary
#else #else
...@@ -27,8 +31,10 @@ int main() { ...@@ -27,8 +31,10 @@ int main() {
Python::start(); Python::start();
Python::run("import sys"); Python::run("import sys");
Python::run( std::string importString("sys.path.append('");
"sys.path.append('../../src')"); // FIXME: use path to source here importString += DUNE_NICE_FUNCTION_MODULE_PATH;
importString += "')";
Python::run(importString.c_str());
Python::Reference module = Python::import("nicefunction"); Python::Reference module = Python::import("nicefunction");
Python::Reference funcRef = module.get("Functions"); Python::Reference funcRef = module.get("Functions");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment