* fix list domains in telnetserver
[profile/ivi/audiomanager.git] / AudioManagerDaemon / CMakeLists.txt
1  #
2  #  Copyright (C) 2011, BMW AG 
3  # 
4  # AudioManagerDeamon
5  #
6  # @file CMakeLists.txt
7  #
8  # @date: 20.05.2011
9  # @author: Christian Müller (christian.ei.mueller@bmw.de)
10  #
11
12 cmake_minimum_required(VERSION 2.6)
13
14 PROJECT(AudioManagerDeamon)
15
16 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
17 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
18
19 set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/AudioManager)
20 set(INCLUDES_FOLDER "include")
21
22 pkg_check_modules(SQLITE REQUIRED sqlite3)
23
24 IF(WITH_DBUS_WRAPPER)
25     FIND_PACKAGE(DBUS REQUIRED)
26 ENDIF(WITH_DBUS_WRAPPER)
27
28 SET(AUDIOMAN_SRCS_CXX
29     src/main.cpp
30     src/CommandReceiver.cpp
31     src/CommandSender.cpp
32     src/ControlReceiver.cpp
33     src/ControlSender.cpp
34     src/DatabaseHandler.cpp
35     src/DatabaseObserver.cpp
36     src/RoutingReceiver.cpp
37     src/RoutingSender.cpp
38     src/SocketHandler.cpp
39     src/TelnetServer.cpp
40     src/Router.cpp
41     src/DLTWrapper.cpp
42     src/CAmTelnetMenuHelper.cpp
43 )
44
45 IF(WITH_DBUS_WRAPPER)
46     SET (AUDIOMAN_SRCS_CXX
47         ${AUDIOMAN_SRCS_CXX}
48         src/DBusWrapper.cpp
49     )
50 ENDIF(WITH_DBUS_WRAPPER)
51
52 IF(WITH_SOCKETHANDLER_LOOP)
53     SET (AUDIOMAN_SRCS_CXX
54         ${AUDIOMAN_SRCS_CXX}
55         src/SocketHandler.cpp
56      )
57 ENDIF(WITH_SOCKETHANDLER_LOOP)
58
59 INCLUDE_DIRECTORIES(    
60         ${CMAKE_SOURCE_DIR} 
61         ${CMAKE_CURRENT_BINARY_DIR}
62         ${DLT_INCLUDE_DIRS}
63         ${AUDIO_INCLUDES_FOLDER}
64         ${INCLUDES_FOLDER}
65 )
66
67 IF(WITH_DBUS_WRAPPER)
68 INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
69     ${DBUS_ARCH_INCLUDE_DIR}
70     ${DBUS_INCLUDE_DIR}
71 )
72 ENDIF(WITH_DBUS_WRAPPER)
73
74 ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX})
75
76 IF(WITH_DBUS_WRAPPER)
77 TARGET_LINK_LIBRARIES(AudioManager 
78         ${SQLITE_LIBRARIES}
79         ${DLT_LIBRARIES}
80         ${DBUS_LIBRARY}
81 )
82 ELSE(WITH_DBUS_WRAPPER)
83     TARGET_LINK_LIBRARIES(AudioManager 
84         ${SQLITE_LIBRARIES}
85         ${DLT_LIBRARIES}
86 )
87 ENDIF(WITH_DBUS_WRAPPER)
88
89 IF(WITH_TESTS)
90         add_subdirectory (test)
91 ENDIF(WITH_TESTS)
92
93 #IF(WITH_DOCUMENTATION)
94 #       file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
95 #       configure_file(${DOXY_FILE}  ${DOC_OUTPUT_PATH}/Doxyfile  @ONLY IMMEDIATE)
96 #       add_custom_target (Docs ALL 
97 #               COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
98 #               SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
99 #       )
100 #ENDIF(WITH_DOCUMENTATION)
101
102 INSTALL(TARGETS AudioManager 
103         RUNTIME 
104         DESTINATION bin
105         PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
106         COMPONENT bin
107 )
108
109 INSTALL(DIRECTORY "${AUDIO_INCLUDES_FOLDER}/" 
110         DESTINATION include
111         COMPONENT dev
112 )
113
114 SET(ADD_DEPEND "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)")
115 set_property(GLOBAL APPEND PROPERTY bin_prop "${ADD_DEPEND}")
116
117 SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)")
118 set_property(GLOBAL APPEND PROPERTY dev_prop "${ADD_DEPEND}")
119