From 586958eea9e78236e0438313cb3316d77f4aece1 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 14 Feb 2018 16:17:19 -0500 Subject: [PATCH] Fixing install of python files after cmake changes --- python/CMakeLists.txt | 7 +++---- python/converters/CMakeLists.txt | 10 ++++++++++ python/converters/plovasp/CMakeLists.txt | 19 ++++++++++++------- 3 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 python/converters/CMakeLists.txt diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index e69d8dd0..2ad35566 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -5,16 +5,15 @@ set(PYTHON_LIB_DEST ${CPP2PY_PYTHON_LIB_DEST_ROOT}/triqs_dft_tools) set(package_name "triqs_dft_tools") # Create a temporary copy of the python modules so that we can run before installation with the test -FILE(GLOB_RECURSE PYTHON_SOURCES RELATIVE ${CMAKE_SOURCE_DIR}/python *.py ) +FILE(GLOB PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py ) foreach(f ${PYTHON_SOURCES}) configure_file(${f} ${f} COPYONLY) endforeach() -# VASP converter -add_subdirectory(converters/plovasp) - # add version file configure_file(version.py.in version.py @ONLY) # install files install(FILES ${PYTHON_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${PYTHON_LIB_DEST}) + +add_subdirectory(converters) diff --git a/python/converters/CMakeLists.txt b/python/converters/CMakeLists.txt new file mode 100644 index 00000000..3c719f26 --- /dev/null +++ b/python/converters/CMakeLists.txt @@ -0,0 +1,10 @@ +# Create a temporary copy of the python modules so that we can run before installation with the test +FILE(GLOB PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py) +foreach(f ${PYTHON_SOURCES}) + configure_file(${f} ${f} COPYONLY) +endforeach() + +# install files +install(FILES ${PYTHON_SOURCES} DESTINATION ${PYTHON_LIB_DEST}/converters) + +add_subdirectory(plovasp) diff --git a/python/converters/plovasp/CMakeLists.txt b/python/converters/plovasp/CMakeLists.txt index f9750662..9f2fbdaa 100644 --- a/python/converters/plovasp/CMakeLists.txt +++ b/python/converters/plovasp/CMakeLists.txt @@ -1,14 +1,19 @@ -set(python_destination pytriqs/applications/dft/converters/plovasp) - +# === Build and install atm module add_cpp2py_module(atm) target_link_libraries(atm atm_c triqs) -#triqs_set_rpath_for_target(atm) target_compile_options(atm PRIVATE -std=c++17) target_include_directories(atm PRIVATE ${CMAKE_SOURCE_DIR}/c++) +install(TARGETS atm DESTINATION ${PYTHON_LIB_DEST}/converters/plovasp) + +# === Copy Python files to current build directory and register for install +set(PYTHON_SOURCES __init__.py converter.py elstruct.py inpconf.py plotools.py proj_group.py proj_shell.py sc_dmft.py vaspio.py) +foreach(f ${PYTHON_SOURCES}) + configure_file(${f} ${f} COPYONLY) +endforeach() + +# install files +install(FILES ${PYTHON_SOURCES} DESTINATION ${PYTHON_LIB_DEST}/converters/plovasp) + # This we need in order for tests to work #add_custom_command(TARGET atm POST_BUILD COMMAND ln -fs ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/atm.so ${CMAKE_BINARY_DIR}/python/dft/converters/plovasp) - -install (TARGETS atm DESTINATION ${PYTHON_LIB_DEST}) - -