diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6c9ca..840e75d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,20 +75,24 @@ find_package(PythonInterp REQUIRED) # Check Python version if(${PYTHON_VERSION_MAJOR} EQUAL 3 AND ${PYTHON_VERSION_MINOR} GREATER_EQUAL 10) -execute_process( - COMMAND "${Python_EXECUTABLE}" -c "from sys import exec_prefix; print(exec_prefix)" - OUTPUT_VARIABLE PYTHON_SITE_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + execute_process( + COMMAND "${Python_EXECUTABLE}" -c "from sys import exec_prefix; print(exec_prefix)" + OUTPUT_VARIABLE PYTHON_SITE_PACKAGES + OUTPUT_STRIP_TRAILING_WHITESPACE + ) else() -execute_process( - COMMAND "${Python_EXECUTABLE}" -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" - OUTPUT_VARIABLE PYTHON_SITE_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + execute_process( + COMMAND "${Python_EXECUTABLE}" -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" + OUTPUT_VARIABLE PYTHON_SITE_PACKAGES + OUTPUT_STRIP_TRAILING_WHITESPACE + ) endif() - - message(STATUS "Python site packages directory: ${PYTHON_SITE_PACKAGES}") -install(TARGETS openfhe LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(Python_Install_Location "${PYTHON_SITE_PACKAGES}") +else() + set(Python_Install_Location "${CMAKE_INSTALL_PREFIX}") +endif() +message("***** INSTALL IS AT ${Python_Install_Location}; to change, run cmake with -DCMAKE_INSTALL_PREFIX=/your/path") +install(TARGETS openfhe LIBRARY DESTINATION ${Python_Install_Location})