diff options
author | John Szakmeister <john@szakmeister.net> | 2014-09-19 07:37:22 -0400 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2014-09-22 05:56:52 -0400 |
commit | 0d35369324e75b2abfbfd59978939c16f7960d23 (patch) | |
tree | bf4c79a74728022dd5566d6373cc9e6e7ac39831 /src | |
parent | ba7472c54dfa04f8df2d44e617624a07f3bfa06f (diff) | |
download | rneovim-0d35369324e75b2abfbfd59978939c16f7960d23.tar.gz rneovim-0d35369324e75b2abfbfd59978939c16f7960d23.tar.bz2 rneovim-0d35369324e75b2abfbfd59978939c16f7960d23.zip |
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/nvim/po/CMakeLists.txt | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 83de3347bd..208df31596 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -174,7 +174,7 @@ if(NOT DEFINED ENV{SKIP_EXEC}) add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} ${NEOVIM_HEADERS}) target_link_libraries(nvim ${NVIM_LINK_LIBRARIES}) - install(TARGETS nvim RUNTIME DESTINATION bin) + install_helper(TARGETS nvim) endif() if(NOT DEFINED ENV{SKIP_UNITTEST}) diff --git a/src/nvim/po/CMakeLists.txt b/src/nvim/po/CMakeLists.txt index 4a9c97dc20..0ed39e8c49 100644 --- a/src/nvim/po/CMakeLists.txt +++ b/src/nvim/po/CMakeLists.txt @@ -71,7 +71,7 @@ if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG AND -P ${CMAKE_MODULE_PATH}/RunMsgfmt.cmake DEPENDS ${poFile} ${NVIM_POT}) - install( + install_helper( FILES ${moFile} DESTINATION share/locale/${name}/LC_MESSAGES RENAME nvim.mo) |