diff options
author | Timo Lotterbach <timo.lotterbach@bmw-carit.de> | 2014-01-31 15:59:02 +0100 |
---|---|---|
committer | Timo Lotterbach <timo.lotterbach@bmw-carit.de> | 2014-01-31 15:59:02 +0100 |
commit | cdb466a9964496fb23cb014df82b2db3cd75c185 (patch) | |
tree | c4eb1a0f49f4b3696784a1dbbf8ce4dfc19dd923 | |
parent | 2f5d78a15960957ba8cdea0fa217c1b488012bfc (diff) | |
download | wayland-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>
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | ivi-layermanagement-api/ilmClient/CMakeLists.txt | 27 | ||||
-rw-r--r-- | ivi-layermanagement-api/ilmCommon/CMakeLists.txt | 52 | ||||
-rw-r--r-- | ivi-layermanagement-api/ilmControl/CMakeLists.txt | 10 | ||||
-rw-r--r-- | ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt | 93 | ||||
-rw-r--r-- | protocol/CMakeLists.txt | 90 | ||||
-rw-r--r-- | weston-ivi-shell/CMakeLists.txt | 39 |
7 files changed, 178 insertions, 145 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c717f25..c203264 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright 2010-2012 BMW Car IT GmbH +# Copyright 2010-2014 BMW Car IT GmbH # Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh # # @@ -23,11 +23,11 @@ project(wayland-ivi-extension) SET(ILM_VERSION "1.2.0") -#=========================================================================================================== -# cmake configuration -#=========================================================================================================== -add_subdirectory(ivi-layermanagement-api/ilmClient) +add_subdirectory(protocol) + +add_subdirectory(weston-ivi-shell) + add_subdirectory(ivi-layermanagement-api/ilmCommon) +add_subdirectory(ivi-layermanagement-api/ilmClient) add_subdirectory(ivi-layermanagement-api/ilmControl) -add_subdirectory(weston-ivi-shell) add_subdirectory(ivi-layermanagement-examples) diff --git a/ivi-layermanagement-api/ilmClient/CMakeLists.txt b/ivi-layermanagement-api/ilmClient/CMakeLists.txt index 7a86e16..61c17a0 100644 --- a/ivi-layermanagement-api/ilmClient/CMakeLists.txt +++ b/ivi-layermanagement-api/ilmClient/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright 2010-2012 BMW Car IT GmbH +# Copyright 2010-2014 BMW Car IT GmbH # Copyright (C) 2013 DENSO CORPORATION # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,36 +25,33 @@ find_package(Threads) find_package(PkgConfig REQUIRED) pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) +GET_TARGET_PROPERTY(ILM_COMMON_INCLUDE_DIRS ilmCommon INCLUDE_DIRECTORIES) include_directories( - "include" - "${CMAKE_SOURCE_DIR}/config" - "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include" - "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmClient/include" + include + ${ILM_COMMON_INCLUDE_DIRS} ${WAYLAND_CLIENT_INCLUDE_DIR} ) add_library(${PROJECT_NAME} SHARED src/ilm_client.c src/ilm_client_wayland_platform.c - ../ilmCommon/src/ivi-application-protocol.c ) -add_dependencies(${PROJECT_NAME} +set(LIBS + ${LIBS} ilmCommon + ivi-extension-protocol ${WAYLAND_CLIENT_LIBRARIES} ) -set(LIBS +add_dependencies(${PROJECT_NAME} ${LIBS} - ilmCommon - rt - dl - ${CMAKE_THREAD_LIBS_INIT} - ${WAYLAND_CLIENT_LIBRARIES} ) -target_link_libraries(${PROJECT_NAME} ${LIBS}) +target_link_libraries(${PROJECT_NAME} + ${LIBS} +) install ( TARGETS ${PROJECT_NAME} @@ -62,7 +59,7 @@ install ( ) install ( - FILES ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmClient/include/ilm_client.h + FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/ilm_client.h DESTINATION include/ilm ) diff --git a/ivi-layermanagement-api/ilmCommon/CMakeLists.txt b/ivi-layermanagement-api/ilmCommon/CMakeLists.txt index 0c4aa3e..6ed0bf6 100644 --- a/ivi-layermanagement-api/ilmCommon/CMakeLists.txt +++ b/ivi-layermanagement-api/ilmCommon/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright 2010-2012 BMW Car IT GmbH +# Copyright 2010-2014 BMW Car IT GmbH # Copyright (C) 2013 DENSO CORPORATION # # @@ -24,64 +24,30 @@ project(ilmCommon) find_package(Threads) find_package(PkgConfig REQUIRED) -pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED) +pkg_check_modules(WAYLAND_CLIENT wayland-client 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_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ivi-application-client-protocol.h -) - -add_custom_command( - OUTPUT ivi-application-protocol.c - COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code <${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml> ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/src/ivi-application-protocol.c -) - -add_custom_command( - OUTPUT ivi-controller-client-protocol.h - COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header <${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml> ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ivi-controller-client-protocol.h -) - -add_custom_command( - OUTPUT ivi-controller-protocol.c - COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code <${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml> ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/src/ivi-controller-protocol.c -) - -add_custom_target( - generate_wayland_protocol_codes_for_client - DEPENDS ivi-application-client-protocol.h ivi-application-protocol.c ivi-controller-client-protocol.h ivi-controller-protocol.c -) +GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES) include_directories( - "include" - "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include" - ${WAYLAND_CLIENT_INCLUDE_DIR} + include + ${IVI_EXTENSION_INCLUDE_DIRS} + ${WAYLAND_CLIENT_INCLUDE_DIRS} ) - add_library(${PROJECT_NAME} SHARED src/ilm_common.c src/ilm_common_wayland_platform.c - src/ivi-application-protocol.c - src/ivi-controller-protocol.c ) -add_dependencies(${PROJECT_NAME} - generate_wayland_protocol_codes_for_client +target_link_libraries(${PROJECT_NAME} ${WAYLAND_CLIENT_LIBRARIES} ) -set(LIBS - ${LIBS} - rt - dl - ${CMAKE_THREAD_LIBS_INIT} +add_dependencies(${PROJECT_NAME} ${WAYLAND_CLIENT_LIBRARIES} + ivi-extension-protocol ) -target_link_libraries(${PROJECT_NAME} ${LIBS} -ldl) - install ( TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib diff --git a/ivi-layermanagement-api/ilmControl/CMakeLists.txt b/ivi-layermanagement-api/ilmControl/CMakeLists.txt index 83c9ab6..228b85d 100644 --- a/ivi-layermanagement-api/ilmControl/CMakeLists.txt +++ b/ivi-layermanagement-api/ilmControl/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright 2010-2012 BMW Car IT GmbH +# Copyright 2010-2014 BMW Car IT GmbH # Copyright (C) 2013 DENSO CORPORATION # # @@ -26,17 +26,17 @@ find_package(Threads) find_package(PkgConfig REQUIRED) pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) +GET_TARGET_PROPERTY(ILM_COMMON_INCLUDE_DIRS ilmCommon INCLUDE_DIRECTORIES) + include_directories( - "include" - "${CMAKE_SOURCE_DIR}/config" - "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include" + include + ${ILM_COMMON_INCLUDE_DIRS} ${WAYLAND_CLIENT_INCLUDE_DIR} ) add_library(${PROJECT_NAME} SHARED src/ilm_control.c src/ilm_control_wayland_platform.c - ../ilmCommon/src/ivi-controller-protocol.c ) add_dependencies(${PROJECT_NAME} diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt b/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt index 7d0ea43..d184506 100644 --- a/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt +++ b/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright 2010-2012 BMW Car IT GmbH +# Copyright 2010-2014 BMW Car IT GmbH # Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh # # @@ -20,77 +20,82 @@ cmake_minimum_required (VERSION 2.6) +project(EGLWLMockNavigation) + find_package(PkgConfig) pkg_check_modules(GLESv2 glesv2 REQUIRED) pkg_check_modules(EGL egl REQUIRED) pkg_check_modules(WAYLAND_EGL wayland-egl REQUIRED) pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) +GET_TARGET_PROPERTY(ILM_CLIENT_INCLUDE_DIRS ilmClient INCLUDE_DIRECTORIES) +GET_TARGET_PROPERTY(ILM_CONTROL_INCLUDE_DIRS ilmControl INCLUDE_DIRECTORIES) + include_directories( + include + ${ILM_CLIENT_INCLUDE_DIRS} + ${ILM_CONTROL_INCLUDE_DIRS} ${GLESv2_INCLUDE_DIRS} ${EGL_INCLUDE_DIRS} ${WAYLAND_CLIENT_INCLUDE_DIRS} - "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmControl/include" - "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmClient/include" - "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include" - "include" ) set (HEADER_FILES - - include/Camera.h - include/Car.h + include/Camera.h + include/Car.h include/Argument.h - include/OpenGLES2App.h - include/Ground.h - include/House.h - include/IRenderable.h - include/IUpdateable.h - include/MockNavi.h - include/Street.h - include/ShaderBase.h - include/ShaderLighting.h + include/OpenGLES2App.h + include/Ground.h + include/House.h + include/IRenderable.h + include/IUpdateable.h + include/MockNavi.h + include/Street.h + include/ShaderBase.h + include/ShaderLighting.h ) set (SRC_FILES - - src/Camera.cpp - src/Car.cpp + src/Camera.cpp + src/Car.cpp src/Argument.cpp - src/OpenGLES2App.cpp - src/Ground.cpp - src/House.cpp - src/MockNavi.cpp - src/Street.cpp - src/ShaderBase.cpp - src/ShaderLighting.cpp - src/main.cpp - src/WaylandServerinfoProtocol.cpp - src/IlmMatrix.cpp + src/OpenGLES2App.cpp + src/Ground.cpp + src/House.cpp + src/MockNavi.cpp + src/Street.cpp + src/ShaderBase.cpp + src/ShaderLighting.cpp + src/main.cpp + src/WaylandServerinfoProtocol.cpp + src/IlmMatrix.cpp ) -add_executable(EGLWLMockNavigation +add_executable(${PROJECT_NAME} ${SRC_FILES} ${HEADER_FILES} ) -add_dependencies(EGLWLMockNavigation - ilmCommon + +set(LIBS + ${LIBS} + ${GLESv2_LIBRARIES} + ${WAYLAND_CLIENT_LIBRARIES} + ${WAYLAND_EGL_LIBRARIES} + ${EGL_LIBRARIES} ilmClient ilmControl - wayland-client ) -set(LIBS - ${LIBS} - ${GLESv2_LIBRARIES} - ${WAYLAND_CLIENT_LIBRARIES} - ${WAYLAND_EGL_LIBRARIES} - ${EGL_LIBRARIES} - ilmClient - ilmControl +add_dependencies(${PROJECT_NAME} + ${LIBS} ) -target_link_libraries(EGLWLMockNavigation ${LIBS} -ldl) +target_link_libraries(${PROJECT_NAME} + ${LIBS} +) -install (TARGETS EGLWLMockNavigation DESTINATION bin) +install( + TARGETS ${PROJECT_NAME} + DESTINATION bin +) 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 +) diff --git a/weston-ivi-shell/CMakeLists.txt b/weston-ivi-shell/CMakeLists.txt index 92807ec..4cf9295 100644 --- a/weston-ivi-shell/CMakeLists.txt +++ b/weston-ivi-shell/CMakeLists.txt @@ -1,6 +1,7 @@ ############################################################################ # # Copyright (C) 2013 DENSO CORPORATION +# Copyright 2014 BMW Car IT GmbH # # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,35 +28,11 @@ pkg_check_modules(CAIRO cairo REQUIRED) pkg_check_modules(WESTON weston REQUIRED) pkg_check_modules(PIXMAN pixman-1 REQUIRED) -find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) - -add_custom_command( - OUTPUT ivi-application-server-protocol.h - 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 -) - -add_custom_command( - OUTPUT ivi-application-protocol.c - COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code <${CMAKE_SOURCE_DIR}/protocol/ivi-application.xml> ${CMAKE_SOURCE_DIR}/weston-ivi-shell/src/ivi-application-protocol.c -) - -add_custom_command( - OUTPUT ivi-controller-server-protocol.h - 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 -) - -add_custom_command( - OUTPUT ivi-controller-protocol.c - COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code <${CMAKE_SOURCE_DIR}/protocol/ivi-controller.xml> ${CMAKE_SOURCE_DIR}/weston-ivi-shell/src/ivi-controller-protocol.c -) - -add_custom_target( - generate_wayland_protocol_codes_for_server - DEPENDS ivi-application-server-protocol.h ivi-application-protocol.c ivi-controller-server-protocol.h ivi-controller-protocol.c -) +GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES) include_directories( - "include" + include + ${IVI_EXTENSION_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${WESTON_INCLUDE_DIRS} @@ -65,13 +42,12 @@ include_directories( add_library(${PROJECT_NAME} MODULE src/ivi-controller.c - src/ivi-controller-protocol.c ) set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") add_dependencies(${PROJECT_NAME} - generate_wayland_protocol_codes_for_server + ivi-extension-protocol ${WAYLAND_SERVER_LIBRARIES} ${CAIRO_LIBRARIES} ${PIXMAN_LIBRARIES} @@ -80,14 +56,13 @@ add_dependencies(${PROJECT_NAME} set(LIBS ${LIBS} - rt - dl + ivi-extension-protocol ${WAYLAND_SERVER_LIBRARIES} ${CAIRO_LIBRARIES} ${WESTON_LIBRARIES} ) -target_link_libraries(${PROJECT_NAME} ${LIBS} -ldl) +target_link_libraries(${PROJECT_NAME} ${LIBS}) install ( TARGETS ${PROJECT_NAME} |