c18abc10cb520ad645679ef19a519114d395fbdf
[platform/core/connectivity/bluetooth-agent.git] / unittest / CMakeLists.txt
1 # Copyright (c) 2014-2017 Samsung Electronics Co., Ltd All Rights Reserved
2 #
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
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14 #
15 # @file        CMakeLists.txt
16 # @author
17 # @brief       Cmake for tests
18 #
19 SET(TARGET_GTEST_TESTS "gtest-bluetooth-agent")
20
21 INCLUDE_DIRECTORIES(/usr/include)
22 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
23 INCLUDE_DIRECTORIES(/usr/include/glib-2.0)
24 INCLUDE_DIRECTORIES(/usr/include/dlog)
25 INCLUDE_DIRECTORIES(/usr/include/vconf)
26 INCLUDE_DIRECTORIES(/usr/lib/glib-2.0/include/)
27 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ag-agent)
28
29 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
30 SET(EXEC_PREFIX "\${prefix}")
31 SET(INCLUDEDIR "/usr/include")
32
33 INCLUDE(FindPkgConfig)
34 pkg_check_modules(testpkgs REQUIRED dlog glib-2.0 gmock)
35
36 SET(GTEST_TESTS_SOURCES
37 bluetooth-agent_test.cpp
38 )
39
40 ADD_EXECUTABLE(${TARGET_GTEST_TESTS}
41         ${GTEST_TESTS_SOURCES}
42 )
43
44 TARGET_LINK_LIBRARIES(${TARGET_GTEST_TESTS}
45         ${testpkgs_LDFLAGS}
46         ${testpkgs_LIBRARIES}
47         gmock
48         -L${CMAKE_SOURCE_DIR}/ag-agent
49         -L${CMAKE_SOURCE_DIR}/hf-agent
50         -L${CMAKE_SOURCE_DIR}/hid-agent
51         -L${CMAKE_SOURCE_DIR}/ipsp-agent
52         -L${CMAKE_SOURCE_DIR}/map-agent
53         -L${CMAKE_SOURCE_DIR}/pb-agent
54         -lag-agent
55         -lhf-agent
56         -lhid-agent
57         -lipsp-agent
58         -lmap-agent
59         -lpb-agent
60 )
61
62 INSTALL(TARGETS ${TARGET_GTEST_TESTS} DESTINATION /usr/bin)