1 # Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 # @file CMakeLists.txt
16 # @author Kyungwook Tak (k.tak@samsung.com)
17 # @brief build test program of csr-framework
19 FIND_PACKAGE(Threads REQUIRED)
20 ADD_DEFINITIONS("-DBOOST_TEST_DYN_LINK")
21 ADD_DEFINITIONS("-DTEST_TARGET=\"${TEST_TARGET}\"")
23 ################### make test common library ##################
24 PKG_CHECK_MODULES(${TARGET_CSR_TEST_COMMON}_DEP
31 SET(${TARGET_CSR_TEST_COMMON}_SRCS
33 colour_log_formatter.cpp
38 ${${TARGET_CSR_TEST_COMMON}_DEP_INCLUDE_DIRS}
42 ${PROJECT_SOURCE_DIR}/src/include
46 ADD_LIBRARY(${TARGET_CSR_TEST_COMMON} SHARED ${${TARGET_CSR_TEST_COMMON}_SRCS})
48 SET_TARGET_PROPERTIES(${TARGET_CSR_TEST_COMMON}
50 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=default"
53 TARGET_LINK_LIBRARIES(${TARGET_CSR_TEST_COMMON}
54 ${${TARGET_CSR_TEST_COMMON}_DEP_LIBRARIES}
58 INSTALL(TARGETS ${TARGET_CSR_TEST_COMMON} DESTINATION ${LIB_INSTALL_DIR})
59 #################################################################
61 ###################### make api test program ####################
62 PKG_CHECK_MODULES(${TARGET_CSR_TEST}_DEP
66 SET(${TARGET_CSR_TEST}_SRCS
67 test-api-content-screening.cpp
68 test-api-content-screening-async.cpp
69 test-api-engine-manager.cpp
70 test-api-web-protection.cpp
77 ${${TARGET_CSR_TEST}_DEP_INCLUDE_DIRS}
81 ${PROJECT_SOURCE_DIR}/src/include
85 ADD_EXECUTABLE(${TARGET_CSR_TEST} ${${TARGET_CSR_TEST}_SRCS})
87 TARGET_LINK_LIBRARIES(${TARGET_CSR_TEST}
88 ${TARGET_CSR_TEST_COMMON}
90 ${${TARGET_CSR_TEST}_DEP_LIBRARIES}
91 -lboost_unit_test_framework
95 INSTALL(TARGETS ${TARGET_CSR_TEST} DESTINATION ${BIN_DIR})
96 INSTALL(DIRECTORY resources/ DESTINATION ${TEST_DIR})
98 ADD_SUBDIRECTORY(internals)
99 ADD_SUBDIRECTORY(popup)
100 ADD_SUBDIRECTORY(thread-pool)
101 #################################################################