fix(build): Use CMAKE_INSTALL_FULL_<dir> for default config
Using CMAKE_INSTALL_SYSCONFDIR does respect CMAKE_INSTALL_PREFIX, but it prefixes it to CMAKE_INSTALL_SYSCONFDIR, which results in the default config being installed to /usr/etc/polybar/config.ini or /usr/local/etc/polybar/config.ini CMAKE_INSTALL_FULL_SYSCONFDIR gives an absolute path that respects the prefix but does the right thing (uses /etc) if it is /usr Ref: #2770
This commit is contained in:
parent
b3cbf0a644
commit
8cc1b4fcfd
@ -15,7 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- If the `exec` command produced no output and exited with a non-zero exit code the module is no longer completely empty, but just has an empty `%output%` token. If you relied on this behavior to hide the module under certain circumstances, make sure the script exits with an exit code of zero. ([`#2857`](https://github.com/polybar/polybar/discussions/2857), [`#2861`](https://github.com/polybar/polybar/pull/2861))
|
||||
|
||||
### Build
|
||||
- Respect `CMAKE_INSTALL_PREFIX` when installing default config ([`#2770`](https://github.com/polybar/polybar/pull/2770))
|
||||
- Respect `CMAKE_INSTALL_PREFIX` when installing default config ([`#2770`](https://github.com/polybar/polybar/pull/2770), [`#2917`](https://github.com/polybar/polybar/pull/2917))
|
||||
- Change default `CMAKE_INSTALL_PREFIX` to `/usr`. Installations with default flags will now go into `/usr` instead of `/usr/local` ([`#2917`](https://github.com/polybar/polybar/pull/2917))
|
||||
- Bump C++ version to C++17 ([`#2847`](https://github.com/polybar/polybar/pull/2847))
|
||||
|
||||
### Deprecated
|
||||
|
@ -22,6 +22,14 @@ else()
|
||||
set(APP_VERSION "${version_txt}")
|
||||
endif()
|
||||
|
||||
# Set the default installation prefix to /usr
|
||||
# Otherwise the default value is /usr/local which causes the default config
|
||||
# file to be installed to /usr/local/etc, with /usr, cmake has special handling
|
||||
# for this.
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Project-default installation prefix" FORCE)
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
${PROJECT_SOURCE_DIR}/cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/common
|
||||
@ -60,10 +68,9 @@ if(BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
|
||||
if(BUILD_CONFIG)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/doc/config.ini
|
||||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME}
|
||||
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${PROJECT_NAME}
|
||||
COMPONENT config)
|
||||
endif()
|
||||
|
||||
|
@ -18,6 +18,7 @@ message_colored(STATUS " BINDIR: ${CMAKE_INSTALL_FULL_BINDIR}" "32")
|
||||
message_colored(STATUS " DATADIR: ${CMAKE_INSTALL_FULL_DATADIR}" "32")
|
||||
message_colored(STATUS " DOCDIR: ${CMAKE_INSTALL_FULL_DOCDIR}" "32")
|
||||
message_colored(STATUS " MANDIR: ${CMAKE_INSTALL_FULL_MANDIR}" "32")
|
||||
message_colored(STATUS " SYSCONFDIR: ${CMAKE_INSTALL_FULL_SYSCONFDIR}" "32")
|
||||
|
||||
message(STATUS " Targets:")
|
||||
colored_option(" polybar" BUILD_POLYBAR)
|
||||
|
Loading…
Reference in New Issue
Block a user