summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-xCMakeLists.txt35
1 files changed, 14 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f19002f..1f222ae 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
PROJECT( automotive-dlt )
-# Set version parameters
+############## Set version parameters #######################
SET( ${PROJECT_NAME}_MAJOR_VERSION 2 )
SET( ${PROJECT_NAME}_MINOR_VERSION 4 )
SET( ${PROJECT_NAME}_PATCH_LEVEL 2 )
@@ -54,14 +54,19 @@ SET( PRINT_MINOR_VERSION ${${PROJECT_NAME}_MINOR_VERSION})
SET( PRINT_PATCH_LEVEL ${${PROJECT_NAME}_PATCH_LEVEL})
SET( PRINT_VERSION ${GENIVI_PROJECT_VERSION})
SET( PRINT_VERSION_STATE ${${PROJECT_NAME}_VERSION_STATE})
-
SET( DLT_REVISION "")
-IF(NOT DEFINED DLT_REVISION)
- execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE DLT_REVISION
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- STRING(REPLACE "-" "_" DLT_REVISION ${DLT_REVISION})
-ENDIF(NOT DEFINED DLT_REVISION)
+
+EXECUTE_PROCESS(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ OUTPUT_VARIABLE DLT_REVISION
+ ERROR_VARIABLE GIT_ERROR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE)
+IF( DLT_REVISION MATCHES "^$")
+ SET( PRINT_REVISION "Git revision unavailable")
+ELSE( DLT_REVISION MATCHES "")
+ STRING(REPLACE "-" "_" DLT_REVISION ${DLT_REVISION})
+ SET( PRINT_REVISION ${DLT_REVISION})
+ENDIF( DLT_REVISION MATCHES "^$")
##################### RPM SPEC CONFIG ########################
SET( GENIVI_RPM_RELEASE "1${DLT_REVISION}")
@@ -182,7 +187,6 @@ CHECK_FUNCTION_EXISTS( strtol HAVE_FUNC_STRTOL)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h.cmake ${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doxygen.cfg.cmake ${CMAKE_SOURCE_DIR}/doxygen.cfg @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/automotive-dlt.pc.cmake ${CMAKE_SOURCE_DIR}/automotive-dlt.pc @ONLY)
#CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/dlt.service.cmake ${CMAKE_SOURCE_DIR}/systemd/dlt.service @ONLY)
#CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/dlt-syslog.service.cmake ${CMAKE_SOURCE_DIR}/systemd/dlt-syslog.service @ONLY)
@@ -195,7 +199,7 @@ OPTION(ENABLE_BUILD_DOC "Set to ON to build Documentation" OFF)
MESSAGE( STATUS )
MESSAGE( STATUS "-------------------------------------------------------------------------------" )
-MESSAGE( STATUS "Build for Version ${PRINT_VERSION} build ${DLT_REVISION}")
+MESSAGE( STATUS "Build for Version ${PRINT_VERSION} build ${PRINT_REVISION}")
MESSAGE( STATUS "VERSION_STATE ${PRINT_VERSION_STATE}")
MESSAGE( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
MESSAGE( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
@@ -217,17 +221,6 @@ ADD_SUBDIRECTORY( testscripts )
IF (ENABLE_BUILD_DOC)
ADD_SUBDIRECTORY( doc )
-
- ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_SOURCE_DIR}/doxygen-execute
- DEPENDS ${CMAKE_SOURCE_DIR}/doxygen.cfg
- COMMAND doxygen
- ARGS ${CMAKE_SOURCE_DIR}/doxygen.cfg
- )
-
- ADD_CUSTOM_TARGET(doxygen-doc ALL DEPENDS ${CMAKE_SOURCE_DIR}/doxygen-execute)
-
- SET( DOC_COMPONENT doc)
ENDIF(ENABLE_BUILD_DOC)
INSTALL(FILES automotive-dlt.pc