summaryrefslogtreecommitdiff
path: root/src/components/hmi_message_handler
diff options
context:
space:
mode:
authorIvo Stoilov (GitHub) <istoilov@luxoft.com>2016-12-30 17:47:39 +0200
committerIvo Stoilov (GitHub) <istoilov@luxoft.com>2017-01-12 18:36:30 +0200
commit1c58e66069fe65a94234e322cd76051e0aaa30e2 (patch)
treec53ae86a4bea52ef5c75f988a4961b8f579229fd /src/components/hmi_message_handler
parent7063ed619c92d795a46f221fc9935a2249e65bf2 (diff)
downloadsdl_core-1c58e66069fe65a94234e322cd76051e0aaa30e2.tar.gz
Refactor CMake files
Merge components refactoring from Windows port barnch - add cmake tools - refactor protocol handler CMakeLists.txt file - refactor interfaces CMakeLists.txt file - refactor smart object CMakeLists.txt file - refactor formatters CMakeLists.txt file - refactor config profile CMakeLists.txt file - refactor policy CMakeLists.txt file - refactor resumption CMakeLists.txt file - refactor connection handler CMakeLists.txt file - refactor application manager CMakeLists.txt file - refactor security manager CMakeLists.txt file - refactor dbus CMakeLists.txt file - refactor hmi message handler CMakeLists.txt file - refactor transport manager CMakeLists.txt file - refactor utils CMakeLists.txt file - refactor components root CMakeLists.txt file - refactor utils CMakeLists.txt file - refactor components root CMakeLists.txt file - refactor media manager CMakeLists.txt file - refactor telemetry monitor CMakeLists.txt file - refactor appmain CMakeLists.txt file - refactor plugins CMakeLists.txt file - refactor 3rd party CMakeLists.txt files - create cmake helper for interface generation - refactor root CMakeLists.txt file Move cmake modules to tools Rename src/3rd_party-static/MessageBroker to message_broker Related tasks APPLINK-30588 APPLINK-30972
Diffstat (limited to 'src/components/hmi_message_handler')
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt37
-rw-r--r--src/components/hmi_message_handler/test/CMakeLists.txt35
2 files changed, 43 insertions, 29 deletions
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index 49aea93bda..c1dfca5e67 100644
--- a/src/components/hmi_message_handler/CMakeLists.txt
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,6 +28,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
include/
@@ -46,29 +48,36 @@ include_directories (
${LOG4CXX_INCLUDE_DIRECTORY}
)
-IF (HMIADAPTER STREQUAL "dbus")
- set (DBUS_SOURCE ./src/dbus_message_adapter.cc)
- set (DBUS_ADAPTER DBus)
-ENDIF ()
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+
+if (HMIADAPTER STREQUAL "dbus")
+ set(EXCLUDE_PATHS)
+ set(DBUS_ADAPTER DBus)
+else()
+ set(EXCLUDE_PATHS dbus_message_adapter.cc)
+ set(DBUS_ADAPTER)
+endif ()
-set (SOURCES
- ${COMPONENTS_DIR}/hmi_message_handler/src/hmi_message_handler_impl.cc
- ${COMPONENTS_DIR}/hmi_message_handler/src/messagebroker_adapter.cc
- ${COMPONENTS_DIR}/hmi_message_handler/src/hmi_message_adapter_impl.cc
- ${DBUS_SOURCE}
+list(APPEND EXCLUDE_PATHS
+ mqueue_adapter.cc
)
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+
set(LIBRARIES
- Utils
- ${DBUS_ADAPTER}
- ${RTLIB}
+ Utils
+ ${DBUS_ADAPTER}
+ ${RTLIB}
)
add_library("HMIMessageHandler" ${SOURCES})
target_link_libraries("HMIMessageHandler" ${LIBRARIES})
if(ENABLE_LOG)
- target_link_libraries("HMIMessageHandler" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ target_link_libraries("HMIMessageHandler" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
# Tests temporary are inactivated. For details please check
diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt
index 98e9fd5653..0d7ccd9ee1 100644
--- a/src/components/hmi_message_handler/test/CMakeLists.txt
+++ b/src/components/hmi_message_handler/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${GMOCK_INCLUDE_DIRECTORY}
@@ -36,27 +37,31 @@ include_directories (
${COMPONENTS_DIR}/hmi_message_handler/test/include
)
+if (HMIADAPTER STREQUAL "messagebroker")
+ set (BROKER_LIBRARIES
+ message_broker_client
+ message_broker_server
+ )
+endif()
+
+set(EXCLUDE_PATHS)
+
set(LIBRARIES
gmock
ApplicationManager
HMIMessageHandler
jsoncpp
- MessageBrokerClient
- MessageBrokerServer
+ ${BROKER_LIBRARIES}
ConfigProfile
)
-set(SOURCES
-${COMPONENTS_DIR}/hmi_message_handler/test/hmi_message_handler_impl_test.cc
-${COMPONENTS_DIR}/hmi_message_handler/test/hmi_message_adapter_test.cc
-)
-
-if(${QT_HMI})
- list (APPEND SOURCES
- ${COMPONENTS_DIR}/hmi_message_handler/test/mock_subscriber.cc
- ${COMPONENTS_DIR}/hmi_message_handler/test/dbus_message_adapter_test.cc
+if(NOT HMI_DBUS_API})
+ list (APPEND EXCLUDE_PATHS
+ mock_subscriber.cc
+ dbus_message_adapter_test.cc
)
endif()
-create_test("hmi_message_handler_test" "${SOURCES}" "${LIBRARIES}")
-endif()
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+
+create_test(hmi_message_handler_test "${SOURCES}" "${LIBRARIES}")