diff options
author | Aleksandar Donchev <Aleksander.Donchev@partner.bmw.de> | 2014-02-12 14:57:34 +0100 |
---|---|---|
committer | Christian Linke <christian.linke@bmw.de> | 2014-03-28 16:48:02 +0100 |
commit | 0717ec147195b11fdf23f8326211b97b6ac9b283 (patch) | |
tree | 5d50dabaf8086ac17802fc6c8c4872b783065095 /PluginRoutingInterfaceCAPI | |
parent | 0360f3d41beb1f66bfbfddf16a9727f4368b75f5 (diff) | |
download | audiomanager-0717ec147195b11fdf23f8326211b97b6ac9b283.tar.gz |
* Support for automatically generation of common-api sources. Cmake macros adopted to support the common-api generator.
Signed-off-by: Christian Linke <christian.linke@bmw.de>
Diffstat (limited to 'PluginRoutingInterfaceCAPI')
-rw-r--r-- | PluginRoutingInterfaceCAPI/CMakeLists.txt | 16 | ||||
-rw-r--r-- | PluginRoutingInterfaceCAPI/test/CMakeLists.txt | 24 |
2 files changed, 23 insertions, 17 deletions
diff --git a/PluginRoutingInterfaceCAPI/CMakeLists.txt b/PluginRoutingInterfaceCAPI/CMakeLists.txt index e304049..c7b9594 100644 --- a/PluginRoutingInterfaceCAPI/CMakeLists.txt +++ b/PluginRoutingInterfaceCAPI/CMakeLists.txt @@ -43,7 +43,16 @@ set(ROUTING_INTERFACE_DBUS_CONF ${ROUTING_INTERFACE_DBUS_CONF} PARENT_SCOPE) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/configRoutingCAPI.h ) FIND_PACKAGE(CommonAPI REQUIRED) -FIND_PACKAGE(CommonAPI_DBus REQUIRED) + +# Find the common-api sources. +# The sources can be placed in the build directory (DESTINATION) or in the source tree (ALT_DESTINATION). +# The ALT_DESTINATION is used as fall back if the DESTINATION directory dosen't contain the sources or you just don't want to use the generator. +INCLUDE(CommonAPIGenerator) +COMMON_API_GENERATE_SOUCRES(TARGET COMMON_API_ROUTING_INTERFACE + FIDLS fidl/RoutingInterface.fidl # a list with fidls + DESTINATION src-gen # a relative path to the build directory or an absolute path + ALT_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/src-gen # an alternative relative/absolute path with common-api sources, usually in the source tree + DBUS) INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} @@ -52,13 +61,12 @@ INCLUDE_DIRECTORIES( ${PROJECT_INCLUDE_FOLDER} ${COMMON_API_INCLUDE_DIRS} ${COMMON_API_DBUS_INCLUDE_DIRS} - ${COMMON_API_GEN_INCLUDE_DIR} + ${COMMON_API_ROUTING_INTERFACE_GEN_INCLUDE_DIR} ${INCLUDE_FOLDER} ) # all source files go here -file(GLOB PLUGINCAPI_SRCS_CXX "src/*.cpp" ${COMMON_API_GEN_SOURCES}) - +file(GLOB PLUGINCAPI_SRCS_CXX "src/*.cpp" ${COMMON_API_ROUTING_INTERFACE_GEN_SOURCES}) add_library(PluginRoutingInterfaceCAPI MODULE ${PLUGINCAPI_SRCS_CXX}) diff --git a/PluginRoutingInterfaceCAPI/test/CMakeLists.txt b/PluginRoutingInterfaceCAPI/test/CMakeLists.txt index 86bbde6..9803dc5 100644 --- a/PluginRoutingInterfaceCAPI/test/CMakeLists.txt +++ b/PluginRoutingInterfaceCAPI/test/CMakeLists.txt @@ -30,8 +30,8 @@ set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH}) FIND_PACKAGE(Threads) FIND_PACKAGE(PkgConfig) FIND_PACKAGE(PythonLibs REQUIRED) -pkg_check_modules(PC_COMMON REQUIRED CommonAPI) -pkg_check_modules(PC_COMMON_DBUS REQUIRED CommonAPI-DBus) +FIND_PACKAGE(CommonAPI REQUIRED) + IF(WITH_DLT) pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0) @@ -44,8 +44,9 @@ INCLUDE_DIRECTORIES( ${AUDIO_INCLUDE_FOLDER} ${CMAKE_SOURCE_DIR} ${DLT_INCLUDE_DIRS} - ${PC_COMMON_INCLUDE_DIRS} - ${PC_COMMON_DBUS_INCLUDE_DIRS} + ${COMMON_API_INCLUDE_DIRS} + ${COMMON_API_DBUS_INCLUDE_DIRS} + ${COMMON_API_GEN_INCLUDE_DIR} ${INCLUDE_FOLDER} ${PYTHON_INCLUDE_DIRS} ${GOOGLE_TEST_INCLUDE_DIR} @@ -56,8 +57,8 @@ INCLUDE_DIRECTORIES( link_directories( ${LINK_DIRECTORIES} - ${PC_COMMON_LIBRARY_DIRS} - ${PC_COMMON_DBUS_LIBRARY_DIRS} + ${COMMON_API_LIBRARY_DIRS} + ${COMMON_API_DBUS_LIBRARY_DIRS} ) file(GLOB CAPI_PLUGIN_INTERFACE_SRCS_CXX @@ -70,10 +71,7 @@ file(GLOB CAPI_PLUGIN_INTERFACE_SRCS_CXX "CAmCommandSenderCommon.cpp" "CAmRoutingSenderService.cpp" "IAmRoutingSenderBackdoor.cpp" -) - -file(GLOB_RECURSE CAPI_PLUGIN_INTERFACE_GEN_SRCS_CXX - "../src-gen/*.cpp" + ${COMMON_API_ROUTING_INTERFACE_GEN_SOURCES} ) set (CAPI_SENDER_INTERFACE "org.genivi.audiomanager.routingsender") @@ -93,7 +91,7 @@ set (CAPI_ROUTING_INSTANCE_H "\"${CAPI_ROUTING_INSTANCE}\"") set (CAPI_ROUTING_PATH_H "\"${CAPI_ROUTING_PATH}\"") -ADD_EXECUTABLE(AmRoutingInterfaceCAPITests ${CAPI_PLUGIN_INTERFACE_SRCS_CXX} ${CAPI_PLUGIN_INTERFACE_GEN_SRCS_CXX}) +ADD_EXECUTABLE(AmRoutingInterfaceCAPITests ${CAPI_PLUGIN_INTERFACE_SRCS_CXX}) TARGET_LINK_LIBRARIES(AmRoutingInterfaceCAPITests ${DLT_LIBRARIES} @@ -101,8 +99,8 @@ TARGET_LINK_LIBRARIES(AmRoutingInterfaceCAPITests ${CMAKE_THREAD_LIBS_INIT} ${PYTHON_LIBRARY} ${PC_GSTREAMER_LIBRARIES} - ${PC_COMMON_LIBRARIES} - ${PC_COMMON_DBUS_LIBRARIES} + ${COMMON_API_LIBRARIES} + ${COMMON_API_DBUS_LIBRARIES} gtest gmock ) |