Merge branch 'tizen' into security-manager
[platform/core/test/security-tests.git] / tests / CMakeLists.txt
1 # Copyright (c) 2015-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
16 cmake_minimum_required(VERSION 2.8.3)
17
18 INCLUDE(FindPkgConfig)
19 SET(INNER_TARGET_TEST "security-tests-inner-test")
20
21 PKG_CHECK_MODULES(INNER_TARGET_DEP
22     REQUIRED
23     glib-2.0
24     )
25
26 FIND_PACKAGE (Threads)
27
28 #files to compile
29 SET(INNER_TARGET_TEST_SOURCES
30     ${PROJECT_SOURCE_DIR}/tests/inner-test.cpp
31     ${PROJECT_SOURCE_DIR}/tests/common/test_cases_timeout.cpp
32     ${PROJECT_SOURCE_DIR}/tests/framework/test_cases_deferred.cpp
33     )
34
35 #header directories
36 INCLUDE_DIRECTORIES(SYSTEM
37     ${INNER_TARGET_DEP_INCLUDE_DIRS}
38     )
39
40 INCLUDE_DIRECTORIES(
41     ${PROJECT_SOURCE_DIR}/src/framework/include/
42     ${PROJECT_SOURCE_DIR}/src/
43     )
44
45 #output format
46 ADD_EXECUTABLE(${INNER_TARGET_TEST} ${INNER_TARGET_TEST_SOURCES})
47
48 #linker directories
49 TARGET_LINK_LIBRARIES(${INNER_TARGET_TEST}
50     ${INNER_TARGET_DEP_LIBRARIES}
51     tests-common
52     dpl-test-framework
53     ${CMAKE_THREAD_LIBS_INIT}
54     )
55
56 #place for output file
57 INSTALL(TARGETS ${INNER_TARGET_TEST}
58     DESTINATION /usr/bin
59     PERMISSIONS OWNER_READ
60                 OWNER_WRITE
61                 OWNER_EXECUTE
62                 GROUP_READ
63                 GROUP_EXECUTE
64                 WORLD_READ
65                 WORLD_EXECUTE
66     )
67
68 ADD_SUBDIRECTORY(cleanup)
69