1 # Copyright (c) 2014 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.
16 # @file CMakeLists.txt
17 # @author Dariusz Michaluk (d.michaluk@samsung.com)
23 MESSAGE(STATUS "Generating makefile for the libLogger...")
24 FILE(GLOB HEADERS *.hpp)
25 FILE(GLOB SRCS *.cpp *.hpp)
27 SET(_LIB_VERSION_ "${VERSION}")
28 SET(_LIB_SOVERSION_ "0")
29 SET(PC_FILE "lib${PROJECT_NAME}.pc")
31 ## Setup target ################################################################
32 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
33 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
34 SOVERSION ${_LIB_SOVERSION_}
35 VERSION ${_LIB_VERSION_}
38 ## Link libraries ##############################################################
39 PKG_CHECK_MODULES(LOGGER_DEPS libsystemd-journal QUIET)
40 INCLUDE_DIRECTORIES(${LIBS_FOLDER})
41 INCLUDE_DIRECTORIES(SYSTEM ${LOGGER_DEPS_INCLUDE_DIRS})
42 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${LOGGER_DEPS_LIBRARIES})
44 ## Add constants ###############################################################
46 ADD_DEFINITIONS(-DHAVE_SYSTEMD_JOURNAL=${LOGGER_DEPS_FOUND})
49 ## Generate the pc file ########################################################
50 CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE} @ONLY)
52 ## Install #####################################################################
53 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE}
54 DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
56 INSTALL(TARGETS ${PROJECT_NAME}
57 DESTINATION ${LIB_INSTALL_DIR}
58 COMPONENT RuntimeLibraries)
60 INSTALL(FILES ${HEADERS}
61 DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/logger)