summaryrefslogtreecommitdiff
path: root/PluginRoutingInterfaceDbus/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'PluginRoutingInterfaceDbus/CMakeLists.txt')
-rw-r--r--PluginRoutingInterfaceDbus/CMakeLists.txt78
1 files changed, 27 insertions, 51 deletions
diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
index 54f8e86..cfac03b 100644
--- a/PluginRoutingInterfaceDbus/CMakeLists.txt
+++ b/PluginRoutingInterfaceDbus/CMakeLists.txt
@@ -1,79 +1,55 @@
cmake_minimum_required(VERSION 2.6)
-PROJECT(AudioManagerDeamon)
+PROJECT(PluginRoutingInterfaceDbus)
-set(CMAKE_CXX_FLAGS "-g -pipe -fPIC -Wall -W -D_REENTRANT")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker -export-dynamic")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
+set(CMAKE_CXX_FLAGS "-g -pipe -g -Wall -W -D_REENTRANT")
+
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
set(STD_INCLUDE_DIRS "/usr/include")
set(EXECUTABLE_OUTPUT_PATH ../../bin/)
-set(LIBRARY_OUTPUT_PATH ../plugins)
-set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../dbusInterfaces)
+set(LIBRARY_OUTPUT_PATH ../plugins/routing)
set(DOC_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/../doc/DBusPlugin)
-set(DOCUMENT $ENV{gendoc})
-cmake_policy(SET CMP0015 NEW)
+find_package (Threads)
+FIND_PACKAGE(DBUS REQUIRED)
+FIND_PACKAGE(PkgConfig)
+pkg_check_modules(DLT REQUIRED automotive-dlt)
-file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
-FIND_PACKAGE(Qt4 REQUIRED)
+set(DOCUMENT $ENV{gendoc})
+
+file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${STD_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
- ${DBUS_FOLDER}
+ ${DBUS_INCLUDE_DIR}
+ ${DBUS_ARCH_INCLUDE_DIR}
../AudioManagerDaemon
)
-# add Qt modules here, the include will setup QT_LIBRARIES
-
-# defines for QL Plugins
-ADD_DEFINITIONS(${QT_DEFINITIONS})
-ADD_DEFINITIONS(-DQT_STATICPLUGIN)
-ADD_DEFINITIONS(-DQT_PLUGIN)
-ADD_DEFINITIONS(-DQT_SHARED)
-
-
-INCLUDE(${QT_USE_FILE})
-
# all source files go here
SET(PLUGINDBUS_SRCS_CXX
- DBusInterface.cpp
- RoutingSend.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/DBusSend.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/DBusInterfaceAdaptor.cpp
-)
-
-# every header that contains QT stuff like Q_OBJECT .... and must be mocced
-SET(PLUGINDBUS_MOC_SRCS
- DBusInterface.h
- RoutingSend.h
- ${CMAKE_CURRENT_BINARY_DIR}/DBusSend.h
- ${CMAKE_CURRENT_BINARY_DIR}/DBusInterfaceAdaptor.h
+ DbusInterface.cpp
+ DBUSIntrospection.cpp
+ DBUSMessageHandler.cpp
+ AudiomanagerInterface.cpp
+ DbusSend.cpp
)
-#now take the headers, moc them and append the resulting moc files to the sources
-QT4_WRAP_CPP(PLUGINDBUS_SRCS_CXX ${PLUGINDBUS_MOC_SRCS})
+add_library(PluginRoutingInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
-add_library(RoutingPlugin ${PLUGINDBUS_SRCS_CXX})
-
-TARGET_LINK_LIBRARIES(RoutingPlugin
- ${QT_LIBRARIES}
-)
-
-add_custom_command(
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DBusInterfaceAdaptor.h ${CMAKE_CURRENT_BINARY_DIR}/DBusInterfaceAdaptor.cpp
- COMMAND qdbusxml2cpp ARGS -c DBusInterfaceAdaptor -a DBusInterfaceAdaptor.h:DBusInterfaceAdaptor.cpp ${DBUS_FOLDER}/DBusReceive.xml
- MAIN_DEPENDENCY ${DBUS_FOLDER}/DBusReceive.xml
+TARGET_LINK_LIBRARIES(PluginRoutingInterfaceDbus
+ ${DLT_LIBRARIES}
+ ${DBUS_LIBRARY}
+ ${CMAKE_THREAD_LIBS_INIT}
)
-add_custom_command(
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DBusSend.h ${CMAKE_CURRENT_BINARY_DIR}/DBusSend.cpp
- COMMAND qdbusxml2cpp ARGS -v -c DBusSend -p DBusSend.h:DBusSend.cpp ${DBUS_FOLDER}/DBusSend.xml
- MAIN_DEPENDENCY ${DBUS_FOLDER}/DBusSend.xml
-)
#add a target to generate API documentation with Doxygen
find_package(Doxygen)