* Bug 61 fixed. The plugins are built as module and SOVERSION is removed.
[profile/ivi/genivi/genivi-audio-manager.git] / PluginRoutingInterfaceAsync / CMakeLists.txt
1 # Copyright (c) 2012 BMW
2 #
3 # author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
4 #
5 # copyright
6 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
7 # including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
8 # subject to the following conditions:
9 # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
12 # THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 #
14 # For further information see http://www.genivi.org/.
15 #
16 cmake_minimum_required(VERSION 2.6)
17
18 PROJECT(PluginRoutingInterfaceAsync)
19
20 OPTION (WITH_ROUTING_INTERFACE_ASYNC
21         "build with routing interface async plugin" ON)
22         
23 IF (WITH_ROUTING_INTERFACE_ASYNC)
24
25 set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
26 set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingAsync)
27 set(INCLUDE_FOLDER "include")
28
29 FILE(READ "${AUDIO_INCLUDE_FOLDER}/routing/IAmRoutingSend.h" VERSION_BUFFER LIMIT 6000)
30 STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
31 STRING(REGEX REPLACE "RoutingSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
32 MESSAGE(STATUS "Building against routing interface version ${LIB_INTERFACE_VERSION}")
33
34 find_package( Threads )
35 FIND_PACKAGE(DBUS REQUIRED)
36
37 INCLUDE_DIRECTORIES(
38         ${CMAKE_SOURCE_DIR} 
39         ${CMAKE_CURRENT_BINARY_DIR}
40         ${AUDIO_INCLUDE_FOLDER}
41         ${PROJECT_INCLUDE_FOLDER}
42         ${INCLUDE_FOLDER}
43         ${DBUS_INCLUDE_DIR}
44     ${DBUS_ARCH_INCLUDE_DIR}
45 )
46
47 # all source files go here
48 file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
49
50
51 add_library(PluginRoutingInterfaceAsync MODULE ${PLUGINDBUS_SRCS_CXX})
52
53 TARGET_LINK_LIBRARIES(PluginRoutingInterfaceAsync
54     ${DLT_LIBRARIES}
55     ${DBUS_LIBRARY}
56     ${CMAKE_THREAD_LIBS_INIT}
57 )
58
59 IF(WITH_TESTS)
60         add_subdirectory (test)
61 ENDIF(WITH_TESTS)
62
63 #IF(WITH_DOCUMENTATION)
64 #       file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
65 #       configure_file(${DOXY_FILE}  ${DOC_OUTPUT_PATH}/Doxyfile  @ONLY IMMEDIATE)
66 #       add_custom_target (PluginRoutingInterfaceAsyncDocs ALL 
67 #               COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
68 #               SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
69 #       )
70 #ENDIF(WITH_DOCUMENTATION)
71
72
73 INSTALL(TARGETS PluginRoutingInterfaceAsync 
74         DESTINATION "lib/${LIB_INSTALL_SUFFIX}/routing"
75         PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
76         COMPONENT sampleplugins
77 )
78
79 SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
80 set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
81
82 ENDIF (WITH_ROUTING_INTERFACE_ASYNC)