cmake_minimum_required(VERSION 2.6)
+include(CMakeDependentOption)
execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE DAEMONVERSION
execute_process(COMMAND git log --pretty=short WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG)
-
+
PROJECT(AudioManagerDeamon)
+message( STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'" )
+
FIND_PACKAGE(PkgConfig)
-OPTION( WITH_DBUS_WRAPPER
- "Enable Dbus Wrapper Support" ON )
-
+SET(WITH_ENABLED_IPC "CAPI" CACHE STRING "Disable 'NONE' / Enable Common-API 'CAPI' or Dbus 'DBUS' Support")
+
+SET_PROPERTY(CACHE WITH_ENABLED_IPC PROPERTY STRINGS "NONE" "CAPI" "DBUS")
+
OPTION( WITH_DLT
"Enable automotive-DLT Support" ON )
OPTION( WITH_PLUGIN_ROUTING
"Build routing pluings" ON)
-OPTION( WITH_MAIN
- "Build with daemon" ON)
-
OPTION( WITH_TELNET
"build with Telnetserver (can only work with SocketHandler)" ON)
OPTION ( GLIB_DBUS_TYPES_TOLERANT
"build dbus with tolerance towards glib 16bit/32bit handling" ON)
-
+
+IF (WITH_ENABLED_IPC STREQUAL "NONE")
+ SET (ENABLE_NSM OFF)
+ELSE ()
+ SET (ENABLE_NSM ON)
+ENDIF ()
+
+CMAKE_DEPENDENT_OPTION(WITH_NSM "build with NSM support" ON
+ "ENABLE_NSM" OFF)
+
+OPTION ( WITH_NSM
+ "build with NSM support" ON)
+ OPTION ( WITH_DATABASE_STORAGE
+ "build with sqlite as in memory storage" OFF)
+
+SET (WITH_COMMON_API_GEN ON CACHE INTERNAL "hide this!" FORCE)
+
+IF (WITH_ENABLED_IPC STREQUAL "DBUS")
+ SET (WITH_DBUS_WRAPPER ON CACHE INTERNAL "hide this!" FORCE)
+ SET (WITH_CAPI_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+ELSEIF(WITH_ENABLED_IPC STREQUAL "CAPI")
+ SET (WITH_CAPI_WRAPPER ON CACHE INTERNAL "hide this!" FORCE)
+ SET (WITH_DBUS_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+
+ MACRO(INSERT_DBUS_CONF_IF_NEEDED IN_PLACEHOLDER IN_SRC_DBUS_CONF OUT_DST_DBUS_CONF)
+ # Checks the variable in the template
+ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in )
+ FILE(WRITE ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in
+ "################################################ CMAKE GENERATED #################################################")
+ endif( )
+
+ FILE(READ ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in DBUS_CONF_IN)
+ if( NOT DBUS_CONF_IN MATCHES ${IN_PLACEHOLDER} )
+ if( NOT DBUS_CONF_IN STREQUAL "" )
+ FILE(APPEND ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in "\r\n\r\n")
+ endif( )
+ FILE(APPEND ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${IN_PLACEHOLDER})
+ endif( )
+ # Reads out the common-api dbus configuration for the node state manager.
+ FILE(READ ${IN_SRC_DBUS_CONF} ${OUT_DST_DBUS_CONF})
+ ENDMACRO(INSERT_DBUS_CONF_IF_NEEDED)
+
+ ELSEIF(WITH_ENABLED_IPC STREQUAL "NONE")
+ SET (WITH_CAPI_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+ SET (WITH_DBUS_WRAPPER OFF CACHE INTERNAL "hide this!" FORCE)
+ENDIF ()
+
+IF (NOT WITH_DBUS_WRAPPER AND NOT WITH_CAPI_WRAPPER)
+ SET (WITH_NSM OFF)
+ENDIF (NOT WITH_DBUS_WRAPPER AND NOT WITH_CAPI_WRAPPER)
+
#Can be changed via passing -DDBUS_SERVICE_PREFIX="XXX" to cmake
IF(NOT DEFINED DBUS_SERVICE_PREFIX)
SET( DBUS_SERVICE_PREFIX "org.genivi.audiomanager\0")
#Can be changed via passing -DDEFAULT_TELNETPORT="XXX" to cmake
IF(NOT DEFINED DEFAULT_TELNETPORT)
- SET( DEFAULT_TELNETPORT 6060 )
+ SET( DEFAULT_TELNETPORT 6080 )
ENDIF(NOT DEFINED DEFAULT_TELNETPORT)
#Can be changed via passing -DMAX_TELNETCONNECTIONS="XXX" to cmake
SET( MAX_TELNETCONNECTIONS 3 )
ENDIF(NOT DEFINED MAX_TELNETCONNECTIONS)
+#Can be changed via passing -DNSM_BUS_INTERFACE="XXX" to cmake
+IF(NOT DEFINED NSM_BUS_INTERFACE)
+ SET( NSM_BUS_INTERFACE "org.genivi.NodeStateManager")
+ENDIF(NOT DEFINED NSM_BUS_INTERFACE)
+
+#Can be changed via passing -DNSM_PATH="XXX" to cmake
+IF(NOT DEFINED NSM_PATH)
+ SET( NSM_PATH "/org/genivi/NodeStateManager")
+ENDIF(NOT DEFINED NSM_PATH)
+
+#Can be changed via passing -DNSM_INTERFACE="XXX" to cmake
+IF(NOT DEFINED NSM_INTERFACE)
+ SET( NSM_INTERFACE "org.genivi.NodeStateManager.Consumer")
+ENDIF(NOT DEFINED NSM_INTERFACE)
+
SET(PLUGINS_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/plugins)
SET(LIB_INSTALL_SUFFIX "audioManager")
SET(DOXY_PROTOTYPE ${CMAKE_SOURCE_DIR}/cmake/DoxyFile.in)
SET(DOXY_FILE ${CMAKE_CURRENT_BINARY_DIR}/DoxyFile)
-CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/cmake/config.cmake ${CMAKE_SOURCE_DIR}/include/config.h )
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/docx/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/DoxyFile )
IF(WITH_DLT)
IF(WITH_DOCUMENTATION)
find_package(Doxygen)
configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE)
+ configure_file("README.html" ${DOC_OUTPUT_PATH}/html/README.html)
add_custom_target (AudioManangerDoku ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
SOURCES ${CMAKE_SOURCE_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
ENDIF(WITH_DOCUMENTATION)
##global build flags set(CPACK_RPM_COMPONENT_INSTALL ON)
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE -pedantic -Wno-variadic-macros -Wno-long-long")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=gnu++0x -D_GNU_SOURCE -pedantic -Wno-variadic-macros -Wno-long-long")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE")
+
if(WITH_PLUGIN_COMMAND)
- add_subdirectory (PluginCommandInterfaceDbus)
+ if(WITH_DBUS_WRAPPER)
+ add_subdirectory (PluginCommandInterfaceDbus)
+ elseif(WITH_CAPI_WRAPPER)
+ add_subdirectory (PluginCommandInterfaceCAPI)
+ endif()
endif(WITH_PLUGIN_COMMAND)
if(WITH_PLUGIN_ROUTING)
- add_subdirectory (PluginRoutingInterfaceDbus)
-# add_subdirectory (PluginRoutingInterfaceAsync)
+ add_subdirectory (PluginRoutingInterfaceAsync)
+ if(WITH_DBUS_WRAPPER)
+ add_subdirectory (PluginRoutingInterfaceDbus)
+ elseif(WITH_CAPI_WRAPPER)
+ add_subdirectory (PluginRoutingInterfaceCAPI)
+ endif()
endif(WITH_PLUGIN_ROUTING)
if(WITH_PLUGIN_CONTROL)
add_subdirectory (PluginControlInterface)
endif(WITH_PLUGIN_CONTROL)
-if(WITH_MAIN)
- add_subdirectory (AudioManagerDaemon)
-endif(WITH_MAIN)
+add_subdirectory (AudioManagerDaemon)
+
IF(EXISTS "${CMAKE_SOURCE_DIR}/ProjectSpecific/")
add_subdirectory (ProjectSpecific)