Separate file operations into separate file
[platform/core/test/security-tests.git] / tests / cynara-tests / CMakeLists.txt
1 # Copyright (c) 2014-2015 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(CYNARA_TARGET_TEST "cynara-test")
20
21 PKG_CHECK_MODULES(CYNARA_TARGET_DEP
22     REQUIRED
23     libprivilege-control
24     cynara-admin
25     cynara-client
26     cynara-client-async
27     cynara-plugin
28     dbus-1
29     )
30
31 #files to compile
32 SET(CYNARA_TARGET_TEST_SOURCES
33     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_admin.cpp
34     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client.cpp
35     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_client.cpp
36     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_request_monitor.cpp
37     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_status_monitor.cpp
38     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_commons.cpp
39     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_env.cpp
40     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_file_operations.cpp
41     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/cynara-test.cpp
42     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases.cpp
43     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases_async.cpp
44     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases_db.cpp
45     )
46
47 #header directories
48 INCLUDE_DIRECTORIES(SYSTEM
49     ${CYNARA_TARGET_DEP_INCLUDE_DIRS}
50     )
51
52 INCLUDE_DIRECTORIES(
53     ${PROJECT_SOURCE_DIR}/tests/common/
54     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/
55     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/plugins/
56     )
57
58
59 #output format
60 ADD_EXECUTABLE(${CYNARA_TARGET_TEST} ${CYNARA_TARGET_TEST_SOURCES})
61
62 #linker directories
63 TARGET_LINK_LIBRARIES(${CYNARA_TARGET_TEST}
64     ${CYNARA_TARGET_DEP_LIBRARIES}
65     dpl-test-framework
66     tests-common
67     )
68
69 #place for output file
70 INSTALL(TARGETS ${CYNARA_TARGET_TEST}
71     DESTINATION /usr/bin
72     PERMISSIONS OWNER_READ
73                 OWNER_WRITE
74                 OWNER_EXECUTE
75                 GROUP_READ
76                 GROUP_EXECUTE
77                 WORLD_READ
78                 WORLD_EXECUTE
79     )
80
81 INSTALL(FILES
82     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/WRT_test_for_cynara_rules.smack
83     DESTINATION /usr/share/privilege-control/
84 )
85
86 INSTALL(DIRECTORY
87     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/db_patterns
88     DESTINATION /etc/security-tests/
89 )
90
91 ADD_SUBDIRECTORY(plugins)