diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 421c044c..dbd92949 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,21 @@ project(accel-ppp C) include(cmake/cpack.cmake) +IF (EXISTS ${CMAKE_HOME_DIRECTORY}/.git AND NOT DEFINED IGNORE_GIT) + EXECUTE_PROCESS( + COMMAND git log --no-color + COMMAND head -n1 + COMMAND awk "{print $2}" + WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} + OUTPUT_VARIABLE ACCEL_PPP_VERSION + ) + STRING(STRIP ${ACCEL_PPP_VERSION} ACCEL_PPP_VERSION) +ELSE (EXISTS ${CMAKE_HOME_DIRECTORY}/.git AND NOT DEFINED IGNORE_GIT) + SET (ACCEL_PPP_VERSION 1.7.3) +ENDIF (EXISTS ${CMAKE_HOME_DIRECTORY}/.git AND NOT DEFINED IGNORE_GIT) + +ADD_DEFINITIONS(-DACCEL_PPP_VERSION="${ACCEL_PPP_VERSION}") + if (NOT BUILD_DRIVER_ONLY) if (MEMDEBUG) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector -fstack-protector-all") |