CMake: improved build of LayerManagerGraphicWaylandX11GLESv2
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Wed, 2 Jan 2013 14:05:59 +0000 (06:05 -0800)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Mon, 14 Jan 2013 08:34:17 +0000 (00:34 -0800)
this graphic development lib is now a dedicated component that
can be build independently of other graphic development libs.
this component contains no source code, it uses BaseRenderer and
graphic component source code.

Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
CMakeLists.txt
LayerManagerPlugins/Renderers/Graphic/CMakeLists.txt
LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2/CMakeLists.txt [new file with mode: 0644]

index 5aab638..45f574d 100644 (file)
@@ -54,6 +54,7 @@ option (WITH_TESTS                  "Build Available Tests "
 option (WITH_DLT                    "Build with DLT support "                             OFF)
 option (WITH_WAYLAND_FBDEV          "Build Wayland with FBDEV backend"                    OFF)
 option (WITH_WAYLAND_X11            "Build Wayland with X11 backend"                      OFF)
+option (WITH_WAYLAND_X11_LIB        "Build development library for Wayland X11 Based Renderers" OFF)
 option (WITH_WAYLAND_DRM            "Build Wayland with drm backend"                      OFF)
 option (WITH_SERVICE_BIN            "Build LayerManagerService Binary"                    ON)
 option (WITH_CONTROL_BIN            "Build LayerManagerControl Binary"                    ON)
@@ -200,6 +201,10 @@ if (WITH_WAYLAND)
     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
 endif(WITH_WAYLAND)
 
+if (WITH_WAYLAND_X11_LIB)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
+endif(WITH_WAYLAND_X11_LIB)
+
 if (WITH_X11_GLES)
     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
index a162d82..331cb70 100644 (file)
@@ -47,38 +47,6 @@ if (WITH_WAYLAND)
     include_directories(${WAYLAND_SERVER_INCLUDE_DIR})
 
     #=======================================================================
-    if (WITH_WAYLAND_X11)
-    #=======================================================================
-
-        set(GRAPHIC_LIB_NAME LayerManagerGraphicWaylandGLESv2)
-
-        find_package(X11 REQUIRED)
-        
-        include_directories(${X11_INCLUDE_DIR})
-        
-        set(LIBS
-                ${LIBS}
-                ${X11_X11_LIB}
-                ${WAYLAND_EGL_LIBRARIES}
-                ${XKB_LIBRARIES}
-        )
-        
-        set(SOURCES
-            ../Base/src/BaseRenderer.cpp
-            src/GraphicSystems/GLESGraphicSystem.cpp
-            src/WindowSystems/BaseWindowSystem.cpp
-            src/WindowSystems/WaylandBaseWindowSystem.cpp
-            src/WindowSystems/WaylandX11WindowSystem.cpp
-            src/WindowSystems/WaylandServerinfoProtocol.cpp  
-            src/WindowSystems/WaylandInputDevice.cpp
-            src/WindowSystems/WaylandInputEvent.cpp
-            src/WindowSystems/WaylandX11InputEvent.cpp
-            src/TextureBinders/WaylandGLESTexture.cpp
-        )
-        
-    endif (WITH_WAYLAND_X11)
-    
-    #=======================================================================
     if (WITH_WAYLAND_FBDEV)
     #=======================================================================
 
diff --git a/LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2/CMakeLists.txt b/LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f1f6972
--- /dev/null
@@ -0,0 +1,111 @@
+############################################################################
+#
+# Copyright 2010-2012 BMW Car IT GmbH
+# Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia 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(LayerManagerGraphicWaylandX11GLESv2)
+
+#===========================================================================
+# configuration
+#===========================================================================
+SET(RENDERERBASE_DIR ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Base)
+SET(GRAPHIC_LIB_DIR ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Graphic)
+
+#===========================================================================
+# component
+#===========================================================================
+find_package(Wayland REQUIRED)
+find_package(X11 REQUIRED)
+
+include_directories(
+    ${GRAPHIC_LIB_DIR}/include
+    ${RENDERERBASE_DIR}/include
+    ${CMAKE_SOURCE_DIR}/config
+    ${CMAKE_SOURCE_DIR}/LayerManagerBase/include
+    ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include
+    ${X11_INCLUDE_DIR}
+    ${X11_INCLUDE_DIR}
+    ${WAYLAND_SERVER_INCLUDE_DIR}
+)
+
+set(SOURCES
+    ${RENDERERBASE_DIR}/src/BaseRenderer.cpp
+    ${GRAPHIC_LIB_DIR}/src/GraphicSystems/GLESGraphicSystem.cpp
+    ${GRAPHIC_LIB_DIR}/src/WindowSystems/BaseWindowSystem.cpp
+    ${GRAPHIC_LIB_DIR}/src/WindowSystems/WaylandBaseWindowSystem.cpp
+    ${GRAPHIC_LIB_DIR}/src/WindowSystems/WaylandX11WindowSystem.cpp
+    ${GRAPHIC_LIB_DIR}/src/WindowSystems/WaylandServerinfoProtocol.cpp
+    ${GRAPHIC_LIB_DIR}/src/WindowSystems/WaylandInputDevice.cpp
+    ${GRAPHIC_LIB_DIR}/src/WindowSystems/WaylandInputEvent.cpp
+    ${GRAPHIC_LIB_DIR}/src/WindowSystems/WaylandX11InputEvent.cpp
+    ${GRAPHIC_LIB_DIR}/src/TextureBinders/WaylandGLESTexture.cpp
+)
+
+set(LIBS
+    ${LIBS}
+    ${WAYLAND_SERVER_LIBRARIES}
+    ${WAYLAND_CLIENT_LIBRARIES}
+    ${X11_X11_LIB}
+    ${WAYLAND_EGL_LIBRARIES}
+    ${XKB_LIBRARIES}
+    LayerManagerUtils
+    LayerManagerBase
+)
+
+add_library(${PROJECT_NAME} STATIC ${SOURCES})
+
+target_link_libraries(${PROJECT_NAME} ${LIBS})
+
+add_dependencies(${PROJECT_NAME} ${LIBS})
+
+#===========================================================================
+# install
+#===========================================================================
+install(TARGETS     ${PROJECT_NAME}
+        DESTINATION lib)
+
+install(FILES       ${GRAPHIC_LIB_DIR}/include/GraphicSystems/BaseGraphicSystem.h
+                    ${GRAPHIC_LIB_DIR}/include/GraphicSystems/GLESGraphicSystem.h
+        DESTINATION include/layermanager/graphic/GraphicSystems)
+
+install(FILES       ${GRAPHIC_LIB_DIR}/include/TextureBinders/ITextureBinder.h
+                    ${GRAPHIC_LIB_DIR}/include/TextureBinders/WaylandGLESTexture.h
+        DESTINATION include/layermanager/graphic/TextureBinders)
+
+install(FILES       ${GRAPHIC_LIB_DIR}/include/PlatformSurfaces/WaylandPlatformSurface.h
+                    ${GRAPHIC_LIB_DIR}/include/PlatformSurfaces/EglWaylandPlatformSurface.h
+        DESTINATION include/layermanager/graphic/PlatformSurfaces)
+
+install(FILES       ${GRAPHIC_LIB_DIR}/include/WindowSystems/BaseWindowSystem.h
+                    ${GRAPHIC_LIB_DIR}/include/WindowSystems/WaylandBaseWindowSystem.h
+                    ${GRAPHIC_LIB_DIR}/include/WindowSystems/WaylandX11WindowSystem.h
+        DESTINATION include/layermanager/graphic/WindowSystems)
+
+install(FILES       ${RENDERERBASE_DIR}/include/BaseRenderer.h
+                    ${RENDERERBASE_DIR}/include/RenderUtil.h
+        DESTINATION include/layermanager/graphic/Base)
+
+#===========================================================================
+# test
+#===========================================================================
+if (WITH_TESTS)
+    set (CMAKE_CXX_FLAGS "")
+    enable_testing()
+    #add_subdirectory_once (${GRAPHIC_LIB_DIR}/tests)
+endif(WITH_TESTS)
\ No newline at end of file