Skip to content

Commit

Permalink
Install bash completion to a right directory
Browse files Browse the repository at this point in the history
Using CMAKE_INSTALL_SYSCONFDIR caused that the "bash completion"
file was installed into `/usr/etc`, but it should go to '`/etc`.
To fix that, we need to use a special case described in
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html:
For <dir> equal to SYSCONFDIR, LOCALSTATEDIR or RUNSTATEDIR,
the CMAKE_INSTALL_FULL_<dir> is computed by prepending just / to
the value of CMAKE_INSTALL_<dir> if it is not user-specified as
an absolute path.
That means we should use CMAKE_INSTALL_FULL_SYSCONFDIR instead
of CMAKE_INSTALL_SYSCONFDIR as a install destination.
  • Loading branch information
jan-cerny committed Jul 17, 2018
1 parent ec949a3 commit 1ec4f0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if(NOT WIN32)
install(DIRECTORY "bash_completion.d" DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
install(DIRECTORY "bash_completion.d" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}")
endif()

0 comments on commit 1ec4f0f

Please sign in to comment.