Commit 02eb0613 authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Fixed multiple OGS version outputs.

parent ec70a5e0
......@@ -4,6 +4,8 @@ find_package(Git REQUIRED)
if(DEFINED ENV{OGS_VERSION})
set(OGS_VERSION $ENV{OGS_VERSION})
message(STATUS "OGS VERSION: ${OGS_VERSION} (set via environment)")
elseif(DEFINED OGS_VERSION)
message(STATUS "Using user-provided OGS_VERSION=${OGS_VERSION}")
endif()
if(NOT IS_GIT_REPO)
......@@ -37,7 +39,6 @@ if(IS_GIT_REPO AND NOT OGS_VERSION)
)
if(DESCRIBE_RESULT EQUAL 0)
string(STRIP "${DESCRIBE_STDOUT}" DESCRIBE_STDOUT)
message(STATUS "Git reported this project's version as '${DESCRIBE_STDOUT}'")
if(DESCRIBE_STDOUT MATCHES "^(.*)-(dirty)$")
set(DESCRIBE_DIRTY "${CMAKE_MATCH_2}")
set(DESCRIBE_STDOUT "${CMAKE_MATCH_1}")
......@@ -67,7 +68,7 @@ if(IS_GIT_REPO AND NOT OGS_VERSION)
set(OGS_VERSION "${OGS_VERSION}.dirty.${DESCRIBE_DIRTY_TIMESTAMP}")
endif()
endif()
message(STATUS "OGS VERSION: ${OGS_VERSION}")
message(STATUS "OGS VERSION: ${OGS_VERSION} (reported by git)")
else()
message(WARNING "Git repository contains no tags! Please run: git fetch --tags")
endif()
......@@ -88,10 +89,6 @@ if(IS_GIT_REPO AND NOT OGS_VERSION)
)
endif()
if(DEFINED OGS_VERSION)
message(STATUS "Using user-provided OGS_VERSION=${OGS_VERSION}")
endif()
if(MSVC)
set(CMD_COMMAND "cmd" "/c" CACHE INTERNAL "")
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment