LayerManagerService: divided into LayerManagerBase and LayerManagerService
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Fri, 30 Nov 2012 12:52:52 +0000 (04:52 -0800)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Mon, 14 Jan 2013 08:34:16 +0000 (00:34 -0800)
LayerManagerBase is a static library containing the whole LayerManager
base implementation, e.g. Scene, PluginLoading, ...
This allows other components to directly link to this implementation
(e.g. unit tests)

LayerManagerService contains only the main.cpp file and links to
LayerManagerBase library.

Additionally, some component dependencies have been improved.

Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
LayerManagerBase/include/LmScreen.h [moved from LayerManagerService/include/LmScreen.h with 100% similarity]
LayerManagerBase/include/LmScreenList.h [moved from LayerManagerService/include/LmScreenList.h with 100% similarity]
LayerManagerCommands/CMakeLists.txt
LayerManagerPlugins/Communicators/GenericCommunicator/CMakeLists.txt
LayerManagerPlugins/SceneProvider/ExampleSceneProvider/src/ExampleSceneProvider.cpp
LayerManagerService/CMakeLists.txt
LayerManagerUtils/CMakeLists.txt

index 19fe033..6887fe7 100644 (file)
 
 cmake_minimum_required (VERSION 2.6)
 
-include_directories ("include")
-include_directories ("${PROJECT_SOURCE_DIR}/config")
-include_directories ("${PROJECT_SOURCE_DIR}/LayerManagerService/include")
-include_directories ("${PROJECT_SOURCE_DIR}/LayerManagerUtils/include")
+project(LayerManagerCommands)
+
+include_directories(
+    include
+    ${CMAKE_SOURCE_DIR}/config
+    ${CMAKE_SOURCE_DIR}/LayerManagerService/include
+    ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include
+)
 
 file(GLOB LM_SOURCES src/*.cpp)
 file(GLOB LM_INCLUDES include/*.h)
 
-add_library(LayerManagerCommands SHARED ${LM_SOURCES})
+if (WITH_STATIC_PLUGINS)
+    add_library(${PROJECT_NAME} STATIC ${LM_SOURCES})
+else (WITH_STATIC_PLUGINS)
+    add_library(${PROJECT_NAME} SHARED ${LM_SOURCES})
+endif (WITH_STATIC_PLUGINS)
 
-set(LIBS ${LIBS} LayerManagerUtils)
-target_link_libraries(LayerManagerCommands ${LIBS})
+set(LIBS ${LIBS} LayerManagerUtils LayerManagerBase)
+target_link_libraries(${PROJECT_NAME} ${LIBS})
 
-install (TARGETS LayerManagerCommands DESTINATION lib)
+install (TARGETS ${PROJECT_NAME} DESTINATION lib)
 install (FILES ${LM_INCLUDES} DESTINATION include/layermanager)
index c9cf975..1f4ca4d 100644 (file)
@@ -21,8 +21,6 @@ cmake_minimum_required (VERSION 2.6)
 
 project(GenericCommunicator)
 
-find_package(Threads)
-
 include_directories(
     "include"
     "${CMAKE_SOURCE_DIR}/LayerManagerClient/ilmClient/include"
index 7cc97ac..b3c2a5d 100644 (file)
@@ -104,7 +104,7 @@ bool ExampleSceneProvider::delegateScene()
             renderOrder[i]=gInitialLayerScene[i].layer;
         }        
         /* Finally set the first executed renderorder */
-        result &= mExecutor.execute(new ScreenSetRenderOrderCommand(layermanagerPid, renderOrder, numberOfLayers));
+        result &= mExecutor.execute(new ScreenSetRenderOrderCommand(layermanagerPid, 0, renderOrder, numberOfLayers));
         result &= mExecutor.execute(new CommitCommand(layermanagerPid));
     }
     
index 2207e59..5777a37 100644 (file)
 cmake_minimum_required (VERSION 2.6)
 
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker -export-dynamic")
+
 if (WITH_DLT)
-find_package(AutomotiveDlt REQUIRED)
-include_directories(${DLT_INCLUDE_DIR})
+    find_package(AutomotiveDlt REQUIRED)
+    include_directories(${DLT_INCLUDE_DIR})
 endif (WITH_DLT)
 
-include_directories ("include")
-include_directories ("${CMAKE_SOURCE_DIR}/config")
-include_directories ("${CMAKE_SOURCE_DIR}/LayerManagerUtils/include")
-include_directories ("${CMAKE_SOURCE_DIR}/LayerManagerCommands/include")
+include_directories(
+    include
+    ${CMAKE_SOURCE_DIR}/config
+    ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include
+    ${CMAKE_SOURCE_DIR}/LayerManagerCommands/include
+)
 
-file(GLOB LM_SOURCES src/*.cpp src/shader/*.cpp)
-file(GLOB LM_INCLUDES include/*.h)
+set(SRC_FILES
+    src/Configuration.cpp
+    src/GraphicalObject.cpp
+    src/GraphicalSurface.cpp
+    src/InputManager.cpp
+    src/Layermanager.cpp
+    src/PluginBase.cpp
+    src/PluginManager.cpp
+    src/Scene.cpp
+    src/SignalHandler.cpp
+    src/shader/Shader.cpp
+    src/shader/ShaderProgram.cpp
+    src/shader/ShaderProgramFactory.cpp
+    src/shader/ShaderUniform.cpp
+)
 
-add_executable(LayerManagerService ${LM_SOURCES} ${LM_INCLUDES} ${CMAKE_SOURCE_DIR}/config/config.h)
+add_library(LayerManagerBase STATIC ${SRC_FILES})
 
-add_dependencies(LayerManagerService LayerManagerUtils)
-add_dependencies(LayerManagerService LayerManagerCommands)
+add_executable(LayerManagerService src/main.cpp)
 
+add_dependencies(LayerManagerService LayerManagerBase)
+
+add_dependencies(LayerManagerBase
+    LayerManagerUtils
+)
 
 find_package (Threads)
 set(LIBS ${LIBS}
-    LayerManagerUtils 
-    LayerManagerCommands
+    LayerManagerUtils
     dl
     ${CMAKE_THREAD_LIBS_INIT}
     ${DLT_LIBRARY}
     ${STATICALLY_LINKED_PLUGINS}
 ) 
 
-target_link_libraries(LayerManagerService ${LIBS})
+target_link_libraries(LayerManagerBase ${LIBS})
+
+target_link_libraries(LayerManagerService LayerManagerBase)
+
+file(GLOB LM_INCLUDES include/*.h)
 
 install (TARGETS LayerManagerService DESTINATION bin)
 install (FILES ${LM_INCLUDES} DESTINATION include/layermanager)
 
 
 if (WITH_TESTS)
-enable_testing()
-set (CMAKE_CXX_FLAGS "")
-add_executable(LayerManagerService_Test
-    tests/SceneTest.cpp
-    tests/ScreenTest.cpp
-    tests/LayermanagerTest.cpp
-    tests/InputManagerTest.cpp
-    tests/GraphicalObjectTest.cpp
-    tests/GraphicalGroupTest.cpp
-    tests/GraphicalSurfaceTest.cpp
-    tests/SurfaceTest.cpp
-    tests/LayerTest.cpp
-    tests/ShaderTest.cpp
-    tests/ShaderUniformTest.cpp
-    tests/ShaderProgramTest.cpp
-    tests/ShaderProgramFactoryTest.cpp
-    tests/RectangleTest.cpp
-    
-    src/GraphicalObject.cpp
-    src/GraphicalSurface.cpp
-    src/Layermanager.cpp
-    src/InputManager.cpp
-    src/PluginManager.cpp
-    src/PluginBase.cpp
-    src/PluginManager.cpp
-    src/Scene.cpp
-    src/shader/Shader.cpp
-    src/shader/ShaderProgram.cpp
-    src/shader/ShaderProgramFactory.cpp
-    src/shader/ShaderUniform.cpp
-    src/Configuration.cpp
-)
-target_link_libraries(LayerManagerService_Test ${LIBS} gtest gmock)
 
-add_test(LayerManagerService LayerManagerService_Test )
+    find_package (Threads)
+
+    enable_testing()
+
+    set (CMAKE_CXX_FLAGS "")
+
+    add_executable(LayerManagerService_Test
+        tests/SceneTest.cpp
+        tests/ScreenTest.cpp
+        tests/LayermanagerTest.cpp
+        tests/InputManagerTest.cpp
+        tests/GraphicalObjectTest.cpp
+        tests/GraphicalGroupTest.cpp
+        tests/GraphicalSurfaceTest.cpp
+        tests/SurfaceTest.cpp
+        tests/LayerTest.cpp
+        tests/ShaderTest.cpp
+        tests/ShaderUniformTest.cpp
+        tests/ShaderProgramTest.cpp
+        tests/ShaderProgramFactoryTest.cpp
+        tests/RectangleTest.cpp
+    )
+
+    target_link_libraries(LayerManagerService_Test
+        ${LIBS}
+        LayerManagerBase
+        gtest
+        gmock
+        ${CMAKE_THREAD_LIBS_INIT}
+    )
+
+    add_test(LayerManagerService LayerManagerService_Test)
 
 endif(WITH_TESTS) 
 
index 9f11a82..439b837 100644 (file)
@@ -21,6 +21,8 @@ cmake_minimum_required (VERSION 2.6)
 
 project(LayerManagerUtils)
 
+find_package (Threads)
+
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
 
 add_library(${PROJECT_NAME} STATIC
@@ -38,24 +40,25 @@ set(INCLUDE_DIRS
 
 set(LIBS
     ${LIBS}
+    ${CMAKE_THREAD_LIBS_INIT}
 )
 
 if (WITH_DLT)
 
     find_package(AutomotiveDlt REQUIRED)
-    
+
     set(INCLUDE_DIRS
         ${INCLUDE_DIRS}
         ${DLT_INCLUDE_DIR}
     )
-    
+
     set(LIBS
         ${LIBS}
         ${DLT_LIBRARY}
     )
-    
+
     target_link_libraries(${PROJECT_NAME} ${LIBS})
-    
+
 endif (WITH_DLT)
 
 include_directories(${INCLUDE_DIRS})
@@ -87,13 +90,14 @@ if (WITH_TESTS)
     )
 
     target_link_libraries(${PROJECT_NAME}_Test
+        ${LIBS}
         LayerManagerUtils
         gtest
         pthread
         ${DLT_LIBRARY}
     )
-    
+
     enable_testing()
     add_test(${PROJECT_NAME} ${PROJECT_NAME}_Test)
-    
+
 endif(WITH_TESTS)