refactor(cmake): Add version information to summary

This commit is contained in:
patrick96 2018-12-14 10:02:20 +01:00 committed by Patrick Ziegler
parent 243a6a84a6
commit 3596001de1
2 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,7 @@ execute_process(COMMAND git describe --tags --dirty=-dev
if(git_result EQUAL "0") if(git_result EQUAL "0")
set(APP_VERSION "${git_describe}") set(APP_VERSION "${git_describe}")
else() 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}") set(APP_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
endif() endif()

View File

@ -3,6 +3,7 @@
# #
message(STATUS " Build:") message(STATUS " Build:")
message_colored(STATUS " Version: ${APP_VERSION}" "32;1")
message_colored(STATUS " Type: ${CMAKE_BUILD_TYPE}" "37;2") 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 " 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") message_colored(STATUS " CXX: ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" "37;2")