From 1434193a3804010c093009a12626dcf8c12dc6ed Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Thu, 4 Feb 2016 08:28:47 +0100 Subject: [PATCH] [cmake] Fix broken tests after change in TRIQS install macros - After the change in main lib, need to put explicitely the sitecustomize file --- cmake/sitecustomize.py | 8 ++++++++ python/CMakeLists.txt | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 cmake/sitecustomize.py 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})