Change spaces to tab in CMakeLists
[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}/yaca/*.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)
49
50 INCLUDE_DIRECTORIES(${API_FOLDER})
51 INCLUDE_DIRECTORIES(SYSTEM ${YACA_DEPS_INCLUDE_DIRS})
52 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${YACA_DEPS_LIBRARIES})
53
54 ## Generate the pc file ########################################################
55 CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE} @ONLY)
56
57 ## Install #####################################################################
58 INSTALL(FILES       ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE}
59         DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
60
61 INSTALL(TARGETS     ${PROJECT_NAME}
62         DESTINATION ${LIB_INSTALL_DIR}
63         COMPONENT   RuntimeLibraries)
64
65 INSTALL(FILES       ${HEADERS}
66         DESTINATION ${INCLUDE_INSTALL_DIR}/yaca)