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.
 

55 lines
2.2 KiB

project(pEpDBusAdapter)
string( REPLACE "fno-exceptions" "fexceptions" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string( REPLACE "fno-exceptions" "fexceptions" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
include_directories(${PROJECT_SOURCE_DIR}/types)
############################ Server glue ###########################
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/pep-server-glue.h
COMMAND /usr/bin/dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml --adaptor=${PROJECT_BINARY_DIR}/pep-server-glue.h
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml
PRE_BUILD
VERBATIM
)
set_source_files_properties(${PROJECT_BINARY_DIR}/pep-server-glue.h PROPERTIES GENERATED TRUE)
#######################
############################ Client glue ###########################
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/pep-client-glue.h
COMMAND /usr/bin/dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml --proxy=${PROJECT_BINARY_DIR}/pep-client-glue.h
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/pep-introspect.xml
PRE_BUILD
VERBATIM
)
set_source_files_properties(${PROJECT_BINARY_DIR}/pep-client-glue.h PROPERTIES GENERATED TRUE)
#######################
add_library(pEpDBusAdapterClient SHARED pep-client.cpp ${PROJECT_BINARY_DIR}/pep-client-glue.h)
target_link_libraries(pEpDBusAdapterClient pEpEngine dbus-c++-1)
set_target_properties(pEpDBusAdapterClient PROPERTIES
CXX_VISIBILITY_PRESET default
VISIBILITY_INLINES_HIDDEN 0
)
add_library(pEpDBusAdapterServer SHARED pep-server.cpp ${PROJECT_BINARY_DIR}/pep-server-glue.h)
target_link_libraries(pEpDBusAdapterServer pEpEngine pEpMIME dbus-c++-1)
set_target_properties(pEpDBusAdapterServer PROPERTIES
CXX_VISIBILITY_PRESET default
VISIBILITY_INLINES_HIDDEN 0
)
add_executable(pep-dbus-server server.cpp)
target_link_libraries(pep-dbus-server pEpDBusAdapterServer dbus-c++-1 sequoia_ffi sequoia_openpgp_ffi)
add_executable(tests tests.cpp)
target_link_libraries(tests pEpDBusAdapterClient dbus-c++-1 sequoia_ffi sequoia_openpgp_ffi)
configure_file(security.pep.service.in ${CMAKE_CURRENT_BINARY_DIR}/security.pep.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/security.pep.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
install(TARGETS pep-dbus-server pEpDBusAdapterServer)