2 # Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 # Contact: Dariusz Michaluk (d.michaluk@samsung.com)
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 # @file CMakeLists.txt
20 # @author Dariusz Michaluk (d.michaluk@samsung.com)
24 MESSAGE(STATUS "Generating makefile for the Yaca system tests...")
26 FILE(GLOB yaca_test_SRCS *.cpp)
28 ## Setup target ################################################################
29 SET(YACA_TEST "yaca-test")
30 ADD_EXECUTABLE(${YACA_TEST} ${yaca_test_SRCS})
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
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}")
42 ## Link libraries ##############################################################
43 PKG_CHECK_MODULES(YACA_TEST_DEPS REQUIRED yaca)
45 FIND_PACKAGE (Threads)
47 INCLUDE_DIRECTORIES(SYSTEM ${YACA_TEST_DEPS_INCLUDE_DIRS})
48 TARGET_LINK_LIBRARIES(${YACA_TEST}
49 ${YACA_TEST_DEPS_LIBRARIES}
51 ${CMAKE_THREAD_LIBS_INIT})
53 ## Install #####################################################################
54 INSTALL(TARGETS ${YACA_TEST} DESTINATION bin)
56 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test-vectors DESTINATION ${YACA_TEST_DIR})