1 # Copyright (c) 2014-2017 Samsung Electronics Co., Ltd All Rights Reserved
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # @file CMakeLists.txt
17 # @brief Cmake for tests
19 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
21 SET(TARGET_GTEST_TESTS "gtest-bluetooth-agent")
23 INCLUDE_DIRECTORIES(/usr/include)
24 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
25 INCLUDE_DIRECTORIES(/usr/include/glib-2.0)
26 INCLUDE_DIRECTORIES(/usr/include/dlog)
27 INCLUDE_DIRECTORIES(/usr/include/vconf)
28 INCLUDE_DIRECTORIES(/usr/include/gio-unix-2.0)
29 INCLUDE_DIRECTORIES(/usr/lib/glib-2.0/include/)
30 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ag-agent)
31 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/hid-agent)
32 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ipsp-agent)
33 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/map-agent)
34 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/pb-agent)
36 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
37 SET(EXEC_PREFIX "\${prefix}")
38 SET(INCLUDEDIR "/usr/include")
40 INCLUDE(FindPkgConfig)
41 pkg_check_modules(testpkgs REQUIRED dlog msg-service email-service glib-2.0)
43 INCLUDE_DIRECTORIES(${testpkgs_INCLUDE_DIRS})
45 SET(GTEST_TESTS_SOURCES
46 bluetooth-agent_test.cpp
49 SET(BLUETOOTH_AGENT_MOCK "bluetooth-agent-mock")
50 SET(BLUETOOTH_AGENT_MOCK_SRCS
51 mock/bluetooth-agent-mock.c)
52 SET(BLUETOOTH_AGENT_MOCK_CFLAGS "${CMAKE_C_FLAGS}" )
53 ADD_LIBRARY(${BLUETOOTH_AGENT_MOCK} SHARED ${BLUETOOTH_AGENT_MOCK_SRCS})
54 TARGET_LINK_LIBRARIES(${BLUETOOTH_AGENT_MOCK} -ldl)
55 SET_TARGET_PROPERTIES(${BLUETOOTH_AGENT_MOCK} PROPERTIES
56 COMPILE_FLAGS ${BLUETOOTH_AGENT_MOCK_CFLAGS}
59 ADD_EXECUTABLE(${TARGET_GTEST_TESTS}
60 ${GTEST_TESTS_SOURCES}
63 TARGET_LINK_LIBRARIES(${TARGET_GTEST_TESTS}
67 -L${CMAKE_SOURCE_DIR}/ag-agent
68 -L${CMAKE_SOURCE_DIR}/hf-agent
69 -L${CMAKE_SOURCE_DIR}/hid-agent
70 -L${CMAKE_SOURCE_DIR}/ipsp-agent
71 -L${CMAKE_SOURCE_DIR}/map-agent
72 -L${CMAKE_SOURCE_DIR}/pb-agent
81 INSTALL(TARGETS ${TARGET_GTEST_TESTS} DESTINATION /usr/bin)