From 71329a250b09dfacaca48fb69c69fe59eeb0c15a Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 4 Mar 2018 15:46:29 -0600 Subject: [PATCH] [cmake] Don't create installation directories that already exist fish's cmake install routines were attempting to create system directories that already existed, an operation for which the permissions to do so may not be available (e.g. /usr/local/share/pkgconfig) This commit first checks if a directory exists before creating it. --- cmake/Install.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Install.cmake b/cmake/Install.cmake index 03413c938..6aad5a4bc 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -54,7 +54,9 @@ ENDIF() # Define a function to help us create directories. FUNCTION(FISH_CREATE_DIRS) FOREACH(dir ${ARGV}) - INSTALL(DIRECTORY DESTINATION ${dir}) + IF(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/${dir}) + INSTALL(DIRECTORY DESTINATION ${dir}) + ENDIF() ENDFOREACH(dir) ENDFUNCTION(FISH_CREATE_DIRS)