diff --git a/cmake_modules/SuperBuild.cmake b/cmake_modules/SuperBuild.cmake index eb800779..e391bc73 100644 --- a/cmake_modules/SuperBuild.cmake +++ b/cmake_modules/SuperBuild.cmake @@ -53,13 +53,14 @@ else(APPLE) set(CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "Prefix prepended to install directories" FORCE) endif(APPLE) 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) - IF(res) + if(res) 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("sudo mkdir -p ${INSTALL_DIR}") - message("sudo chown -r $ENV{USER}:$ENV{USER} ${INSTALL_DIR}") + 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()