aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-11-11 04:10:45 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-11-11 04:20:09 +0100
commit62a542e824362c530abef7d122bfa9798c7e013e (patch)
tree2c27d52aa928adfd148338080f16c3dbcbe0aad9
parentde19fa71b6d248b48b2e0b9b5cb7eab24d913d39 (diff)
downloadyawa-62a542e824362c530abef7d122bfa9798c7e013e.tar.xz
CMakeLists: Set git version if in git repo
-rw-r--r--CMakeLists.txt16
1 files changed, 15 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7402dd..c48c6b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,11 +2,25 @@ cmake_minimum_required (VERSION 2.6)
project (yawa)
set(PACKAGE_NAME "yawa")
-set(PACKAGE_VERSION "0.0.1")
+
+if(EXISTS ".git/")
+ find_package(Git)
+ if(GIT_FOUND)
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} describe
+ OUTPUT_VARIABLE GIT_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(PACKAGE_VERSION ${GIT_VERSION})
+ endif()
+else()
+ set(PACKAGE_VERSION "0.0.1")
+endif()
+
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_DESCRIPTION "Yet Another Wallpaper Application")
set(PACKAGE_BUGREPORT "johannes@kyriasis.com")
+
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
configure_file(