1############################################################################ 2# 3# Copyright 2010-2014 BMW Car IT GmbH 4# Copyright (C) 2013 DENSO CORPORATION 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 20cmake_minimum_required (VERSION 2.6) 21 22project(ilmClient) 23 24find_package(Threads) 25find_package(PkgConfig REQUIRED) 26pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) 27 28find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) 29 30add_custom_command( 31 OUTPUT ivi-application-client-protocol.h 32 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header 33 < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 34 > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-client-protocol.h 35 DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 36) 37 38add_custom_command( 39 OUTPUT ivi-application-protocol.c 40 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code 41 < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 42 > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-protocol.c 43 DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 44) 45 46GET_TARGET_PROPERTY(ILM_COMMON_INCLUDE_DIRS ilmCommon INCLUDE_DIRECTORIES) 47 48include_directories( 49 include 50 ${ILM_COMMON_INCLUDE_DIRS} 51 ${WAYLAND_CLIENT_INCLUDE_DIRS} 52 ${CMAKE_CURRENT_BINARY_DIR} 53) 54 55link_directories( 56 ${WAYLAND_CLIENT_LIBRARY_DIRS} 57) 58 59add_library(${PROJECT_NAME} SHARED 60 src/ilm_client.c 61 src/ilm_client_wayland_platform.c 62 ivi-application-protocol.c 63 ivi-application-client-protocol.h 64) 65 66set(LIBS 67 ${LIBS} 68 ${WAYLAND_CLIENT_LIBRARIES} 69) 70 71add_dependencies(${PROJECT_NAME} 72 ${LIBS} 73) 74 75target_link_libraries(${PROJECT_NAME} 76 ${LIBS} 77) 78 79install ( 80 TARGETS ${PROJECT_NAME} 81 LIBRARY DESTINATION lib${LIB_SUFFIX} 82) 83 84install ( 85 FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/ilm_client.h 86 DESTINATION include/ilm 87) 88 89SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${ILM_API_VERSION} SOVERSION ${ILM_API_VERSION}) 90 91 92#============================================================================================= 93# generate documentation for ilmClient API 94#============================================================================================= 95 96add_custom_target(ilm-client-doc 97 COMMAND cat ${CMAKE_SOURCE_DIR}/doc/Doxyfile.template 98 | sed 's/___DOC_NAME___/ilmClient API/' 99 | sed 's/___DOC_VERSION___/${ILM_API_VERSION}/' 100 | sed 's!___INPUT_FILE___!${CMAKE_CURRENT_SOURCE_DIR}/include/ilm_client.h ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ilm_common.h!' 101 | sed 's/___OUTPUT_DIR___/ilm-client-doc/' 102 | doxygen - 103 COMMAND make --silent -C ilm-client-doc/latex 104 COMMAND cp ilm-client-doc/latex/refman.pdf 105 ${CMAKE_BINARY_DIR}/ilm-client-api-${ILM_API_VERSION}.pdf 106 COMMENT "Generating ilm-client-api-${ILM_API_VERSION}.pdf" 107) 108 109