Only warn at missing write permissions

This commit is contained in:
Matthias Hochsteger 2017-01-31 12:20:27 +01:00
parent d718e86081
commit e0e856f7c0

View File

@ -56,16 +56,7 @@ if(UNIX)
execute_process(COMMAND mkdir -p ${INSTALL_DIR}) execute_process(COMMAND mkdir -p ${INSTALL_DIR})
execute_process(COMMAND test -w ${INSTALL_DIR} RESULT_VARIABLE res) execute_process(COMMAND test -w ${INSTALL_DIR} RESULT_VARIABLE res)
if(res) if(res)
message("No write permissions on install directory ${INSTALL_DIR}") message(WARNING "No write access at install directory, please set correct permissions")
message("The setup routine will now set write permissions by executing following commands, please provide your password when asked for it")
message("> sudo mkdir -p ${INSTALL_DIR}")
message("> sudo chown -r $ENV{USER}:$ENV{USER} ${INSTALL_DIR}")
execute_process(COMMAND sudo mkdir -p ${INSTALL_DIR})
execute_process(COMMAND sudo chown -R $ENV{USER}:$ENV{USER} ${INSTALL_DIR})
endif()
execute_process(COMMAND test -w ${INSTALL_DIR} RESULT_VARIABLE res)
if(res)
message(WARNING "still no write access at install directory, please set permissions manually")
endif() endif()
endif(UNIX) endif(UNIX)