doc: updated release notes for 1.0 release
[profile/ivi/layer-management.git] / CMakeLists.txt
index 90eaa83..da4bd73 100644 (file)
 cmake_minimum_required (VERSION 2.6)
 project (LayerManager)
 
+#===========================================================================================================
+# cmake configuration
+#===========================================================================================================
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
-
+include(${CMAKE_MODULE_PATH}/DefaultSettings.txt)
 include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
-
-#==============================================================================
-# set default build type, if not defined by user
-#==============================================================================
-if (NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE Release CACHE STRING
-                         "Choose build type: Debug, Release, RelWithDebInfo, MinSizeRel."
-                         FORCE)
-    message(STATUS "Build type not defined. Using default build type 'Release'.")
-endif (NOT CMAKE_BUILD_TYPE)
-
-
-#==============================================================================
-# Platforms / A set of indiviual options at once
-#==============================================================================
-option (WITH_X11_GLES       "Build for X11 with GLES 2.0"                         ON )
-option (WITH_GLESv2_LIB     "Build development library for GLES2 Based Renderers" OFF)
-option (WITH_EGL_EXAMPLE    "Build EGL_EXAMPLE / X11"                             ON )
-option (WITH_WL_EXAMPLE     "Build EGL_EXAMPLE / Wayland"                         OFF)
-option (WITH_DESKTOP        "Build for Desktop / GLX"                             OFF)
-option (WITH_GLX_LIB        "Build development library for GLX Based Renderers"   OFF)
-option (WITH_GLX_EXAMPLE    "Build GLX_EXAMPLE "                                  OFF)
-option (WITH_FORCE_COPY     "Force Software Copy of Pixmaps"                      OFF)
-option (WITH_CLIENTEXAMPLES "Build client examples "                              ON )
-option (WITH_TESTS          "Build Available Tests "                              OFF)
-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_DRM    "Build Wayland with drm backend"                      OFF)
-
-option (WITH_SERVICE_BIN    "Build LayerManagerService Binary"                    ON)
-option (WITH_CLIENT_LIB     "Build LayerManagement Client Lib"                    ON)
-option (WITH_COMMUNICATOR_GEN "Build Generic Communicator Plugin"                 ON)
-
-option (WITH_PLUGIN_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd health monitoring" OFF)
-
-option (WITH_TEXT_RENDERER  "Build renderer renderer (only logging)"              OFF)
-
-option (WITH_PLUGIN_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin for example applciations" OFF)
-
-
-#==============================================================================
-# Internal global settings not available to user
-#==============================================================================
-set (WITH_WAYLAND    OFF)
-set (BUILD_UTILS_LIB  OFF)
-set (INSTALL_UTILS_LIB  OFF)
-
-
-#==============================================================================
-# make sure, only one wayland based renderer was selected
-#==============================================================================
-set(NumberOfWaylandRenderers 0)
-
-if (WITH_WAYLAND_X11)
-    set (WITH_GLESv2_LIB ON)
-    set (WITH_WAYLAND ON)
-    MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
-endif(WITH_WAYLAND_X11)
-
-if (WITH_WAYLAND_FBDEV)
-    set (WITH_GLESv2_LIB)
-    set (WITH_WAYLAND ON)
-    MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
-endif(WITH_WAYLAND_FBDEV)
-
-if (WITH_WAYLAND_DRM)
-    set (WITH_GLESv2_LIB ON)
-    set (WITH_WAYLAND ON)
-    MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
-endif(WITH_WAYLAND_DRM)
-
-if(NumberOfWaylandRenderers GREATER 1) 
-    MESSAGE(FATAL_ERROR "More than one Wayland based renderer was selected. This is not supported.")
-endif(NumberOfWaylandRenderers GREATER 1)
-
-
-#==============================================================================
-# set default build parameters
-#==============================================================================
+include(${CMAKE_MODULE_PATH}/CustomMacros.txt)
 add_subdirectory(cmake/optionalFeatures)
-add_subdirectory(config)
-
-include_directories ("${PROJECT_SOURCE_DIR}/config")
-include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
-# ilm_types are used internally to LM, so we can include them by default
-include_directories ("${PROJECT_SOURCE_DIR}/LayerManagerClient/ilmClient/include")
-
-
-#==============================================================================
-# default compiler settings for 3rd party components
-#==============================================================================
-
-add_subdirectory (3rdParty)
 
+#===========================================================================================================
+build_flag (WITH_FORCE_COPY "Force Software Copy of Pixmaps (compatibility for VMs)" OFF)
+#===========================================================================================================
+# no dedicated actions required here
+
+#===========================================================================================================
+build_flag (WITH_DLT "Build with DLT logging support" OFF)
+#===========================================================================================================
+# no dedicated actions required here
+
+#===========================================================================================================
+build_flag (WITH_STATIC_LIBRARIES "Link all plugins and libraries statically" OFF)
+#===========================================================================================================
+# no dedicated actions required here
+
+#===========================================================================================================
+build_flag (WITH_STYLE_CHECKING "Report styleguide problems during build (requires python)" OFF)
+#===========================================================================================================
+if (WITH_STYLE_CHECKING)
+    set(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}; echo 'Checking style...<SOURCE>'; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py <SOURCE>")
+    set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py <SOURCE>")
+endif (WITH_STYLE_CHECKING)
+add_custom_target(check-style COMMAND ${CMAKE_SOURCE_DIR}/scripts/check_style.sh)
+
+#===========================================================================================================
+build_flag (WITH_DOCUMENTATION "Generate documentation during build (requires doxygen)" OFF)
+#===========================================================================================================
+if (WITH_DOCUMENTATION)
+    add_custom_target(doc ALL
+                      COMMAND ${CMAKE_SOURCE_DIR}/generate_specification.sh
+                      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+else (WITH_DOCUMENTATION)
+    add_custom_target(doc
+                      COMMAND ${CMAKE_SOURCE_DIR}/generate_specification.sh
+                      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+endif (WITH_DOCUMENTATION)
+
+#===========================================================================================================
+build_flag (WITH_TESTS "Build unit test binaries for all enabled components" OFF)
+#===========================================================================================================
+if (WITH_TESTS)
+    # enable ctest if building with tests, run 'make test' after build to run all tests
+    # be aware that some tests require a running layermanager
+    enable_testing()
+    add_subdirectory_once (3rdParty/gtest)
+    add_subdirectory_once (3rdParty/gmock)
+endif(WITH_TESTS)
 
-#==============================================================================
-# use strict compiler settings for examples
-#------------------------------------------------------------------------------
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
-#==============================================================================
-
+#===========================================================================================================
+build_flag (WITH_EGL_EXAMPLE "Build examples for GLES/X11 based platforms" ON)
+#===========================================================================================================
 if (WITH_EGL_EXAMPLE)
-    add_subdirectory (LayerManagerExamples/EGLX11ApplicationExample)
-    add_subdirectory (LayerManagerExamples/EGLX11MockNavigation)
-    set (BUILD_UTILS_LIB ON)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerClient/ilmClient)
+    add_subdirectory_once (LayerManagerClient/ilmControl)
+    add_subdirectory_once (LayerManagerExamples/EGLX11ApplicationExample)
+    add_subdirectory_once (LayerManagerExamples/EGLX11MockNavigation)
 endif(WITH_EGL_EXAMPLE)
 
+#===========================================================================================================
+build_flag (WITH_GLX_EXAMPLE "Build examples for OpenGL/X11 based platforms" OFF)
+#===========================================================================================================
 if (WITH_GLX_EXAMPLE)
-    add_subdirectory (LayerManagerExamples/GLXApplicationExample)
-    set (BUILD_UTILS_LIB ON)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerClient/ilmClient)
+    add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
 endif(WITH_GLX_EXAMPLE)
 
+#===========================================================================================================
+build_flag (WITH_CLIENTEXAMPLES "Build examples for client library usage" ON)
+#===========================================================================================================
 if (WITH_CLIENTEXAMPLES)
-    add_subdirectory (LayerManagerExamples/LayerManagerClientExample)
-    add_subdirectory (LayerManagerExamples/LayerManagerControl)
-    set (BUILD_UTILS_LIB ON)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerClient/ilmClient)
+    add_subdirectory_once (LayerManagerExamples/LayerManagerClientExample)
 endif(WITH_CLIENTEXAMPLES)
 
+#===========================================================================================================
+build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
+#===========================================================================================================
 if (WITH_WL_EXAMPLE)
-    add_subdirectory (LayerManagerExamples/EGLWLApplicationExample)
-    add_subdirectory (LayerManagerExamples/EGLWLMockNavigation)
-    add_subdirectory (LayerManagerExamples/WLChromakeyExample)
-    add_subdirectory (LayerManagerExamples/EGLWLInputEventExample)
-    set (BUILD_UTILS_LIB ON)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerClient/ilmClient)
+    add_subdirectory_once (LayerManagerExamples/EGLWLApplicationExample)
+    add_subdirectory_once (LayerManagerExamples/EGLWLMockNavigation)
+    add_subdirectory_once (LayerManagerExamples/WLChromakeyExample)
+    add_subdirectory_once (LayerManagerExamples/EGLWLInputEventExample)
 endif(WITH_WL_EXAMPLE)
 
-#==============================================================================
-# use very strict compiler settings for internal components
-#------------------------------------------------------------------------------
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
-#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
-#==============================================================================
-
-if (WITH_PLUGIN_EXAMPLE_SCENE_PROVIDER)
-    add_subdirectory (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
-endif(WITH_PLUGIN_EXAMPLE_SCENE_PROVIDER)
-
-if (WITH_PLUGIN_SYSTEMD_HEALTH_MONITOR)
-    add_subdirectory (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
-endif(WITH_PLUGIN_SYSTEMD_HEALTH_MONITOR)
+#===========================================================================================================
+build_flag (WITH_CONTROL_BIN "Build LayerManagerControl binary" ON)
+#===========================================================================================================
+if (WITH_CONTROL_BIN)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerClient/ilmClient)
+    add_subdirectory_once (LayerManagerClient/ilmControl)
+    add_subdirectory_once (LayerManagerControl)
+endif(WITH_CONTROL_BIN)
+
+#===========================================================================================================
+build_flag (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin to run example applications" OFF)
+#===========================================================================================================
+if (WITH_EXAMPLE_SCENE_PROVIDER)
+    add_subdirectory_once (LayerManagerCommands)
+    add_subdirectory_once (LayerManagerBase)
+    add_subdirectory_once (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
+endif(WITH_EXAMPLE_SCENE_PROVIDER)
+
+#===========================================================================================================
+build_flag (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd based health monitoring" OFF)
+#===========================================================================================================
+if (WITH_SYSTEMD_HEALTH_MONITOR)
+    add_subdirectory_once (3rdParty/systemd)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerBase)
+    add_subdirectory_once (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
+endif(WITH_SYSTEMD_HEALTH_MONITOR)
+
+#===========================================================================================================
+build_flag (WITH_GENERIC_COMMUNICATOR "Build Generic Communicator Plugin based on IpcModules" ON)
+#===========================================================================================================
+if (WITH_GENERIC_COMMUNICATOR)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerBase)
+    add_subdirectory_once (LayerManagerPlugins/IpcModules)
+    add_subdirectory_once (LayerManagerCommands)
+    add_subdirectory_once (LayerManagerPlugins/Communicators/GenericCommunicator)
+endif(WITH_GENERIC_COMMUNICATOR)
+
+#===========================================================================================================
+build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
+#===========================================================================================================
+if (WITH_DESKTOP)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
+endif(WITH_DESKTOP)
+
+#===========================================================================================================
+build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
+#===========================================================================================================
+if (WITH_GLX_LIB)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
+endif(WITH_GLX_LIB)
+
+#===========================================================================================================
+build_flag (WITH_WAYLAND_X11 "Build renderer plugin for GLES/Wayland with X11 backend" OFF)
+#===========================================================================================================
+if (WITH_WAYLAND_X11)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerBase)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
+endif(WITH_WAYLAND_X11)
 
-if (WITH_COMMUNICATOR_GEN)
-    add_subdirectory (LayerManagerCommands)
-    add_subdirectory (LayerManagerPlugins/Communicators/GenericCommunicator)
-endif(WITH_COMMUNICATOR_GEN)
+#===========================================================================================================
+build_flag (WITH_WAYLAND_X11_LIB "Build development library for GLES/Wayland X11 based renderers" OFF)
+#===========================================================================================================
+if (WITH_WAYLAND_X11_LIB)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
+endif(WITH_WAYLAND_X11_LIB)
+
+#===========================================================================================================
+build_flag (WITH_WAYLAND_DRM "Build renderer plugin for GLES/Wayland with DRM backend" OFF)
+#===========================================================================================================
+if (WITH_WAYLAND_DRM)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerBase)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
+endif(WITH_WAYLAND_DRM)
 
-if (WITH_DESKTOP)
-    set (WITH_GLX_LIB ON CACHE BOOL "Build X11 GLX development lib" FORCE)
-    add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
-endif(WITH_DESKTOP)     
-
-if (WITH_WAYLAND)
-    if (WITH_WAYLAND_VIVANTE_GAL)
-        add_subdirectory (LayerManagerPlugins/Renderers/Platform/WaylandVivanteRenderer)
-    else (WITH_WAYLAND_VIVANTE_GAL)
-        add_subdirectory (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
-    endif (WITH_WAYLAND_VIVANTE_GAL)
-endif(WITH_WAYLAND)
+#===========================================================================================================
+build_flag (WITH_WAYLAND_DRM_LIB "Build development library for GLES/Wayland DRM based renderers" OFF)
+#===========================================================================================================
+if (WITH_WAYLAND_DRM_LIB)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
+endif(WITH_WAYLAND_DRM_LIB)
+
+#===========================================================================================================
+build_flag (WITH_WAYLAND_FBDEV "Build renderer plugin for GLES/Wayland with FBDEV backend" OFF)
+#===========================================================================================================
+if (WITH_WAYLAND_FBDEV)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerBase)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
+endif(WITH_WAYLAND_FBDEV)
 
+#===========================================================================================================
+build_flag (WITH_WAYLAND_FBDEV_LIB "Build development library for GLES/Wayland FBDEV based renderers" OFF)
+#===========================================================================================================
+if (WITH_WAYLAND_FBDEV_LIB)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
+endif(WITH_WAYLAND_FBDEV_LIB)
+
+#===========================================================================================================
+build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
+#===========================================================================================================
 if (WITH_X11_GLES)
-    set (WITH_GLESv2_LIB ON CACHE BOOL "Build X11 GLES development lib" FORCE)
-    add_subdirectory (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
 endif(WITH_X11_GLES)
 
+#===========================================================================================================
+build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
+#===========================================================================================================
+if (WITH_GLESv2_LIB)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
+endif(WITH_GLESv2_LIB)
+
+#===========================================================================================================
+build_flag (WITH_TEXT_RENDERER "Build renderer plugin with pure logging (no rendering)" OFF)
+#===========================================================================================================
 if (WITH_TEXT_RENDERER)
-    add_subdirectory (LayerManagerPlugins/Renderers/Platform/TextRenderer)
+    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
 endif(WITH_TEXT_RENDERER)
 
-if (WITH_SERVICE_BIN OR WITH_CLIENT_LIB)
-    add_subdirectory (LayerManagerPlugins/IpcModules)
-
-    if (WITH_SERVICE_BIN)
-        add_subdirectory (LayerManagerPlugins/Renderers/Graphic)
-        add_subdirectory (LayerManagerService)
-        set (BUILD_UTILS_LIB ON)
-        set (INSTALL_UTILS_LIB ON)
-    endif (WITH_SERVICE_BIN)
-
-    if (WITH_CLIENT_LIB)
-        add_subdirectory (LayerManagerClient/ilmClient)
-    endif (WITH_CLIENT_LIB)
-
-endif (WITH_SERVICE_BIN OR WITH_CLIENT_LIB)
-
-#==============================================================================
-# build internal libraries, if required by other components
-#==============================================================================
-if (BUILD_UTILS_LIB)
-    add_subdirectory (LayerManagerUtils)
-endif (BUILD_UTILS_LIB)
-
-#==============================================================================
-# enable ctest if building with tests
-# run 'make test' after build to run all tests
-# be aware that some tests require a running layermanager
-#==============================================================================
-if (WITH_TESTS)
-    enable_testing()
-endif(WITH_TESTS)
+#===========================================================================================================
+build_flag (WITH_SERVICE_BIN "Build LayerManagerService binary" ON)
+#===========================================================================================================
+if (WITH_SERVICE_BIN)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerBase)
+    add_subdirectory_once (LayerManagerService)
+endif (WITH_SERVICE_BIN)
+
+#===========================================================================================================
+build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
+#===========================================================================================================
+if (WITH_CLIENT_LIB)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerPlugins/IpcModules)
+    add_subdirectory_once (LayerManagerClient/ilmCommon)
+    add_subdirectory_once (LayerManagerClient/ilmClient)
+endif (WITH_CLIENT_LIB)
+
+#===========================================================================================================
+build_flag (WITH_CONTROL_LIB "Build LayerManagement control library" OFF)
+#===========================================================================================================
+if (WITH_CONTROL_LIB)
+    add_subdirectory_once (LayerManagerUtils)
+    add_subdirectory_once (LayerManagerPlugins/IpcModules)
+    add_subdirectory_once (LayerManagerClient/ilmCommon)
+    add_subdirectory_once (LayerManagerClient/ilmControl)
+endif (WITH_CONTROL_LIB)
+
+#===========================================================================================================
+# store used build configuration
+#===========================================================================================================
+add_subdirectory_once(config)