690c3a20b1fb9e0fb5a02f0e18976259b929797e
[profile/ivi/genivi/genivi-audio-manager.git] / PluginCommandInterfaceDbus / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 PROJECT(PluginCommandInterfaceDbus)
4
5 #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker -export-dynamic")
6 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
7 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pipe -g -Wall -W -D_REENTRANT")
8
9
10 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
11
12 set(STD_INCLUDE_DIRS "/usr/include")
13 set(EXECUTABLE_OUTPUT_PATH ../../bin/)
14 set(LIBRARY_OUTPUT_PATH ../plugins/command)
15 set(DOC_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/../doc/CommandDBusPlugin)
16 set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../includes)
17 set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../dbusIncludes)
18 set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/include)
19
20 find_package (Threads)
21 FIND_PACKAGE(DBUS REQUIRED)
22 FIND_PACKAGE(PkgConfig)
23 pkg_check_modules(DLT REQUIRED automotive-dlt)
24
25
26 set(DOCUMENT $ENV{gendoc})
27
28 file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
29
30 INCLUDE_DIRECTORIES(
31         ${CMAKE_SOURCE_DIR} 
32         ${STD_INCLUDE_DIRS}
33         ${CMAKE_CURRENT_BINARY_DIR}
34         ${DBUS_INCLUDE_DIR}
35         ${DBUS_ARCH_INCLUDE_DIR}
36         ${AUDIO_INCLUDES_FOLDER}
37         ${INCLUDES_FOLDER}
38         ${DBUS_INCLUDES_FOLDER}
39 )
40
41 # all source files go here
42 file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
43
44 add_library(PluginCommandInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
45
46 TARGET_LINK_LIBRARIES(PluginCommandInterfaceDbus 
47         ${DLT_LIBRARIES}
48         ${DBUS_LIBRARY}
49         ${CMAKE_THREAD_LIBS_INIT}
50 )
51
52
53 #add a target to generate API documentation with Doxygen
54 find_package(Doxygen)
55 if(DOXYGEN_FOUND)
56 if(DOCUMENT)
57         configure_file(Doxyfile.in ${PROJECT_BINARY_DIR}/Doxyfile  @ONLY IMMEDIATE)
58         add_custom_target (Docs ALL 
59         COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
60         SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)
61 endif(DOCUMENT)
62 endif(DOXYGEN_FOUND)
63
64
65