diff --git a/CMakeLists.txt b/CMakeLists.txt index a0fcc96dcc39e6af733d1d5a3d1e25ae72e6abc9..6ecf73b038f200afc419bd0210b34664ded7e908 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,15 +59,6 @@ option(ARB_WITH_NEUROML "build NeuroML support library" OFF) option(ARB_WITH_PYTHON "enable Python front end" OFF) -if (ARB_WITH_PYTHON) - # Find path in which to install the Python module. - find_package(PythonInterp REQUIRED) - # Ask the above found Python where it keeps its system (platform) packages. - execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('platlib'))" OUTPUT_VARIABLE ARB_PYTHON_LIB_PATH_DEFAULT OUTPUT_STRIP_TRAILING_WHITESPACE) - # Default to installing in that path - set(ARB_PYTHON_LIB_PATH ${ARB_PYTHON_LIB_PATH_DEFAULT} CACHE PATH "path for installing Python module for Arbor.") -endif() - #---------------------------------------------------------- # Global CMake configuration #---------------------------------------------------------- diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index dd31c7a91671c3dfe8b9c84b381fda79950a4765..f20ffe2dc0eca971060a13a3c39f9648c6f97b36 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -75,4 +75,9 @@ file(COPY "${PROJECT_SOURCE_DIR}/VERSION" DESTINATION "${python_mod_path}") # Set the installation path +# Ask Python where it keeps its system (platform) packages. +execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('platlib'))" OUTPUT_VARIABLE ARB_PYTHON_LIB_PATH_DEFAULT OUTPUT_STRIP_TRAILING_WHITESPACE) +# Default to installing in that path, override with user specified ARB_PYTHON_LIB_PATH +set(ARB_PYTHON_LIB_PATH ${ARB_PYTHON_LIB_PATH_DEFAULT} CACHE PATH "path for installing Python module for Arbor.") + install(DIRECTORY ${python_mod_path} DESTINATION ${ARB_PYTHON_LIB_PATH})