diff --git a/cmake/sitecustomize.py b/cmake/sitecustomize.py new file mode 100644 index 00000000..0f31ba93 --- /dev/null +++ b/cmake/sitecustomize.py @@ -0,0 +1,8 @@ +def application_pytriqs_import(name,*args,**kwargs): + if name.startswith('@package_name@'): + name = name[len('@package_name@')+1:] + return builtin_import(name,*args,**kwargs) + +import __builtin__ +__builtin__.__import__, builtin_import = application_pytriqs_import, __builtin__.__import__ + diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 33c5f133..4283e74b 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,5 +1,9 @@ # where will the python end up in triqs? set(python_destination applications/dft) +# site_customize for build +set(package_name "pytriqs.applications") +configure_file(${CMAKE_SOURCE_DIR}/cmake/sitecustomize.py ${CMAKE_CURRENT_BINARY_DIR}/sitecustomize.py @ONLY) + # make a local pytriqs copy triqs_prepare_local_pytriqs(${python_destination})