1 ############################################################################
3 # Copyright (C) 2013 DENSO CORPORATION
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 ############################################################################
20 cmake_minimum_required (VERSION 2.6)
22 project(ivi-controller)
25 find_package(PkgConfig REQUIRED)
26 pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED)
27 pkg_check_modules(CAIRO cairo REQUIRED)
28 pkg_check_modules(WESTON weston REQUIRED)
29 pkg_check_modules(PIXMAN pixman-1 REQUIRED)
31 find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
34 OUTPUT ivi-application-server-protocol.h
35 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header <${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml> ${CMAKE_SOURCE_DIR}/weston-ivi-shell/include/ivi-application-server-protocol.h
39 OUTPUT ivi-application-protocol.c
40 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code <${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml> ${CMAKE_SOURCE_DIR}/weston-ivi-shell/src/ivi-application-protocol.c
44 OUTPUT ivi-controller-server-protocol.h
45 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header <${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml> ${CMAKE_SOURCE_DIR}/weston-ivi-shell/include/ivi-controller-server-protocol.h
49 OUTPUT ivi-controller-protocol.c
50 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code <${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml> ${CMAKE_SOURCE_DIR}/weston-ivi-shell/src/ivi-controller-protocol.c
54 generate_wayland_protocol_codes_for_server
55 DEPENDS ivi-application-server-protocol.h ivi-application-protocol.c ivi-controller-server-protocol.h ivi-controller-protocol.c
60 ${WAYLAND_SERVER_INCLUDE_DIRS}
62 ${WESTON_INCLUDE_DIRS}
63 ${PIXMAN_INCLUDE_DIRS}
67 add_library(${PROJECT_NAME} MODULE
69 src/ivi-controller-protocol.c
72 set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
74 add_dependencies(${PROJECT_NAME}
75 generate_wayland_protocol_codes_for_server
76 ${WAYLAND_SERVER_LIBRARIES}
86 ${WAYLAND_SERVER_LIBRARIES}
91 target_link_libraries(${PROJECT_NAME} ${LIBS} -ldl)
94 TARGETS ${PROJECT_NAME}
95 LIBRARY DESTINATION lib/weston