diff --git a/cmake/python-install.cmake.in b/cmake/python-install.cmake.in index 95d6bd1dd2d..c4c5171cb02 100644 --- a/cmake/python-install.cmake.in +++ b/cmake/python-install.cmake.in @@ -2,9 +2,9 @@ if(DEFINED ENV{DESTDIR}) # If DESTDIR is not absolute path, make it relative to @PROJECT_BINARY_DIR@ # like any install() command. if(IS_ABSOLUTE $ENV{DESTDIR}) - set(ROOT "--root=$ENV{DESTDIR}") + set(ROOT "--root='$ENV{DESTDIR}'") else() - set(ROOT "--root=@PROJECT_BINARY_DIR@/$ENV{DESTDIR}") + set(ROOT "--root='@PROJECT_BINARY_DIR@/$ENV{DESTDIR}'") endif() else() set(ROOT "") @@ -13,7 +13,7 @@ endif() # Check if we have system Python on Debian/Ubuntu, if so tell setuptools # to use the deb layout (dist-packages instead of site-packages). execute_process( - COMMAND @Python3_EXECUTABLE@ -c "import sys; sys.stdout.write(sys.path[-1])" + COMMAND "@Python3_EXECUTABLE@" -c "import sys; sys.stdout.write(sys.path[-1])" OUTPUT_VARIABLE Python_STDLIB_DIR ) if(Python_STDLIB_DIR MATCHES ".*/dist-packages$") @@ -24,8 +24,8 @@ endif() execute_process( WORKING_DIRECTORY @PROJECT_BINARY_DIR@/python - COMMAND @Python3_EXECUTABLE@ setup.py install + COMMAND "@Python3_EXECUTABLE@" setup.py install ${ROOT} - --prefix=@CMAKE_INSTALL_PREFIX@ + --prefix="@CMAKE_INSTALL_PREFIX@" ${SETUPTOOLS_INSTALL_LAYOUT} )