mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
Fix write permission check
This commit is contained in:
parent
b9018982e1
commit
2b16f9994f
@ -53,13 +53,14 @@ else(APPLE)
|
|||||||
set(CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
|
set(CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
# check for write permissions in install directory
|
message("Checking for write permissions in install directory...")
|
||||||
|
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("No write permissions on install directory ${INSTALL_DIR}")
|
||||||
message("The setup routine will now set write permissions by executing following commands, please provide your password when asked for:")
|
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 mkdir -p ${INSTALL_DIR}")
|
||||||
message("sudo chown -r $ENV{USER}:$ENV{USER} ${INSTALL_DIR}")
|
message("> sudo chown -r $ENV{USER}:$ENV{USER} ${INSTALL_DIR}")
|
||||||
execute_process(COMMAND sudo mkdir -p ${INSTALL_DIR})
|
execute_process(COMMAND sudo mkdir -p ${INSTALL_DIR})
|
||||||
execute_process(COMMAND sudo chown -R $ENV{USER}:$ENV{USER} ${INSTALL_DIR})
|
execute_process(COMMAND sudo chown -R $ENV{USER}:$ENV{USER} ${INSTALL_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user