summaryrefslogtreecommitdiff
path: root/protocol
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2014-01-31 15:59:02 +0100
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2014-01-31 15:59:02 +0100
commitcdb466a9964496fb23cb014df82b2db3cd75c185 (patch)
treec4eb1a0f49f4b3696784a1dbbf8ce4dfc19dd923 /protocol
parent2f5d78a15960957ba8cdea0fa217c1b488012bfc (diff)
downloadwayland-ivi-extension-cdb466a9964496fb23cb014df82b2db3cd75c185.tar.gz
added ivi-extension-protocol library
this library takes care to generate header and source files from XML files. All generated files are now stored in the build directory. ilmCommon and weston-ivi-shell now just use the new library and don't care about code generation any more. In addition, a lot of duplicated code compilation is removed, resulting in faster builds. This patch also fixes an issue, that file generation was done every time a build was started. This resulted in full rebuilds all the time. Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
Diffstat (limited to 'protocol')
-rw-r--r--protocol/CMakeLists.txt90
1 files changed, 90 insertions, 0 deletions
diff --git a/protocol/CMakeLists.txt b/protocol/CMakeLists.txt
new file mode 100644
index 0000000..89e72c8
--- /dev/null
+++ b/protocol/CMakeLists.txt
@@ -0,0 +1,90 @@
+############################################################################
+#
+# Copyright 2014 BMW Car IT GmbH
+#
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+############################################################################
+
+cmake_minimum_required (VERSION 2.6)
+
+project(ivi-extension-protocol)
+
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED)
+pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED)
+
+find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
+
+add_custom_command(
+ OUTPUT ivi-application-client-protocol.h
+ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header
+ < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml
+ > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-client-protocol.h
+ DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml
+)
+
+add_custom_command(
+ OUTPUT ivi-application-server-protocol.h
+ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header
+ < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml
+ > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-server-protocol.h
+ DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml
+)
+
+add_custom_command(
+ OUTPUT ivi-application-protocol.c
+ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code
+ < ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml
+ > ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-protocol.c
+ DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml
+)
+
+add_custom_command(
+ OUTPUT ivi-controller-client-protocol.h
+ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header
+ < ${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml
+ > ${CMAKE_CURRENT_BINARY_DIR}/ivi-controller-client-protocol.h
+ DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml
+)
+
+add_custom_command(
+ OUTPUT ivi-controller-server-protocol.h
+ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header
+ < ${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml
+ > ${CMAKE_CURRENT_BINARY_DIR}/ivi-controller-server-protocol.h
+ DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml
+)
+
+add_custom_command(
+ OUTPUT ivi-controller-protocol.c
+ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code
+ < ${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml
+ > ${CMAKE_CURRENT_BINARY_DIR}/ivi-controller-protocol.c
+ DEPENDS ${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml
+)
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${WAYLAND_CLIENT_INCLUDE_DIR}
+)
+
+add_library(${PROJECT_NAME} STATIC
+ ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-client-protocol.h
+ ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-server-protocol.h
+ ${CMAKE_CURRENT_BINARY_DIR}/ivi-application-protocol.c
+ ${CMAKE_CURRENT_BINARY_DIR}/ivi-controller-client-protocol.h
+ ${CMAKE_CURRENT_BINARY_DIR}/ivi-controller-server-protocol.h
+ ${CMAKE_CURRENT_BINARY_DIR}/ivi-controller-protocol.c
+)