[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.
This commit is contained in:
Mahmoud Al-Qudsi 2018-03-04 15:46:29 -06:00
parent 9502ea8de3
commit 71329a250b

View file

@ -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)