Split the data and sources
All checks were successful
Build / build (push) Successful in 16s

This commit is contained in:
Eugen Wissner 2024-05-21 18:58:15 +02:00
parent 81232f6104
commit 0eccfe3ef3
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
11 changed files with 30 additions and 36 deletions

View File

@ -6,28 +6,5 @@ include(GNUInstallDirs)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_CXX_STANDARD 17)
find_package(PkgConfig)
pkg_check_modules(GDBUS REQUIRED gio-2.0 dbus-1 glibmm-2.4)
find_program(SED sed)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
COMMAND ${SED} -e s|@LIBEXECDIR@|${CMAKE_INSTALL_FULL_LIBEXECDIR}| ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.timedate1.service.in > ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
MAIN_DEPENDENCY org.freedesktop.timedate1.service.in
VERBATIM)
add_custom_target(service ALL DEPENDS ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service)
add_executable(slack-timedate
slack-timedate.cpp slack-timedate.h
)
target_include_directories(slack-timedate PRIVATE ${GDBUS_INCLUDE_DIRS})
target_link_libraries(slack-timedate ${GDBUS_LIBRARIES})
install(TARGETS slack-timedate DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
install(FILES org.freedesktop.timedate1.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/interfaces)
install(FILES org.freedesktop.timedate1.policy
DESTINATION ${CMAKE_INSTALL_DATADIR}/polkit-1/actions)
install(FILES org.freedesktop.timedate1.conf
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d)
install(FILES ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/system-services)
add_subdirectory(data)
add_subdirectory(src)

View File

@ -1,9 +0,0 @@
2024-04-07 Eugen Wissner <belka@caraus.de>
* Added PolicyKit configuration
==================== 1.1 ====================
2012-01-22 Eugen Wissner <belka@caraus.de>
* Added autotools scripts

View File

@ -8,7 +8,7 @@ init-system.
## Installation
```
```sh
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_SYSCONFDIR=/etc
@ -20,7 +20,7 @@ The installation will create a file `build/install_manifest.txt`, which
contains a list of all files installed in the system. To uninstall the
application those should be removed, for example by doing:
```
```sh
xargs rm < build/install_manifest.txt
```

16
data/CMakeLists.txt Normal file
View File

@ -0,0 +1,16 @@
find_program(SED sed)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
COMMAND ${SED} -e s|@LIBEXECDIR@|${CMAKE_INSTALL_FULL_LIBEXECDIR}| ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.timedate1.service.in > ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
MAIN_DEPENDENCY org.freedesktop.timedate1.service.in
VERBATIM)
add_custom_target(service ALL DEPENDS ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service)
install(FILES org.freedesktop.timedate1.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/interfaces)
install(FILES org.freedesktop.timedate1.policy
DESTINATION ${CMAKE_INSTALL_DATADIR}/polkit-1/actions)
install(FILES org.freedesktop.timedate1.conf
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d)
install(FILES ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/system-services)

10
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,10 @@
find_package(PkgConfig)
pkg_check_modules(GDBUS REQUIRED gio-2.0 dbus-1 glibmm-2.4)
add_executable(slack-timedate
slack-timedate.cpp slack-timedate.h
)
target_include_directories(slack-timedate PRIVATE ${GDBUS_INCLUDE_DIRS})
target_link_libraries(slack-timedate ${GDBUS_LIBRARIES})
install(TARGETS slack-timedate DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})