1############################################################################ 2# 3# Copyright 2010-2012 BMW Car IT GmbH 4# Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh 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(EGLWLInputEventExample) 24 25find_package(PkgConfig) 26pkg_check_modules(GLESv2 glesv2 REQUIRED) 27pkg_check_modules(EGL egl REQUIRED) 28pkg_check_modules(WAYLAND_EGL wayland-egl REQUIRED) 29pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) 30pkg_check_modules(WAYLAND_CURSOR wayland-cursor REQUIRED) 31 32find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) 33 34add_custom_command( 35 OUTPUT ivi-application-client-protocol.h 36 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header 37 < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 38 > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-client-protocol.h 39 DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 40) 41 42add_custom_command( 43 OUTPUT ivi-application-protocol.c 44 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code 45 < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 46 > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-protocol.c 47 DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 48) 49 50include_directories( 51 ${GLESv2_INCLUDE_DIR} 52 ${EGL_INCLUDE_DIR} 53 ${WAYLAND_CLIENT_INCLUDE_DIR} 54 ${WAYLAND_CURSOR_INCLUDE_DIR} 55 ${FFI_INCLUDE_DIR} 56 "include" 57 ${CMAKE_CURRENT_BINARY_DIR} 58) 59 60link_directories( 61 ${GLESv2_LIBRARY_DIRS} 62 ${EGL_LIBRARY_DIRS} 63 ${WAYLAND_CLIENT_LIBRARY_DIRS} 64 ${WAYLAND_CURSOR_LIBRARY_DIRS} 65) 66 67set (HEADER_FILES 68 include/transform.h 69 include/WLContext.h 70 include/WLEGLSurface.h 71 include/WLEyes.h 72 include/WLEyesRenderer.h 73 include/WLSurface.h 74) 75 76set (SRC_FILES 77 src/main.cpp 78 src/WLContext.cpp 79 src/WLEGLSurface.cpp 80 src/WLEyes.cpp 81 src/WLEyesRenderer.cpp 82 src/WLSurface.cpp 83) 84 85add_executable(EGLWLInputEventExample 86 ${SRC_FILES} 87 ivi-application-protocol.c 88 ${HEADER_FILES} 89 ivi-application-client-protocol.h 90) 91 92add_dependencies(EGLWLInputEventExample 93 wayland-client 94 wayland-cursor 95 wayland-egl 96 ${LIBS} 97) 98 99set(LIBS 100 ${LIBS} 101 ${GLESv2_LIBRARIES} 102 ${WAYLAND_CLIENT_LIBRARIES} 103 ${WAYLAND_CURSOR_LIBRARIES} 104 ${WAYLAND_EGL_LIBRARIES} 105 ${FFI_LIBRARIES} 106 ${EGL_LIBRARIES} 107) 108 109add_definitions(${EGL_CFLAGS}) 110 111target_link_libraries(EGLWLInputEventExample ${LIBS}) 112 113install (TARGETS EGLWLInputEventExample DESTINATION bin) 114