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([
Makefile
src/Makefile
src/octave/Makefile
src/python/Makefile
doc/Makefile
doc/doxygen/Makefile
doc/doxygen/Doxyfile
......
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
......
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 @@
#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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment