diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index e85d4e047dd7094ef688eb75ad497a07d32b67a8..4d704055b282f2fb1333f6f2f51a430d15875b2d 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -104,9 +104,8 @@ if(BORNAGAIN_PYTHON) list(APPEND source_files "${AUTO_DIR}/libBornAgainCore_wrap.cpp") #list(APPEND include_files "${AUTO_DIR}/libBornAgainCore_wrap.h") - configure_file(${WRAP_DIR}/python-setup/bornagain/plot_utils.py ${CMAKE_BINARY_DIR}/lib/plot_utils/__init__.py COPYONLY) - configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/__init__.py.in" "${destination_runtime_configs}/__init__.py" @ONLY) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${destination_runtime_configs}/__init__.py" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/bornagain) + configure_file(${WRAP_DIR}/python/plot_utils/__init__.py ${CMAKE_BINARY_DIR}/lib/plot_utils/__init__.py COPYONLY) + configure_file("${WRAP_DIR}/python/__init__.py.in" "${CMAKE_BINARY_DIR}/lib/__init__.py" @ONLY) endif() @@ -229,8 +228,9 @@ if(WIN32) else() # installing thisbornagain.sh - install(FILES ${destination_runtime_configs}/frombin_setup_paths.sh - ${destination_runtime_configs}/frombin_setup_paths.csh + install(FILES + ${destination_runtime_configs}/thisbornagain.sh + ${destination_runtime_configs}/thisbornagain.csh PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${destination_libexec}) @@ -244,18 +244,18 @@ else() # making links install(CODE " execute_process(COMMAND \${CMAKE_COMMAND} -E create_symlink - \"../libexec/${destination_suffix}/frombin_setup_paths.sh\" \"thisbornagain.sh\" + \"../${destination_libexec}/thisbornagain.sh\" \"thisbornagain.sh\" WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${destination_bin}\") " COMPONENT Runtime) install(CODE " execute_process(COMMAND \${CMAKE_COMMAND} -E create_symlink - \"../libexec/${destination_suffix}/frombin_setup_paths.csh\" \"thisbornagain.csh\" + \"../${destination_libexec}/thisbornagain.csh\" \"thisbornagain.csh\" WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${destination_bin}\") " COMPONENT Runtime) else() - install(FILES ${WRAP_DIR}/python-setup/bornagain_python_install.py + install(FILES ${WRAP_DIR}/python/bornagain_python_install.py DESTINATION ${destination_libexec}) endif() @@ -263,10 +263,5 @@ else() endif() # Install bornagain/__init__.py and utilites -if(NOT BORNAGAIN_APPLE_BUNDLE) - install (DIRECTORY ${WRAP_DIR}/python-setup/bornagain DESTINATION ${destination_lib} COMPONENT Libraries) - install (FILES "${destination_runtime_configs}/__init__.py" DESTINATION ${destination_lib}/bornagain COMPONENT Libraries) -else() - install (DIRECTORY ${WRAP_DIR}/python-setup/bornagain DESTINATION ${destination_libexec} COMPONENT Libraries) - install (FILES "${destination_runtime_configs}/__init__.py" DESTINATION ${destination_libexec}/bornagain COMPONENT Libraries) -endif() +install (FILES "${CMAKE_BINARY_DIR}/lib/__init__.py" DESTINATION ${destination_libexec}/bornagain/ COMPONENT Libraries) +install (FILES "${CMAKE_BINARY_DIR}/lib/plot_utils/__init__.py" DESTINATION ${destination_libexec}/bornagain/plot_utils/ COMPONENT Libraries) diff --git a/GUI/main/CMakeLists.txt b/GUI/main/CMakeLists.txt index b793ca7952d1b5615e60f088088152645b5a44a1..c7f46f3a285f3233d0405b3477f2aa1c520c3f58 100644 --- a/GUI/main/CMakeLists.txt +++ b/GUI/main/CMakeLists.txt @@ -118,11 +118,9 @@ if(UNIX) # creating link to BornAgain gui in bin directory install(CODE " execute_process(COMMAND \${CMAKE_COMMAND} -E create_symlink - \"../libexec/${destination_suffix}/BornAgain\" \"bornagain\" + \"../${destination_libexec}/BornAgain\" \"bornagain\" WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${destination_bin}\") " COMPONENT Runtime) endif() endif() - - diff --git a/Wrap/python-setup/README b/Wrap/python-setup/README deleted file mode 100644 index 80936ceddc9a9949ca46f7098164c14b94e68462..0000000000000000000000000000000000000000 --- a/Wrap/python-setup/README +++ /dev/null @@ -1,12 +0,0 @@ -Python utilities to setup BornAgain libraries - -1) bornagain_python_install.py -The script to install BornAgain libraries into site-packages of user Python on MacOs systems. -Requires that BornAgain.app has to be installed on the system. - -2) bornagain -The directory with __init__.py to be installed into lib directory. The goal is to have -the directive 'import bornagain' available on Python. - - - diff --git a/Wrap/python/README b/Wrap/python/README new file mode 100644 index 0000000000000000000000000000000000000000..e8ac569bc974941607f6835b32d70e11bb54b3f2 --- /dev/null +++ b/Wrap/python/README @@ -0,0 +1,12 @@ +Python utilities to setup and use BornAgain libraries + +1) Installation script + bornagain_python_install.py +The script to install BornAgain libraries into site-packages of user Python on MacOs systems. +Requires that BornAgain.app has to be installed on the system. + +2) End-user code + __init__.py + plot_utils/__init__.py +to be installed into lib directory. The goal is to have +the directive 'import bornagain' available on Python. diff --git a/cmake/scripts/__init__.py.in b/Wrap/python/__init__.py.in similarity index 100% rename from cmake/scripts/__init__.py.in rename to Wrap/python/__init__.py.in diff --git a/Wrap/python-setup/bornagain_python_install.py b/Wrap/python/bornagain_python_install.py similarity index 100% rename from Wrap/python-setup/bornagain_python_install.py rename to Wrap/python/bornagain_python_install.py diff --git a/Wrap/python-setup/bornagain/plot_utils.py b/Wrap/python/plot_utils/__init__.py similarity index 100% rename from Wrap/python-setup/bornagain/plot_utils.py rename to Wrap/python/plot_utils/__init__.py diff --git a/cmake/modules/BornAgainConfiguration.cmake b/cmake/modules/BornAgainConfiguration.cmake index 96acc0286e3f18d7002dc34043259b4838cdb494..de35d5a50a2a955af63c9570fc639770f1ba0f3f 100644 --- a/cmake/modules/BornAgainConfiguration.cmake +++ b/cmake/modules/BornAgainConfiguration.cmake @@ -20,12 +20,10 @@ # cmake_policy(SET CMP0028 NEW) #endif() - # ----------------------------------------------------------------------------- # Common definitions # ----------------------------------------------------------------------------- - # suppress qDebug() output for release build if(CMAKE_BUILD_TYPE STREQUAL Release) add_definitions(-DQT_NO_DEBUG_OUTPUT) @@ -75,11 +73,12 @@ else() if(APPLE AND BORNAGAIN_APPLE_BUNDLE) set(destination_bundle BornAgain.app) set(destination_prefix ${destination_bundle}/Contents/) + set(destination_libexec ${destination_prefix}libexec/${destination_suffix}) else() set(destination_prefix "") + set(destination_libexec ${destination_prefix}lib/${destination_suffix}) endif() set(destination_bin ${destination_prefix}bin) - set(destination_libexec ${destination_prefix}libexec/${destination_suffix}) set(destination_gui ${destination_libexec}) set(destination_lib ${destination_prefix}lib/${destination_suffix}) set(destination_include ${destination_prefix}include/${destination_suffix}) @@ -88,6 +87,8 @@ else() set(destination_images ${destination_share}Images) endif() +message(STATUS "Destination directories: bin->${destination_bin}, lib->${destination_lib}, gui&libexec->${destination_libexec}, include->${destination_include}, share->${destination_share}") + # ----------------------------------------------------------------------------- # configure files # ----------------------------------------------------------------------------- @@ -109,8 +110,8 @@ endif() set(this_bindir $BORNAGAINSYS/bin) set(this_libdir $BORNAGAINSYS/lib/${destination_suffix}) -configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.sh.in" "${destination_runtime_configs}/frombin_setup_paths.sh" @ONLY) -configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.csh.in" "${destination_runtime_configs}/frombin_setup_paths.csh" @ONLY) +configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.sh.in" "${destination_runtime_configs}/thisbornagain.sh" @ONLY) +configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.csh.in" "${destination_runtime_configs}/thisbornagain.csh" @ONLY) # ----------------------------------------------------------------------------- # configure C++ source code