summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-02-13 09:58:35 +0100
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-02-13 10:53:21 +0100
commit068a13ca7c1fdaefbfc4e846aaa8eefe9eb1d821 (patch)
treea2b8f039525980390b1ba88b8313ed50d5ac79f4 /cmake
parent5d8519018bda6af03c116604a2922625b00f8e52 (diff)
downloadouroboros-0.9.10.tar.gz
ouroboros-0.9.10.zip
build: Add sort command to GitVersionGen0.9.10
This adds the sort command with the version sort to GitVersionGen so the latest version is used when running cmake. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/GitVersionGen.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/GitVersionGen.cmake b/cmake/GitVersionGen.cmake
index 42753d7c..51d8c9b7 100644
--- a/cmake/GitVersionGen.cmake
+++ b/cmake/GitVersionGen.cmake
@@ -5,6 +5,12 @@ macro(git_version_gen)
message(FATAL_ERROR "This is not a git repository")
endif ()
+ find_program(SORT "sort")
+ mark_as_advanced(SORT)
+ if (${SORT} STREQUAL "")
+ message(FATAL_ERROR "Cannot find the sort executable")
+ endif ()
+
find_program(TAIL "tail")
mark_as_advanced(TAIL)
if (${TAIL} STREQUAL "")
@@ -13,6 +19,7 @@ macro(git_version_gen)
execute_process(
COMMAND ${GIT_EXECUTABLE} tag -l -n0
+ COMMAND ${SORT} -V
COMMAND ${TAIL} -n 1
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE _git_tag