Fix build for boost 1.71.0
[platform/core/security/libwebappenc.git] / tests / CMakeLists.txt
1 # Copyright (c) 2016 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 # @file        CMakeLists.txt
16 # @author      Kyungwook Tak (k.tak@samsung.com)
17 # @brief       cmake for test program
18 #
19 ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
20
21 #### test common library ####
22 PKG_CHECK_MODULES(${TARGET_WAE_TEST_COMMON}_DEP
23         REQUIRED
24 )
25
26 SET(${TARGET_WAE_TEST_COMMON}_SRCS
27         colour_log_formatter.cpp
28         test-common.cpp
29 )
30
31 INCLUDE_DIRECTORIES(
32         SYSTEM
33         ${${TARGET_WAE_TEST_COMMON}_DEP_INCLUDE_DIRS}
34 )
35
36 INCLUDE_DIRECTORIES(
37         .
38 )
39
40 ADD_LIBRARY(${TARGET_WAE_TEST_COMMON} SHARED ${${TARGET_WAE_TEST_COMMON}_SRCS})
41
42 SET_TARGET_PROPERTIES(${TARGET_WAE_TEST_COMMON}
43         PROPERTIES
44                 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=default"
45 )
46
47 TARGET_LINK_LIBRARIES(${TARGET_WAE_TEST_COMMON}
48         ${${TARGET_WAE_TEST_COMMON}_DEP_LIBRARIES}
49         -lboost_unit_test_framework
50 )
51
52 INSTALL(TARGETS ${TARGET_WAE_TEST_COMMON} DESTINATION ${LIBDIR})
53
54 #### main test program ####
55 PKG_CHECK_MODULES(${TARGET_WAE_TEST}_DEP
56         REQUIRED
57 )
58
59 SET(${TARGET_WAE_TEST}_SRCS
60         main.cpp
61         non-normals.cpp
62         normals.cpp
63         internals.cpp
64         test-helper.cpp
65 )
66
67 INCLUDE_DIRECTORIES(
68         SYSTEM
69         ${${TARGET_WAE_TEST}_DEP_INCLUDE_DIRS}
70 )
71
72 INCLUDE_DIRECTORIES(
73         ${PROJECT_SOURCE_DIR}/include
74         ${PROJECT_SOURCE_DIR}/srcs
75         .
76 )
77
78 ADD_EXECUTABLE(${TARGET_WAE_TEST} ${${TARGET_WAE_TEST}_SRCS})
79
80 TARGET_LINK_LIBRARIES(${TARGET_WAE_TEST}
81         ${${TARGET_WAE_TEST}_DEP_LIBRARIES}
82         ${TARGET_WAE_TEST_COMMON}
83         ${TARGET_WAE}
84         -lboost_unit_test_framework
85         -ldl
86 )
87
88
89 INSTALL(TARGETS ${TARGET_WAE_TEST}
90         DESTINATION ${BINDIR}
91         PERMISSIONS
92                 OWNER_READ
93                 OWNER_WRITE
94                 OWNER_EXECUTE
95                 GROUP_READ
96                 GROUP_EXECUTE
97                 WORLD_READ
98                 WORLD_EXECUTE
99 )
100