diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2013-01-28 19:48:54 +0100 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-02-04 19:39:43 +0400 |
commit | ce3bd57194cedb7b9a1f6f35ad1b3586389cc7b9 (patch) | |
tree | 0a63de69df8061b0ec59b63dfa3e3f8a95833819 | |
parent | 38789e2c51ecf186d67bff258a185276dfb3b6ec (diff) | |
download | accel-ppp-ce3bd57194cedb7b9a1f6f35ad1b3586389cc7b9.tar.gz accel-ppp-ce3bd57194cedb7b9a1f6f35ad1b3586389cc7b9.zip |
build: Set ACCEL_PPP_VERSION in top level cmake file
Move definition of ACCEL_PPP_VERSION from /accel-pppd/CMakeLists.txt
to /CMakeLists.txt so that it gets visible by any cmake file.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
-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 |