stevenrwalter

Untitled

Dec 9th, 2016
10,764
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 2.03 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.5)
  2. include(GNUInstallDirs)
  3. project(timemanager)
  4.  
  5. add_definitions( -Wall -Werror )
  6.  
  7. set(TIMEMGR_WRITABLE_DIR "/var/fs/shared/settings/timemanager" CACHE STRING "Writable data directory")
  8. set(TIMEMGR_ZONEINFO_DIR "/var/fs/shared/zoneinfo" CACHE STRING "Custom timezone directory")
  9. set(TIMEMGR_ZONEINFO_FILE "${TIMEMGR_ZONEINFO_DIR}/Lexmark_Custom" CACHE STRING "Custom timezone file")
  10. set(TIMEMGR_VALIDTIME_FILE "${TIMEMGR_WRITABLE_DIR}/lastvalidtime" CACHE STRING "Last valid time file")
  11. configure_file(foo.h.in foo.h @ONLY)
  12. include_directories(${CMAKE_CURRENT_BINARY_DIR})
  13.  
  14. find_package(PkgConfig)
  15. pkg_check_modules(LIBSYSTEMD REQUIRED libsystemd)
  16. pkg_check_modules(GLIB REQUIRED glib-2.0)
  17. pkg_check_modules(GIO REQUIRED gio-2.0)
  18. pkg_check_modules(REMOTEOBJECTS REQUIRED remoteobjects)
  19. pkg_check_modules(REMOTESETTINGS REQUIRED remotesettings)
  20. pkg_check_modules(SETTINGSAPI REQUIRED settingsapi)
  21. pkg_check_modules(STATUSAPI REQUIRED statusapi)
  22. include_directories( ${LIBSYSTEMD_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS} ${REMOTEOBJECTS_INCLUDE_DIRS} ${REMOTESETTINGS_INCLUDE_DIRS} ${SETTINGSAPI_INCLUDE_DIRS} ${STATUSAPI_INCLUDE_DIRS} )
  23. link_directories( ${LIBSYSTEMD_LIBRARY_DIRS} ${GLIB_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS} ${REMOTEOBJECTS_LIBRARY_DIRS} ${REMOTESETTINGS_LIBRARY_DIRS} ${SETTINGSAPI_LIBRARY_DIRS} ${STATUSAPI_LIBRARY_DIRS} )
  24.  
  25. add_executable(validate_zoneinfo validate_zoneinfo.c)
  26. add_executable(timemgrd
  27.     timemgrd.c
  28.     timemgr_cache.c
  29.     timemgr_chrony.c
  30.     timemgr_dbus.c
  31.     timemgr_rob.c
  32.     tzfile.c
  33.     zoneinfo.c )
  34. target_link_libraries(timemgrd
  35.     ${LIBSYSYTEMD_LIBRARIES}
  36.     ${GLIB_LIBRARIES}
  37.     ${GIO_LIBRARIES}
  38.     ${REMOTESETTINGS_LIBRARIES}
  39.     ${REMOTEOBJECTS_LIBRARIES}
  40.     ${STATUSAPI_LIBRARIES}
  41. add_library(settings_timemgr timemgr_settings.c)
  42. install(TARGETS validate_zoneinfo timemgrd settings_timemgr
  43.     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  44.     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/settings )
  45. install(FILES timemgr.service DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system)
Advertisement