summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2015-08-21 14:28:58 +0200
committerChristian Linke <Christian.Linke@bmw.de>2015-09-07 12:55:33 +0200
commitad8e89a7331340d1215cfec30032931f2f9d85a7 (patch)
tree9f92dd9dfe4c99ff413a98ac1b93b3f7697e3f63
parent4d3b532826eb4f86127499f1b29f9a5307c661d9 (diff)
downloadaudiomanager-ad8e89a7331340d1215cfec30032931f2f9d85a7.tar.gz
* FindDBus.cmake excluded from project and replaced throught pkg_check_module.
Signed-off-by: Christian Linke <christian.linke@bmw.de>
-rw-r--r--AudioManagerDaemon/CMakeLists.txt21
-rw-r--r--AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt5
-rw-r--r--AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp4
-rw-r--r--[-rwxr-xr-x]cmake/CommonAPI.cmake9
-rw-r--r--cmake/FindDBUS.cmake46
5 files changed, 22 insertions, 63 deletions
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index e818eaf..6ad0aff 100644
--- a/AudioManagerDaemon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
@@ -46,7 +46,7 @@ if (WITH_SYSTEMD_WATCHDOG)
endif (WITH_SYSTEMD_WATCHDOG)
if(WITH_DBUS_WRAPPER)
- find_package(DBUS REQUIRED)
+ pkg_check_modules (DBUS "dbus-1 >= 1.4")
endif(WITH_DBUS_WRAPPER)
if(WITH_CAPI_WRAPPER)
@@ -99,7 +99,7 @@ if(WITH_DBUS_WRAPPER)
set (AUDIOMAN_SRCS_CXX
${AUDIOMAN_SRCS_CXX}
"${AUDIOMANAGER_UTILITIES_SRC}/CAmDbusWrapper.cpp")
- set (AM_LINK_LIBS ${AM_LINK_LIBS} ${DBUS_LIBRARY})
+ set (AM_LINK_LIBS ${AM_LINK_LIBS} ${DBUS_LIBRARIES})
endif(WITH_DBUS_WRAPPER)
if(WITH_CAPI_WRAPPER)
@@ -108,7 +108,7 @@ if(WITH_CAPI_WRAPPER)
if(${COMMONAPI_USED_BINDING} EQUAL 0)
set (AM_LINK_LIBS ${AM_LINK_LIBS}
${CommonAPI-DBus_LIBRARY}
- ${DBUS_LIBRARY}
+ ${DBUS_LIBRARIES}
${CommonAPI_LIBRARY})
else()
set (AM_LINK_LIBS ${AM_LINK_LIBS}
@@ -156,14 +156,19 @@ INCLUDE_DIRECTORIES(
if(WITH_CAPI_WRAPPER)
if(WITH_NSM)
- COMMON_API_GENERATE_SOUCRES(
+ IF(${COMMONAPI_USED_BINDING} EQUAL 1)#SomeIP
+ SET(SRC_GEN src-gen/v${COMMONAPI_SOMEIP_VERSION_NUMBER}/someip)
+ ELSE()#Dbus
+ SET(SRC_GEN src-gen/v${COMMONAPI_DBUS_VERSION_NUMBER}/dbus)
+ ENDIF()
+ COMMON_API_GENERATE_SOURCES(
TARGET COMMON_API
# A list with fidls for the generic generator.
FIDLS_GENERIC fidls/NodeStateManager.fdepl
# A list with fidls for the binding generator.
FIDLS_BINDING fidls/NodeStateManager.fdepl
# A relative path to the build directory or an absolute path.
- DESTINATION src-gen
+ DESTINATION ${SRC_GEN}
# An alternative relative/absolute path with common-api sources, usually in the source tree.
ALT_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/src-gen
)
@@ -178,8 +183,7 @@ if(WITH_CAPI_WRAPPER)
${COMMONAPI_DBUS_INCLUDE_DIRS}
${COMMONAPI_INCLUDE_DIRS}
${COMMON_API_GEN_INCLUDE_DIR}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_DIR})
+ ${DBUS_INCLUDE_DIRS})
else()
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
${VSOMEIP_INCLUDE_DIRS}
@@ -199,8 +203,7 @@ endif(WITH_DLT)
if(WITH_DBUS_WRAPPER)
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_DIR})
+ ${DBUS_INCLUDE_DIRS})
endif(WITH_DBUS_WRAPPER)
ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX})
diff --git a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
index 9c2d1a2..12032ab 100644
--- a/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
+++ b/AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt
@@ -45,8 +45,7 @@ INCLUDE_DIRECTORIES(
${COMMONAPI_DBUS_INCLUDE_DIRS}
${COMMONAPI_INCLUDE_DIRS}
${COMMON_API_GEN_INCLUDE_DIR}
- ${DBUS_ARCH_INCLUDE_DIR}
- ${DBUS_INCLUDE_DIR}
+ ${DBUS_INCLUDE_DIRS}
)
if(WITH_DLT)
@@ -80,7 +79,7 @@ TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorCAPITest
${PYTHON_LIBRARY}
${CommonAPI-DBus_LIBRARY}
${CommonAPI_LIBRARY}
- ${DBUS_LIBRARY}
+ ${DBUS_LIBRARIES}
gtest
gmock
)
diff --git a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
index 2e539d3..8412a71 100644
--- a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
@@ -62,11 +62,12 @@ CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler):
#if COMMONAPI_VERSION_NUMBER < 300
mRuntime = CommonAPI::Runtime::load();
#else
+ CommonAPI::Runtime::setProperty("LogContext", "AMCAPI");
mRuntime = CommonAPI::Runtime::get();
#endif
assert(NULL!=mRuntime);
-//Create the context
+ //Create the context
mContext = std::make_shared<CommonAPI::MainLoopContext>();
assert(NULL!=mContext);
@@ -74,6 +75,7 @@ CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler):
mFactory = runtime->createFactory(mContext);
assert(mFactory);
#else
+ logInfo("CommonAPI runtime has been loaded! Default Binding is", mRuntime->getDefaultBinding());
#if COMMONAPI_USED_BINDING > 0
mFactory = CommonAPI::SomeIP::Factory::get();
assert(mFactory);
diff --git a/cmake/CommonAPI.cmake b/cmake/CommonAPI.cmake
index 45c1078..a97d75c 100755..100644
--- a/cmake/CommonAPI.cmake
+++ b/cmake/CommonAPI.cmake
@@ -46,7 +46,7 @@ MACRO(LOAD_COMMONAPI)
IF(${COMMONAPI_USED_BINDING} EQUAL 1)
IF(NOT CommonAPI-SomeIP_FOUND)
FIND_PACKAGE (vsomeip REQUIRED)
- FIND_PACKAGE(CommonAPI-SomeIP REQUIRED CONFIG NO_CMAKE_PACKAGE_REGISTRY)
+ FIND_PACKAGE(CommonAPI-SomeIP REQUIRED)
FIND_LIBRARY(CommonAPI-SomeIP_LIBRARY
REQUIRED
NAMES CommonAPI-SomeIP
@@ -54,6 +54,7 @@ MACRO(LOAD_COMMONAPI)
"/usr/local/lib"
"/usr/lib"
)
+
ENDIF(NOT CommonAPI-SomeIP_FOUND)
message(STATUS "CommonAPI-SomeIP Version: ${CommonAPI-SomeIP_VERSION}")
@@ -62,8 +63,8 @@ MACRO(LOAD_COMMONAPI)
ELSE()
SET(COMMONAPI_USED_BINDING 0 CACHE INTERNAL "hide this!" FORCE)
IF(NOT CommonAPI-DBus_FOUND)
- FIND_PACKAGE(DBUS REQUIRED)
- FIND_PACKAGE(CommonAPI-DBus REQUIRED CONFIG NO_CMAKE_PACKAGE_REGISTRY)
+ pkg_check_modules (DBUS "dbus-1 >= 1.4" REQUIRED)
+ FIND_PACKAGE(CommonAPI-DBus REQUIRED)
FIND_LIBRARY(CommonAPI-DBus_LIBRARY
REQUIRED
NAMES CommonAPI-DBus
@@ -235,7 +236,7 @@ ENDMACRO(EXECUTE_GENERATOR)
# FIDLS_BINDING a list with fidls for the binding generator.
# DESTINATION a relative path to the build directory or an absolute path.
# ALT_DESTINATION an alternative relative/absolute path with common-api sources, usually in the source tree.
-FUNCTION(COMMON_API_GENERATE_SOUCRES)
+FUNCTION(COMMON_API_GENERATE_SOURCES)
#parse the input parameters
set(options "")
set(oneValueArgs TARGET DESTINATION ALT_DESTINATION HEADER_TEMPLATE)
diff --git a/cmake/FindDBUS.cmake b/cmake/FindDBUS.cmake
deleted file mode 100644
index a6eaae3..0000000
--- a/cmake/FindDBUS.cmake
+++ /dev/null
@@ -1,46 +0,0 @@
-############################################################################
-#
-# Copyright 2010, 2011 BMW Car IT GmbH
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-############################################################################
-
-FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h
- PATHS "/usr/include/dbus-1.0")
-
-FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h
-PATHS "/usr/lib/dbus-1.0/include"
- "/usr/lib/*/dbus-1.0/include"
-)
-
-FIND_LIBRARY(DBUS_LIBRARY
-NAMES dbus-1
-PATHS "/usr/lib"
-)
-
-SET( DBUS_FOUND "NO" )
-IF(DBUS_LIBRARY)
- SET( DBUS_FOUND "YES" )
- message(STATUS "Found DBUS libs: ${DBUS_LIBRARY}")
- message(STATUS "Found DBUS include: ${DBUS_INCLUDE_DIR}")
- message(STATUS "Found DBUS arch dependent include: ${DBUS_ARCH_INCLUDE_DIR}")
-ENDIF(DBUS_LIBRARY)
-
-MARK_AS_ADVANCED(
- DBUS_INCLUDE_DIR
- DBUS_ARCH_INCLUDE_DIR
- DBUS_LIBRARY
-)
-