aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-26 10:18:06 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-26 10:18:06 -0400
commitc4257055ebb74987b62833c0529ecfb9f9a1c47c (patch)
tree3bb46275a4a68674c700f8134e99e5b78c9d717f /CMakeLists.txt
parent93482312f9ce89075ea9d5e314b5217622894e92 (diff)
parent429fc53e51bdbdbfc23894993f6ae170ff518fb6 (diff)
Merge pull request #135 from Luminarys/master
Added in build version based on git hash
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e400cd2..bbf61299 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,18 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin/")
add_definitions("-Wall -Wextra -Wno-unused-parameter")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake)
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
+ execute_process(
+ COMMAND git describe --always
+ OUTPUT_VARIABLE GIT_COMMIT_HASH
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
+
+SET(GIT_VERSION_FLAG "-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\"")
+
+add_definitions("${GIT_VERSION_FLAG}")
+
find_package(XKBCommon REQUIRED)
find_package(WLC REQUIRED)
find_package(A2X REQUIRED)