1 # Copyright (c) 2012 GENIVI Alliance
2 # Copyright (c) 2012 BMW
4 # author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
7 # 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,
8 # 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,
9 # subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 # 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.
12 # 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
13 # THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 # For further information see http://www.genivi.org/.
18 cmake_minimum_required(VERSION 2.6)
20 PROJECT(AmNodeStateCommunicatorCAPITest)
22 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1")
24 set(STD_INCLUDE_DIRS "/usr/include")
26 set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
29 FIND_PACKAGE(PkgConfig)
30 FIND_PACKAGE(CommonAPI REQUIRED)
31 pkg_check_modules(SQLITE REQUIRED sqlite3)
34 pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0)
40 ${CMAKE_CURRENT_BINARY_DIR}
41 ${AUDIO_INCLUDE_FOLDER}
45 ${PYTHON_INCLUDE_DIRS}
46 ${GOOGLE_TEST_INCLUDE_DIR}
49 ${COMMON_API_INCLUDE_DIRS}
50 ${COMMON_API_DBUS_INCLUDE_DIRS}
51 ${COMMON_API_GEN_INCLUDE_DIR}
55 file(GLOB NODESTATECOMMUNICATORCAPI
56 "../../src/CAmDatabaseHandler.cpp"
57 "../../src/CAmDatabaseObserver.cpp"
58 "../../src/CAmRoutingSender.cpp"
59 "../../src/CAmRoutingReceiver.cpp"
60 "../../src/CAmCommonAPIWrapper.cpp"
61 "../../src/CAmDltWrapper.cpp"
62 "../../src/CAmSocketHandler.cpp"
63 "../../src/CAmNodeStateCommunicatorCAPI.cpp"
64 "../../src/CAmControlSender.cpp"
65 "../../src/CAmCommandSender.cpp"
66 "../../src/CAmCommandReceiver.cpp"
67 "../CAmCommonFunctions.cpp"
68 "../../src/CAmRouter.cpp"
70 ${COMMON_API_GEN_SOURCES}
73 CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${CMAKE_BINARY_DIR}/AmNodeStateCommunicatorCAPITest_dbus.conf)
75 ADD_EXECUTABLE(AmNodeStateCommunicatorCAPITest ${NODESTATECOMMUNICATORCAPI} ${COMMON_API_GEN_SOURCES})
77 TARGET_LINK_LIBRARIES(AmNodeStateCommunicatorCAPITest
81 ${CMAKE_THREAD_LIBS_INIT}
83 ${COMMON_API_LIBRARIES}
84 ${COMMON_API_DBUS_LIBRARIES}
89 ADD_DEPENDENCIES(AmNodeStateCommunicatorCAPITest gtest gmock)
91 INSTALL(TARGETS AmNodeStateCommunicatorCAPITest
92 DESTINATION "~/AudioManagerTest/"
93 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
98 ${CMAKE_CURRENT_SOURCE_DIR}/org.genivi.NodeStateManager.Consumer.xml
99 ${CMAKE_CURRENT_SOURCE_DIR}/nsm.py
100 ${CMAKE_CURRENT_SOURCE_DIR}/send2nsm.py
101 DESTINATION "~/AudioManagerTest/"
102 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
108 COMMAND mkdir -p ${EXECUTABLE_OUTPUT_PATH}
109 COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/org.genivi.NodeStateManager.Consumer.xml" ${EXECUTABLE_OUTPUT_PATH}/org.genivi.NodeStateManager.Consumer.xml
110 COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/nsm.py" ${EXECUTABLE_OUTPUT_PATH}/nsm.py
111 COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/send2nsm.py" ${EXECUTABLE_OUTPUT_PATH}/send2nsm.py
112 COMMAND cp "${CMAKE_BINARY_DIR}/AmNodeStateCommunicatorCAPITest_dbus.conf" ${EXECUTABLE_OUTPUT_PATH})
113 ENDIF(USE_BUILD_LIBS)
115 SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "gtest" "libpthread-stubs0")
116 set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")