diff --git a/CMakeLists.txt b/CMakeLists.txt index a54e2c6e..6ec8c492 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,9 @@ ELSE () MESSAGE (FATAL_ERROR "Invalid PYTHON_DESIRED value: " ${PYTHON_DESIRED}) ENDIF() -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('purelib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) +IF (not PYTHON_INSTALL_DIR) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('purelib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) +ENDIF() MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}") SET (SYSCONFDIR /etc)