* [ GAM-6 ] enhace routing algorithm: changed the way the routing algorithm gets...
[profile/ivi/audiomanager.git] / AudioManagerDaemon / CMakeLists.txt
1 #GENIVI AUDIOMANAGER
2 #
3 #Copyright (C) 2011, BMW AG
4 #
5 #Datum  20.2.2012
6 #author Christian Mueller (christian.ei.mueller@bmw.de)
7 #
8 #***********************************************************************************************************
9 #LICENSE
10 #***********************************************************************************************************
11 #
12 #GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
13 #Copyright (C) 2011, BMW AG – Christian Mueller  Christian.ei.mueller@bmw.de
14 #
15 #This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
16 #This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
17 #You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
18 #Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
19 #Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
20 #As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
21 #Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
22 #
23
24 cmake_minimum_required(VERSION 2.6)
25
26 PROJECT(AudioManagerDeamon)
27
28 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
29 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
30
31 set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/AudioManager)
32 set(INCLUDES_FOLDER "include")
33
34 pkg_check_modules(SQLITE REQUIRED sqlite3)
35
36 IF(WITH_DBUS_WRAPPER)
37     FIND_PACKAGE(DBUS REQUIRED)
38 ENDIF(WITH_DBUS_WRAPPER)
39
40 SET(AUDIOMAN_SRCS_CXX
41     src/main.cpp
42     src/CommandReceiver.cpp
43     src/CommandSender.cpp
44     src/ControlReceiver.cpp
45     src/ControlSender.cpp
46     src/DatabaseHandler.cpp
47     src/DatabaseObserver.cpp
48     src/RoutingReceiver.cpp
49     src/RoutingSender.cpp
50     src/SocketHandler.cpp
51     src/TelnetServer.cpp
52     src/Router.cpp
53     src/DLTWrapper.cpp
54     src/CAmTelnetMenuHelper.cpp
55 )
56
57 IF(WITH_DBUS_WRAPPER)
58     SET (AUDIOMAN_SRCS_CXX
59         ${AUDIOMAN_SRCS_CXX}
60         src/DBusWrapper.cpp
61     )
62 ENDIF(WITH_DBUS_WRAPPER)
63
64 IF(WITH_SOCKETHANDLER_LOOP)
65     SET (AUDIOMAN_SRCS_CXX
66         ${AUDIOMAN_SRCS_CXX}
67         src/SocketHandler.cpp
68      )
69 ENDIF(WITH_SOCKETHANDLER_LOOP)
70
71 INCLUDE_DIRECTORIES(    
72         ${CMAKE_SOURCE_DIR} 
73         ${CMAKE_CURRENT_BINARY_DIR}
74         ${DLT_INCLUDE_DIRS}
75         ${AUDIO_INCLUDES_FOLDER}
76         ${INCLUDES_FOLDER}
77 )
78
79 IF(WITH_DBUS_WRAPPER)
80 INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
81     ${DBUS_ARCH_INCLUDE_DIR}
82     ${DBUS_INCLUDE_DIR}
83 )
84 ENDIF(WITH_DBUS_WRAPPER)
85
86 ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX})
87
88 IF(WITH_DBUS_WRAPPER)
89 TARGET_LINK_LIBRARIES(AudioManager 
90         ${SQLITE_LIBRARIES}
91         ${DLT_LIBRARIES}
92         ${DBUS_LIBRARY}
93 )
94 ELSE(WITH_DBUS_WRAPPER)
95     TARGET_LINK_LIBRARIES(AudioManager 
96         ${SQLITE_LIBRARIES}
97         ${DLT_LIBRARIES}
98 )
99 ENDIF(WITH_DBUS_WRAPPER)
100
101 IF(WITH_TESTS)
102         add_subdirectory (test)
103 ENDIF(WITH_TESTS)
104
105 #IF(WITH_DOCUMENTATION)
106 #       file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
107 #       configure_file(${DOXY_FILE}  ${DOC_OUTPUT_PATH}/Doxyfile  @ONLY IMMEDIATE)
108 #       add_custom_target (Docs ALL 
109 #               COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
110 #               SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
111 #       )
112 #ENDIF(WITH_DOCUMENTATION)
113
114 INSTALL(TARGETS AudioManager 
115         RUNTIME 
116         DESTINATION bin
117         PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
118         COMPONENT bin
119 )
120
121 INSTALL(DIRECTORY "${AUDIO_INCLUDES_FOLDER}/" 
122         DESTINATION include
123         COMPONENT dev
124 )
125
126 SET(ADD_DEPEND "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)")
127 set_property(GLOBAL APPEND PROPERTY bin_prop "${ADD_DEPEND}")
128
129 SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)")
130 set_property(GLOBAL APPEND PROPERTY dev_prop "${ADD_DEPEND}")
131