Merge branch 'tizen' into security-manager
[platform/core/test/security-tests.git] / src / yaca / CMakeLists.txt
1 #
2 #    Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #    Contact: Dariusz Michaluk (d.michaluk@samsung.com)
5 #
6 #    Licensed under the Apache License, Version 2.0 (the "License");
7 #    you may not use this file except in compliance with the License.
8 #    You may obtain a copy of the License at
9 #
10 #        http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #    Unless required by applicable law or agreed to in writing, software
13 #    distributed under the License is distributed on an "AS IS" BASIS,
14 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #    See the License for the specific language governing permissions and
16 #    limitations under the License.
17 #
18 #
19 # @file   CMakeLists.txt
20 # @author Dariusz Michaluk (d.michaluk@samsung.com)
21 #
22
23 MESSAGE(STATUS "")
24 MESSAGE(STATUS "Generating makefile for the Yaca system tests...")
25
26 FILE(GLOB  yaca_test_SRCS *.cpp)
27
28 ## Setup target ################################################################
29 SET(YACA_TEST "yaca-test")
30 ADD_EXECUTABLE(${YACA_TEST} ${yaca_test_SRCS})
31
32 ADD_CUSTOM_TARGET(copy-test-vectors ALL
33                   COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/test-vectors ${CMAKE_CURRENT_BINARY_DIR}/test-vectors
34                   DEPENDS ${YACA_TEST})
35
36 IF(NOT DEFINED YACA_TEST_DIR)
37         SET(YACA_TEST_DIR "${SHARE_INSTALL_PREFIX}/${YACA_TEST}")
38 ENDIF(NOT DEFINED YACA_TEST_DIR)
39 ADD_DEFINITIONS("-DYACA_TEST_DIR=\"${YACA_TEST_DIR}\"")
40 MESSAGE(STATUS "YACA_TEST_DIR: ${YACA_TEST_DIR}")
41
42 ## Link libraries ##############################################################
43 PKG_CHECK_MODULES(YACA_TEST_DEPS REQUIRED yaca)
44
45 FIND_PACKAGE (Threads)
46
47 INCLUDE_DIRECTORIES(SYSTEM ${YACA_TEST_DEPS_INCLUDE_DIRS})
48 TARGET_LINK_LIBRARIES(${YACA_TEST}
49                       ${YACA_TEST_DEPS_LIBRARIES}
50                       dpl-test-framework
51                       ${CMAKE_THREAD_LIBS_INIT})
52
53 ## Install #####################################################################
54 INSTALL(TARGETS ${YACA_TEST} DESTINATION bin)
55
56 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test-vectors DESTINATION ${YACA_TEST_DIR})