summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
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()
20list(INSERT CMAKE_MODULE_PATH 0 20list(INSERT CMAKE_MODULE_PATH 0
21 ${CMAKE_CURRENT_SOURCE_DIR}/CMake 21 ${CMAKE_CURRENT_SOURCE_DIR}/CMake
22 ) 22 )
23if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) 23
24if (VERSION)
25 add_definitions(-DSWAY_VERSION=\"${VERSION}\")
26else()
24 execute_process( 27 execute_process(
25 COMMAND git describe --always --tags 28 COMMAND git describe --always --tags
26 OUTPUT_VARIABLE GIT_COMMIT_HASH 29 OUTPUT_VARIABLE GIT_COMMIT_HASH
@@ -33,13 +36,10 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
33 OUTPUT_STRIP_TRAILING_WHITESPACE 36 OUTPUT_STRIP_TRAILING_WHITESPACE
34 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 37 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
35 ) 38 )
36endif()
37 39
38add_definitions(-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\") 40 string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
39add_definitions(-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\") 41 add_definitions("-DSWAY_VERSION=\"${GIT_COMMIT_HASH} (${CURRENT_DATE}, branch \\\"${GIT_BRANCH}\\\")\"")
40 42endif()
41string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
42add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\")
43 43
44option(enable-swaylock "Enables the swaylock utility" YES) 44option(enable-swaylock "Enables the swaylock utility" YES)
45option(enable-swaybg "Enables the wallpaper utility" YES) 45option(enable-swaybg "Enables the wallpaper utility" YES)