1############################################################################ 2# 3# Copyright 2010-2014 BMW Car IT GmbH 4# Copyright (C) 2013 DENSO CORPORATION 5# 6# 7# Licensed under the Apache License, Version 2.0 (the "License"); 8# you may not use this file except in compliance with the License. 9# You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, software 14# distributed under the License is distributed on an "AS IS" BASIS, 15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16# See the License for the specific language governing permissions and 17# limitations under the License. 18# 19############################################################################ 20 21cmake_minimum_required (VERSION 2.6) 22 23project(ilmCommon) 24 25find_package(Threads) 26find_package(PkgConfig REQUIRED) 27pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) 28GET_TARGET_PROPERTY(ILM_CONTROL_INCLUDE_DIRS ilmControl INCLUDE_DIRECTORIES) 29 30include_directories( 31 include 32 ${WAYLAND_CLIENT_INCLUDE_DIRS} 33) 34 35link_directories( 36 ${WAYLAND_CLIENT_LIBRARY_DIRS} 37) 38 39add_library(${PROJECT_NAME} SHARED 40 src/ilm_common.c 41 src/ilm_common_wayland_platform.c 42) 43 44target_link_libraries(${PROJECT_NAME} 45 ${WAYLAND_CLIENT_LIBRARIES} 46 ilmControl 47) 48 49add_dependencies(${PROJECT_NAME} 50 ${WAYLAND_CLIENT_LIBRARIES} 51 ilmControl 52) 53 54install ( 55 TARGETS ${PROJECT_NAME} 56 LIBRARY DESTINATION lib${LIB_SUFFIX} 57) 58 59install ( 60 FILES ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ilm_common.h 61 ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ilm_types.h 62 ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ilm_platform.h 63 DESTINATION include/ilm 64) 65 66SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${ILM_API_VERSION} SOVERSION ${ILM_API_VERSION}) 67 68#============================================================================================= 69# generate pkg-config file for ilmCommon API 70#============================================================================================= 71 72configure_file( 73 "${CMAKE_CURRENT_SOURCE_DIR}/ilmCommon.pc.in" 74 "${CMAKE_CURRENT_BINARY_DIR}/ilmCommon.pc" 75 @ONLY 76) 77 78install( 79 FILES "${CMAKE_CURRENT_BINARY_DIR}/ilmCommon.pc" 80 DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" 81) 82