Modify header names according to ACR
[platform/core/security/yaca.git] / src / CMakeLists.txt
1 #
2 #  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #  Contact: Krzysztof Jackiewicz <k.jackiewicz@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 PROJECT(yaca)
24
25 MESSAGE(STATUS "")
26 MESSAGE(STATUS "Generating makefile for the yaca...")
27
28 FILE(GLOB HEADERS   ${API_FOLDER}/*.h)
29 FILE(GLOB SRCS      *.c *.h)
30
31 SET(_LIB_VERSION_ "${VERSION}")
32 SET(_LIB_SOVERSION_ "0")
33 SET(PC_FILE "${PROJECT_NAME}.pc")
34
35 ## Set the default ELF image symbol visibility to hidden. Using this feature
36 ## can very substantially improve linking and load times of shared object
37 ## libraries, produce more optimized code, provide near-perfect API export
38 ## and prevent symbol clashes
39 ADD_DEFINITIONS(-fvisibility=hidden)
40
41 ## Setup target ################################################################
42 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${HEADERS})
43 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
44                       SOVERSION  ${_LIB_SOVERSION_}
45                       VERSION    ${_LIB_VERSION_})
46
47 ## Link libraries ##############################################################
48 PKG_CHECK_MODULES(YACA_DEPS REQUIRED openssl capi-base-common)
49
50 FIND_PACKAGE (Threads)
51
52 INCLUDE_DIRECTORIES(${API_FOLDER})
53 INCLUDE_DIRECTORIES(SYSTEM ${YACA_DEPS_INCLUDE_DIRS})
54 TARGET_LINK_LIBRARIES(${PROJECT_NAME}
55                       ${YACA_DEPS_LIBRARIES}
56                       ${CMAKE_THREAD_LIBS_INIT})
57
58 ## Generate the pc file ########################################################
59 CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE} @ONLY)
60
61 ## Install #####################################################################
62 INSTALL(FILES       ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE}
63         DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
64
65 INSTALL(TARGETS     ${PROJECT_NAME}
66         DESTINATION ${LIB_INSTALL_DIR}
67         COMPONENT   RuntimeLibraries)
68
69 INSTALL(FILES       ${HEADERS}
70         DESTINATION ${INCLUDE_INSTALL_DIR}/yaca)