From 3596001de1a8788ee0cbceaa7ebbc3c1e4f94dff Mon Sep 17 00:00:00 2001
From: patrick96
Date: Fri, 14 Dec 2018 10:02:20 +0100
Subject: [PATCH] refactor(cmake): Add version information to summary
---
CMakeLists.txt | 1 +
cmake/05-summary.cmake | 1 +
2 files changed, 2 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c46d1b98..a18aeff8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,7 @@ execute_process(COMMAND git describe --tags --dirty=-dev
if(git_result EQUAL "0")
set(APP_VERSION "${git_describe}")
else()
+ message(STATUS "Could not detect version with git, falling back to built-in version information.")
set(APP_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
endif()
diff --git a/cmake/05-summary.cmake b/cmake/05-summary.cmake
index b14d9c5e..42a3a335 100644
--- a/cmake/05-summary.cmake
+++ b/cmake/05-summary.cmake
@@ -3,6 +3,7 @@
#
message(STATUS " Build:")
+message_colored(STATUS " Version: ${APP_VERSION}" "32;1")
message_colored(STATUS " Type: ${CMAKE_BUILD_TYPE}" "37;2")
message_colored(STATUS " CC: ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" "37;2")
message_colored(STATUS " CXX: ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" "37;2")