2 # Copyright (C) 2011, BMW AG
9 # @author: Christian Müller (christian.ei.mueller@bmw.de)
12 cmake_minimum_required(VERSION 2.6)
14 PROJECT(AudioManagerDeamon)
16 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
17 #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
18 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
21 ##todo only when dbus needed!
22 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
24 set(STD_INCLUDE_DIRS "/usr/include")
25 set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../dbusInterfaces)
26 set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../includes)
27 set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../dbusIncludes)
28 set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/include)
29 set(DOC_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/../doc/AudioManager)
30 set(EXECUTABLE_OUTPUT_PATH ../../bin/)
31 set(DOC_OUTPUT_PATH ../../doc/)
32 set(DOCUMENT $ENV{gendoc})
34 file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
36 FIND_PACKAGE(PkgConfig)
37 pkg_check_modules(SQLITE REQUIRED sqlite3)
38 pkg_check_modules(DLT REQUIRED automotive-dlt)
40 ##todo: only when dbus is reuqired !
41 find_package (Threads)
42 FIND_PACKAGE(DBUS REQUIRED)
44 file(GLOB AUDIOMAN_SRCS_CXX "src/*.cpp")
49 ${CMAKE_CURRENT_BINARY_DIR}
52 ${AUDIO_INCLUDES_FOLDER}
54 ${DBUS_ARCH_INCLUDE_DIR}
55 ${DBUS_INCLUDES_FOLDER}
58 ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX})
60 ##todo only when dbus is required
61 TARGET_LINK_LIBRARIES(AudioManager
65 ${CMAKE_THREAD_LIBS_INIT}
68 add_subdirectory (test)
70 #add a target to generate API documentation with Doxygen
74 configure_file(Doxyfile.in ${PROJECT_BINARY_DIR}/Doxyfile @ONLY IMMEDIATE)
75 add_custom_target (Docs ALL
76 COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
77 SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)