Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake build: don't hardcode absolute paths in install DESTINATIONs #684

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
cmake_minimum_required (VERSION 3.0 FATAL_ERROR)
project (tcmu-runner C)
set(VERSION 1.5.4)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -Wdeclaration-after-statement -std=c99")
Expand Down Expand Up @@ -324,9 +324,9 @@ configure_file (
install(SCRIPT logrotate.conf_install.cmake)

install(FILES org.kernel.TCMUService1.service
DESTINATION /usr/share/dbus-1/system-services)
install(FILES tcmu-runner.conf DESTINATION /etc/dbus-1/system.d)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/system-services)
install(FILES tcmu-runner.conf DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/system.d)
if (SUPPORT_SYSTEMD)
install(FILES tcmu-runner.service DESTINATION /usr/lib/systemd/system/)
install(FILES tcmu-runner.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system)
endif (SUPPORT_SYSTEMD)
install(FILES tcmu-runner.8 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man8)
install(FILES tcmu-runner.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
6 changes: 3 additions & 3 deletions logrotate.conf_install.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (EXISTS "/etc/logrotate.d/tcmu-runner")
file(INSTALL "/etc/logrotate.d/tcmu-runner" DESTINATION "/etc/logrotate.d/tcmu-runner.bak" RENAME "tcmu-runner")
if (EXISTS "${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d/tcmu-runner")
file(RENAME "${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d/tcmu-runner" "${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d/tcmu-runner.bak")
endif()
file(INSTALL "${PROJECT_SOURCE_DIR}/logrotate.conf" DESTINATION "/etc/logrotate.d" RENAME "tcmu-runner")
install(FILES "${PROJECT_SOURCE_DIR}/logrotate.conf" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/logrotate.d" RENAME "tcmu-runner")
6 changes: 3 additions & 3 deletions tcmu.conf_install.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (EXISTS "/etc/tcmu/tcmu.conf")
file(INSTALL "/etc/tcmu/tcmu.conf" DESTINATION "/etc/tcmu/" RENAME "tcmu.conf.old")
if (EXISTS "${CMAKE_INSTALL_FULL_SYSCONFDIR}/tcmu/tcmu.conf")
file(RENAME "${CMAKE_INSTALL_FULL_SYSCONFDIR}/tcmu/tcmu.conf" "${CMAKE_INSTALL_FULL_SYSCONFDIR}/tcmu/tcmu.conf.old")
endif()
file(INSTALL "${PROJECT_SOURCE_DIR}/tcmu.conf" DESTINATION "/etc/tcmu/")
install(FILES "${PROJECT_SOURCE_DIR}/tcmu.conf" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/tcmu")