Move trust-anchor to seperate git
[platform/core/security/cert-svc.git] / examples / CMakeLists.txt
1 #
2 #  Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License
15 #
16
17 ADD_DEFINITIONS("-DCERT_SVC_EXAMPLES=\"${CERT_SVC_EXAMPLES}\"")
18
19 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
20
21 FUNCTION(BUILD_EXAMPLE EXAMPLE_NAME SOURCE_FILE)
22         ADD_EXECUTABLE(${EXAMPLE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE})
23         TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} ${TARGET_VCORE_LIB})
24         INSTALL(TARGETS ${EXAMPLE_NAME}
25                         DESTINATION ${BIN_DIR}
26                         PERMISSIONS OWNER_READ
27                                                 OWNER_WRITE
28                                                 OWNER_EXECUTE
29                                                 GROUP_READ
30                                                 GROUP_EXECUTE
31                                                 WORLD_READ
32                                                 WORLD_EXECUTE)
33         INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}
34                         DESTINATION ${CERT_SVC_EXAMPLES})
35 ENDFUNCTION(BUILD_EXAMPLE)
36
37 BUILD_EXAMPLE("cert-svc-example-vcore-until-3.0" signature-validator-until-3.0.cpp)
38 BUILD_EXAMPLE("cert-svc-example-vcore-since-4.0" signature-validator-since-4.0.cpp)
39
40 INSTALL(DIRECTORY resource
41                 DESTINATION ${CERT_SVC_EXAMPLES})