aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-04-26 10:18:03 -0400
committerGitHub <noreply@github.com>2017-04-26 10:18:03 -0400
commit3c1fc00f12e2777f6349a5d671b8d66c5997eb2b (patch)
tree5bcca08aad4e65d288abf218b50172a3137d2d71 /CMakeLists.txt
parent586eca0e4cd9481cabdd1cedef53145a0d07bc72 (diff)
parent173b3385675b24fb7a55f2d212e2958970f6e6d3 (diff)
downloadsway-3c1fc00f12e2777f6349a5d671b8d66c5997eb2b.tar.xz
Merge pull request #1194 from snoack/version
Add -DVERSION flag for release version numbers
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 017b0994..9ed45830 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,10 @@ endif()
list(INSERT CMAKE_MODULE_PATH 0
${CMAKE_CURRENT_SOURCE_DIR}/CMake
)
-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
+
+if (VERSION)
+ add_definitions(-DSWAY_VERSION=\"${VERSION}\")
+else()
execute_process(
COMMAND git describe --always --tags
OUTPUT_VARIABLE GIT_COMMIT_HASH
@@ -33,13 +36,10 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
-endif()
-add_definitions(-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\")
-add_definitions(-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\")
-
-string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
-add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\")
+ string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
+ add_definitions("-DSWAY_VERSION=\"${GIT_COMMIT_HASH} (${CURRENT_DATE}, branch \\\"${GIT_BRANCH}\\\")\"")
+endif()
option(enable-swaylock "Enables the swaylock utility" YES)
option(enable-swaybg "Enables the wallpaper utility" YES)