summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJonathan Perkin <jonathan.perkin@oracle.com>2010-03-30 17:13:07 +0200
committerJonathan Perkin <jonathan.perkin@oracle.com>2010-03-30 17:13:07 +0200
commitbde4d7d3ee11b17050b5ef818eea019dae31b5d8 (patch)
tree46d618e5685477167982ceb91c2e8ca412e6f145 /cmake
parent08ec0a2a87232ecd3440506c77d839ad5c5e837d (diff)
downloadmariadb-git-bde4d7d3ee11b17050b5ef818eea019dae31b5d8.tar.gz
Fix from wlad.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/install_macros.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index da935b71a18..3350373a2b6 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -195,9 +195,40 @@ FUNCTION(INSTALL_DEBUG_TARGET target)
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" )
ENDIF()
+ # Define permissions
+ # For executable files
+ SET(PERMISSIONS_EXECUTABLE
+ PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+
+ # Permissions for shared library (honors CMAKE_INSTALL_NO_EXE which is
+ # typically set on Debian)
+ IF(CMAKE_INSTALL_SO_NO_EXE)
+ SET(PERMISSIONS_SHARED_LIBRARY
+ PERMISSIONS
+ OWNER_READ OWNER_WRITE
+ GROUP_READ
+ WORLD_READ)
+ ELSE()
+ SET(PERMISSIONS_SHARED_LIBRARY ${PERMISSIONS_EXECUTABLE})
+ ENDIF()
+
+ # Shared modules get the same permissions as shared libraries
+ SET(PERMISSIONS_MODULE_LIBRARY ${PERMISSIONS_SHARED_LIBRARY})
+
+ # Define permissions for static library
+ SET(PERMISSIONS_STATIC_LIBRARY
+ PERMISSIONS
+ OWNER_READ OWNER_WRITE
+ GROUP_READ
+ WORLD_READ)
+
INSTALL(${INSTALL_TYPE} ${debug_target_location}
DESTINATION ${ARG_DESTINATION}
${RENAME_PARAM}
+ ${PERMISSIONS_${target_type}}
CONFIGURATIONS Release RelWithDebInfo
OPTIONAL)