1############################################################################ 2# 3# \copyright (c) 2012, 2013 Advanced Driver Information Technology. 4# This code is developed by Advanced Driver Information Technology. 5# Copyright of Advanced Driver Information Technology, Bosch, and DENSO. 6# All rights reserved. 7# 8# Licensed under the Apache License, Version 2.0 (the "License"); 9# you may not use this file except in compliance with the License. 10# You may obtain a copy of the License at 11# 12# http://www.apache.org/licenses/LICENSE-2.0 13# 14# Unless required by applicable law or agreed to in writing, software 15# distributed under the License is distributed on an "AS IS" BASIS, 16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17# See the License for the specific language governing permissions and 18# limitations under the License. 19# 20############################################################################ 21 22cmake_minimum_required (VERSION 2.6) 23 24project (generate-protocol-src) 25 26find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) 27 28################################################################ 29 30project (multi-touch-viewer) 31 32find_package(PkgConfig) 33pkg_check_modules(GLESv2 glesv2 REQUIRED) 34pkg_check_modules(EGL egl REQUIRED) 35pkg_check_modules(WAYLAND_EGL wayland-egl REQUIRED) 36pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) 37 38add_custom_command( 39 OUTPUT ivi-application-client-protocol.h 40 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header 41 < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 42 > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-client-protocol.h 43 DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 44) 45 46add_custom_command( 47 OUTPUT ivi-application-protocol.c 48 COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code 49 < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 50 > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-protocol.c 51 DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml 52) 53 54include_directories( 55 include 56 ${CMAKE_CURRENT_BINARY_DIR} 57 ${GLESv2_INCLUDE_DIRS} 58 ${EGL_INCLUDE_DIRS} 59 ${WAYLAND_CLIENT_INCLUDE_DIR} 60) 61 62link_directories( 63 ${GLESv2_LIBRARY_DIRS} 64 ${EGL_LIBRARY_DIRS} 65 ${WAYLAND_CLIENT_LIBRARY_DIRS} 66) 67 68SET(LIBS 69 ${LIBS} 70 ${GLESv2_LIBRARIES} 71 ${WAYLAND_CLIENT_LIBRARIES} 72 ${WAYLAND_EGL_LIBRARIES} 73 ${EGL_LIBRARIES} 74 m 75) 76 77SET(SRC_FILES 78 src/multi-touch-viewer.c 79 src/util.c 80 src/window.c 81) 82 83set(HEADER_FILES 84 include/multi-touch-viewer.h 85 include/util.h 86 include/window.h 87) 88 89add_executable(${PROJECT_NAME} 90 ${SRC_FILES} 91 ivi-application-protocol.c 92 ivi-application-client-protocol.h 93) 94 95add_dependencies(${PROJECT_NAME} ${LIBS}) 96 97add_definitions(${EGL_CFLAGS}) 98 99target_link_libraries(${PROJECT_NAME} ${LIBS}) 100 101install (TARGETS ${PROJECT_NAME} DESTINATION bin) 102