Release 2.3.0
[profile/ivi/dlt-daemon.git] / CMakeLists.txt
index 76739be..1a18fcd 100755 (executable)
@@ -1,37 +1,37 @@
 #######\r
 # Dlt - Diagnostic Log and Trace\r
-# @licence make begin@
- #
- # Copyright (C) 2011, BMW AG - Alexander Wenzel <alexander.wenzel@bmw.de>
- # 
- # This program is free software; you can redistribute it and/or modify it under the terms of the 
- # GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
- # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even 
- # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General 
- # Public License, version 2.1, for more details.
- # 
- # You should have received a copy of the GNU Lesser General Public License, version 2.1, along 
- # with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
- # 
- # Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may 
- # also be applicable to programs even in cases in which the program is not a library in the technical sense.
- # 
- # Linking DLT statically or dynamically with other modules is making a combined work based on DLT. You may 
- # license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to 
- # license your linked modules under the GNU Lesser General Public License, version 2.1, you 
- # may use the program under the following exception.
- # 
- # As a special exception, the copyright holders of DLT give you permission to combine DLT 
- # with software programs or libraries that are released under any license unless such a combination is not
- # permitted by the license of such a software program or library. You may copy and distribute such a 
- # system following the terms of the GNU Lesser General Public License, version 2.1, including this
- # special exception, for DLT and the licenses of the other code concerned.
- # 
- # Note that people who make modified versions of DLT are not obligated to grant this special exception 
- # for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, 
- # version 2.1, gives permission to release a modified version without this exception; this exception 
- # also makes it possible to release a modified version which carries forward this exception.
- #
+# @licence make begin@\r
+ #\r
+ # Copyright (C) 2011, BMW AG - Alexander Wenzel <alexander.wenzel@bmw.de>\r
+ # \r
+ # This program is free software; you can redistribute it and/or modify it under the terms of the \r
+ # GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.\r
+ # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even \r
+ # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General \r
+ # Public License, version 2.1, for more details.\r
+ # \r
+ # You should have received a copy of the GNU Lesser General Public License, version 2.1, along \r
+ # with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.\r
+ # \r
+ # Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may \r
+ # also be applicable to programs even in cases in which the program is not a library in the technical sense.\r
+ # \r
+ # Linking DLT statically or dynamically with other modules is making a combined work based on DLT. You may \r
+ # license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to \r
+ # license your linked modules under the GNU Lesser General Public License, version 2.1, you \r
+ # may use the program under the following exception.\r
+ # \r
+ # As a special exception, the copyright holders of DLT give you permission to combine DLT \r
+ # with software programs or libraries that are released under any license unless such a combination is not\r
+ # permitted by the license of such a software program or library. You may copy and distribute such a \r
+ # system following the terms of the GNU Lesser General Public License, version 2.1, including this\r
+ # special exception, for DLT and the licenses of the other code concerned.\r
+ # \r
+ # Note that people who make modified versions of DLT are not obligated to grant this special exception \r
+ # for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, \r
+ # version 2.1, gives permission to release a modified version without this exception; this exception \r
+ # also makes it possible to release a modified version which carries forward this exception.\r
+ #\r
  # @licence end@\r
 ########\r
 \r
@@ -42,39 +42,54 @@ SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
 \r
 PROJECT( automotive-dlt )\r
 \r
-# set version parameters\r
+# Set version parameters\r
 SET( ${PROJECT_NAME}_MAJOR_VERSION 2 )\r
-SET( ${PROJECT_NAME}_MINOR_VERSION 2 )\r
+SET( ${PROJECT_NAME}_MINOR_VERSION 3 )\r
 SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )\r
-set(GENIVI_PROJECT_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})\r
 SET( ${PROJECT_NAME}_VERSION_STATE  )\r
-SET( ${PROJECT_NAME}_REVISION 1666 )\r
+SET( GENIVI_PROJECT_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})\r
 \r
-# Write version information into include file\r
 SET( PRINT_MAJOR_VERSION ${${PROJECT_NAME}_MAJOR_VERSION})\r
 SET( PRINT_MINOR_VERSION ${${PROJECT_NAME}_MINOR_VERSION})\r
 SET( PRINT_PATCH_LEVEL ${${PROJECT_NAME}_PATCH_LEVEL})\r
 SET( PRINT_VERSION ${GENIVI_PROJECT_VERSION})\r
 SET( PRINT_VERSION_STATE ${${PROJECT_NAME}_VERSION_STATE})\r
-SET( PRINT_VERSION_REVISION ${${PROJECT_NAME}_REVISION})\r
 \r
-# Print version information\r
-MESSAGE("VERSION ${PRINT_VERSION}")\r
-MESSAGE("VERSION_STATE ${PRINT_VERSION_STATE}")\r
-MESSAGE("REVISION ${PRINT_VERSION_REVISION}")\r
+IF(NOT DEFINED PRINT_REVISION)\r
+       execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} \r
+       OUTPUT_VARIABLE PRINT_REVISION \r
+       OUTPUT_STRIP_TRAILING_WHITESPACE)\r
+ENDIF(NOT DEFINED PRINT_REVISION)\r
 \r
 ##################### RPM CONFIG ########################\r
-\r
-set( GENIVI_RPM_RELEASE "1${SVN_REVISION}")\r
+SET( GENIVI_RPM_RELEASE "1${IDLT_VERSION}")\r
 SET( LICENSE "LGPL v2.1 with special exception" )\r
-set(SPEC_DIR "package")\r
+SET( SPEC_DIR "package")\r
 \r
 #########################################################\r
-set(GENIVI_BUILDSYSTEM_AVAILABLE $ENV{GENIVI_BUILDSYSTEM})\r
+SET(GENIVI_BUILDSYSTEM_AVAILABLE $ENV{GENIVI_BUILDSYSTEM})\r
 IF(GENIVI_BUILDSYSTEM_AVAILABLE)\r
-include($ENV{GENIVI_BUILDSYSTEM}/cmake_extensions/GeniviCMakeExtensions.cmake)\r
+       INCLUDE($ENV{GENIVI_BUILDSYSTEM}/cmake_extensions/GeniviCMakeExtensions.cmake)\r
 ENDIF(GENIVI_BUILDSYSTEM_AVAILABLE)\r
 \r
+\r
+###################### GPROF Settings ###################\r
+# Adds compile flag for gprof to target\r
+# Run the binary\r
+# Output: gmon.out in build directory\r
+# Run: gprof <path/to/binary> > profile.output\r
+SET( GPROF_DLT_DAEMON OFF )\r
+SET( GPROF_DLT_LIB OFF )\r
+SET( GPROF_DLT_EXAMPLES OFF) \r
+SET( GPROF_DLT_TESTS OFF) \r
+SET( GPROF_DLT_CONSOLE OFF)\r
+SET( GPROF_DLT_ADAPTOR OFF)\r
+\r
+###################### systemd Settings #################\r
+SET( DLT_SYSLOG_APPID "SYS" )\r
+SET( DLT_SYSLOG_CTID "LOG" )\r
+SET( DLT_SYSLOG_PORT 4712 )\r
+\r
 SET( prefix ${CMAKE_INSTALL_PREFIX})\r
 SET( libdir "\${exec_prefix}/lib" )\r
 SET( includedir "\${exec_prefix}/include" )\r
@@ -160,10 +175,11 @@ CHECK_FUNCTION_EXISTS( strstr HAVE_FUNC_STRSTR)
 CHECK_FUNCTION_EXISTS( strtol HAVE_FUNC_STRTOL)\r
 \r
 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h @ONLY)\r
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/svnversion.h.cmake ${CMAKE_SOURCE_DIR}/svnversion.h @ONLY)\r
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/version.h.cmake ${CMAKE_SOURCE_DIR}/version.h @ONLY)\r
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h.cmake ${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h @ONLY)\r
 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doxygen.cfg.cmake ${CMAKE_SOURCE_DIR}/doxygen.cfg @ONLY)\r
 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/automotive-dlt.pc.cmake ${CMAKE_SOURCE_DIR}/automotive-dlt.pc @ONLY)\r
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/dlt.service.cmake ${CMAKE_SOURCE_DIR}/systemd/dlt.service @ONLY)\r
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/dlt-syslog.service.cmake ${CMAKE_SOURCE_DIR}/systemd/dlt-syslog.service @ONLY)\r
 #CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/automotive-dlt.spec.cmake ${CMAKE_SOURCE_DIR}/package/automotive-dlt.spec ESCAPE_QUOTES)\r
 \r
 OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON )\r
@@ -171,6 +187,8 @@ OPTION(ENABLE_BUILD_DOC "Set to ON to build Documentation" OFF)
 \r
 MESSAGE( STATUS )\r
 MESSAGE( STATUS "-------------------------------------------------------------------------------" )\r
+MESSAGE( STATUS "Build for Version ${PRINT_VERSION} build ${PRINT_REVISION}")\r
+MESSAGE( STATUS "VERSION_STATE ${PRINT_VERSION_STATE}")\r
 MESSAGE( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )\r
 MESSAGE( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )\r
 MESSAGE( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" )\r
@@ -232,13 +250,9 @@ CONFIGURE_FILE(
 EXPORT_LIBRARY_DEPENDENCIES( "${PROJECT_NAME}LibDeps.cmake" )\r
 \r
 \r
-#######################\r
-# CPack configuration #\r
-#######################\r
-\r
+################ CPack configuration #################\r
 SET(CPACK_GENERATOR "DEB;RPM;TGZ")\r
-\r
-SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Alexander Wenzel") #required\r
+SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Alexander Wenzel")\r
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "automotive-dlt")\r
 SET(CPACK_PACKAGE_DESCRIPTION "This component provides a standardised log and trace interface, based on the\r
 standardised protocol specified in the AUTOSAR standard 4.0 DLT. \r
@@ -250,7 +264,7 @@ logging facility providing
 - the DLT client console utilities\r
 - the DLT test applications ")\r
 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")\r
-SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")\r
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")\r
 SET(CPACK_PACKAGE_VERSION_MAJOR ${PRINT_MAJOR_VERSION})\r
 SET(CPACK_PACKAGE_VERSION_MINOR ${PRINT_MINOR_VERSION})\r
 SET(CPACK_PACKAGE_VERSION_PATCH ${PRINT_PATCH_LEVEL})\r