DBus interface in order to connect DBus applications to the p≡p engine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.8 KiB

9 months ago
9 months ago
9 months ago
9 months ago
  1. project(pEpDBusAdapter)
  2. option(BUILD_PLAIN_IMPLEMENTATION "Build basic DBus C++" ON)
  3. include_directories(${PROJECT_SOURCE_DIR}/types)
  4. ############################ Server glue ###########################
  5. add_custom_command(
  6. OUTPUT ${PROJECT_BINARY_DIR}/pep-server-glue.h
  7. COMMAND /usr/bin/dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml --adaptor=${PROJECT_BINARY_DIR}/pep-server-glue.h
  8. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml
  9. PRE_BUILD
  10. VERBATIM
  11. )
  12. set_source_files_properties(${PROJECT_BINARY_DIR}/pep-server-glue.h PROPERTIES GENERATED TRUE)
  13. #######################
  14. ############################ Client glue ###########################
  15. add_custom_command(
  16. OUTPUT ${PROJECT_BINARY_DIR}/pep-client-glue.h
  17. COMMAND /usr/bin/dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml --proxy=${PROJECT_BINARY_DIR}/pep-client-glue.h
  18. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml
  19. PRE_BUILD
  20. VERBATIM
  21. )
  22. set_source_files_properties(${PROJECT_BINARY_DIR}/pep-client-glue.h PROPERTIES GENERATED TRUE)
  23. #######################
  24. if(BUILD_PLAIN_IMPLEMENTATION)
  25. add_library(pEpDBusAdapterClient SHARED pep-client.cpp ${PROJECT_BINARY_DIR}/pep-client-glue.h)
  26. target_link_libraries(pEpDBusAdapterClient
  27. pEpEngine
  28. pEpAdapter
  29. dbus-c++-1
  30. sequoia_ffi
  31. sequoia_openpgp_ffi
  32. )
  33. set_target_properties(pEpDBusAdapterClient PROPERTIES
  34. CXX_VISIBILITY_PRESET default
  35. VISIBILITY_INLINES_HIDDEN 0
  36. )
  37. add_library(pEpDBusAdapter SHARED pep-dbus-adapter.cpp ${PROJECT_BINARY_DIR}/pep-server-glue.h)
  38. target_link_libraries(pEpDBusAdapter
  39. pEpEngine
  40. pEpAdapter
  41. pEpMIME
  42. dbus-c++-1
  43. sequoia_ffi
  44. sequoia_openpgp_ffi
  45. )
  46. set_target_properties(pEpDBusAdapter PROPERTIES
  47. CXX_VISIBILITY_PRESET default
  48. VISIBILITY_INLINES_HIDDEN 0
  49. )
  50. add_library(pEpDBusAdapterServer SHARED pep-server.cpp)
  51. target_link_libraries(pEpDBusAdapterServer
  52. pEpDBusAdapter
  53. pEpAdapter
  54. pEpEngine
  55. dbus-c++-1
  56. sequoia_ffi
  57. sequoia_openpgp_ffi
  58. )
  59. set_target_properties(pEpDBusAdapterServer PROPERTIES
  60. CXX_VISIBILITY_PRESET default
  61. VISIBILITY_INLINES_HIDDEN 0
  62. )
  63. add_executable(pep-dbus-server server.cpp)
  64. target_link_libraries(pep-dbus-server
  65. pEpDBusAdapter
  66. pEpDBusAdapterServer
  67. pEpEngine
  68. dbus-c++-1
  69. sequoia_ffi
  70. sequoia_openpgp_ffi
  71. )
  72. add_executable(tests tests.cpp)
  73. target_link_libraries(tests
  74. pEpEngine
  75. pEpDBusAdapterClient
  76. dbus-c++-1
  77. sequoia_ffi
  78. sequoia_openpgp_ffi
  79. )
  80. configure_file(security.pep.service.in ${CMAKE_CURRENT_BINARY_DIR}/security.pep.service)
  81. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/security.pep.service
  82. DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
  83. install(TARGETS pep-dbus-server pEpDBusAdapterClient pEpDBusAdapterServer)
  84. endif(BUILD_PLAIN_IMPLEMENTATION)