blob: 64f2c356dceedac9850311b97f0bcdd52dc016dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
###########################################################################
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright 2019 Konsulko Group
#
# 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.
###########################################################################
PROJECT_TARGET_ADD(vshl-core-api)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(VSHL_CORE_LIB_SRC
${CMAKE_CURRENT_SOURCE_DIR}/VshlCoreApi.cpp
${CMAKE_CURRENT_SOURCE_DIR}/VshlCoreApi.h
# Interfaces
${CMAKE_CURRENT_SOURCE_DIR}/interfaces/afb/IAFBApi.h
${CMAKE_CURRENT_SOURCE_DIR}/interfaces/utilities/events/IEventFilter.h
${CMAKE_CURRENT_SOURCE_DIR}/interfaces/utilities/logging/ILogger.h
${CMAKE_CURRENT_SOURCE_DIR}/interfaces/voiceagents/IVoiceAgent.h
${CMAKE_CURRENT_SOURCE_DIR}/interfaces/voiceagents/IVoiceAgentsChangeObserver.h
# AFB
${CMAKE_CURRENT_SOURCE_DIR}/afb/AFBApiImpl.h
${CMAKE_CURRENT_SOURCE_DIR}/afb/AFBApiImpl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/afb/AFBRequestImpl.h
${CMAKE_CURRENT_SOURCE_DIR}/afb/AFBRequestImpl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/afb/include/AFBEventImpl.h
${CMAKE_CURRENT_SOURCE_DIR}/afb/src/AFBEventImpl.cpp
# VoiceAgents
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/VoiceAgentsDataManager.h
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/VoiceAgentsDataManagerImpl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/VoiceAgentEventNames.h
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/include/VoiceAgent.h
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/src/VoiceAgentImpl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/include/VoiceAgentEventsHandler.h
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/src/VoiceAgentEventsHandler.cpp
# Core
${CMAKE_CURRENT_SOURCE_DIR}/core/VRRequestProcessor.h
${CMAKE_CURRENT_SOURCE_DIR}/core/VRRequestProcessorImpl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/core/include/VRAgentsObserver.h
${CMAKE_CURRENT_SOURCE_DIR}/core/src/VRAgentsObserverImpl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/core/include/VRRequest.h
${CMAKE_CURRENT_SOURCE_DIR}/core/src/VRRequestImpl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/core/include/VRRequestProcessorDelegate.h
${CMAKE_CURRENT_SOURCE_DIR}/core/src/VRRequestProcessorDelegateImpl.cpp
#Utilities
${CMAKE_CURRENT_SOURCE_DIR}/utilities/events/EventRouter.h
${CMAKE_CURRENT_SOURCE_DIR}/utilities/events/EventRouter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/utilities/logging/Logger.h
${CMAKE_CURRENT_SOURCE_DIR}/utilities/logging/Logger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/utilities/uuid/UUIDGeneration.h
${CMAKE_CURRENT_SOURCE_DIR}/utilities/uuid/UUIDGeneration.cpp
)
# Define targets
ADD_LIBRARY(${TARGET_NAME} MODULE
${VSHL_CORE_LIB_SRC}
)
# VSHL plugin properties
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
LABELS "PLUGIN"
PREFIX ""
SUFFIX ".ctlso"
OUTPUT_NAME ${TARGET_NAME}
)
# Define target includes
TARGET_INCLUDE_DIRECTORIES(${TARGET_NAME}
PUBLIC ${GLIB_PKG_INCLUDE_DIRS}
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}"
)
# Library dependencies (include updates automatically)
TARGET_LINK_LIBRARIES(${TARGET_NAME}
${GLIB_PKG_LIBRARIES}
${link_libraries}
)
option(ENABLE_UNIT_TESTS "Build unit tests or not" OFF)
if (ENABLE_UNIT_TESTS)
execute_process(
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/agreement.sh"
RESULT_VARIABLE AGREEMENT_RESULT
)
message(STATUS "Agreement Result: ${AGREEMENT_RESULT}")
if (${AGREEMENT_RESULT} MATCHES "1")
message(FATAL_ERROR "User agreement not accepted. Quitting")
endif()
include(cmake/gtest.cmake)
set(VSHL_CORE_TEST_SRC ${VSHL_CORE_LIB_SRC})
list(APPEND VSHL_CORE_TEST_SRC
# Main
${CMAKE_CURRENT_SOURCE_DIR}/TestMain.cpp
# Test common
${CMAKE_CURRENT_SOURCE_DIR}/test/common/ConsoleLogger.h
${CMAKE_CURRENT_SOURCE_DIR}/test/common/ConsoleLogger.cpp
# Test Mocks
${CMAKE_CURRENT_SOURCE_DIR}/test/mocks/AFBApiMock.h
${CMAKE_CURRENT_SOURCE_DIR}/test/mocks/AFBEventMock.h
${CMAKE_CURRENT_SOURCE_DIR}/test/mocks/AFBRequestMock.h
${CMAKE_CURRENT_SOURCE_DIR}/test/mocks/VoiceAgentsChangeObserverMock.h
# Core
${CMAKE_CURRENT_SOURCE_DIR}/core/test/VRRequestTest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/core/test/VRRequestProcessorTest.cpp
# VoiceAgents
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/test/VoiceAgentTest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/voiceagents/test/VoiceAgentsDataManagerTest.cpp
)
ADD_EXECUTABLE(${TARGET_NAME}_Test
${VSHL_CORE_TEST_SRC}
)
TARGET_INCLUDE_DIRECTORIES(${TARGET_NAME}_Test
PUBLIC ${GLIB_PKG_INCLUDE_DIRS}
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}"
)
TARGET_LINK_LIBRARIES(${TARGET_NAME}_Test
libgtest
libgmock
${GLIB_PKG_LIBRARIES}
${link_libraries}
)
ENABLE_TESTING()
ADD_TEST(VshlCoreTest ${TARGET_NAME}_Test)
endif()
|