diff options
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | accel-pppd/CMakeLists.txt | 15 |
2 files changed, 15 insertions, 15 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") diff --git a/accel-pppd/CMakeLists.txt b/accel-pppd/CMakeLists.txt index 6e7910f2..291d3960 100644 --- a/accel-pppd/CMakeLists.txt +++ b/accel-pppd/CMakeLists.txt @@ -1,20 +1,5 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fvisibility=hidden -fno-strict-aliasing -D_GNU_SOURCE -DPTHREAD_SPINLOCK -fPIC") -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 DEFINED LIB_SUFFIX) EXECUTE_PROCESS( COMMAND uname -m |