https://travis-ci.org/zinnschlag/openmw/builds/18477085CMake Error at CMakeLists.txt:39 (message):
Failed to get valid version information from Git
Version/Build number in Launcher window
Re: Version/Build number in Launcher window
It seems travis now always fails with:
Re: Version/Build number in Launcher window
That must be because Travis can't find git. Does it have git included in its path?
EDIT: the link suggests it does run some git commands successfully, but I suspect find_package(Git QUIET) fails. Maybe removing the QUIET part will give more information.
EDIT: the link suggests it does run some git commands successfully, but I suspect find_package(Git QUIET) fails. Maybe removing the QUIET part will give more information.
Re: Version/Build number in Launcher window
Also, this will most definitely fail for downloaded source tarballs, which do not have a git repository in them.
Any idea how to handle that?
Any idea how to handle that?
Re: Version/Build number in Launcher window
Yeah good point, maybe add a CMake flag for that, or only show the version info if the git tag was found?
Re: Version/Build number in Launcher window
I think we'll still want openmw --version to show the correct version for a tarball, because afaik some distros use that for their packages.
Re: Version/Build number in Launcher window
Seems to break windows build. I'm using TortoiseGit so it might be that CMake doesn't know where to find git executable. Worked around by editing CMakeLists for now.
Edit: adding %AppData%\..\Local\Programs\Git\bin to PATH (via Control Panel) fixes it
Edit: adding %AppData%\..\Local\Programs\Git\bin to PATH (via Control Panel) fixes it
Re: Version/Build number in Launcher window
I assume at some point the OpenCS's version/build number will be found in a window/menu somewhere inside it?
Re: Version/Build number in Launcher window
At some point. Still very short on manpower for OpenCS, so less important tasks tend to be left by the wayside for now.
Re: Version/Build number in Launcher window
I have found the problem for travis. It uses a git clone --depth=50, that is, a shallow clone with history limited to the last 50 revisions. That means it also doesn't have the tags, and git rev-list --tags will return nothing.
Edit: doing a git fetch --tags first resolves this.
As mentioned earlier though, we still want a way to disable this stuff for tarballs.
Edit: doing a git fetch --tags first resolves this.
As mentioned earlier though, we still want a way to disable this stuff for tarballs.
Re: Version/Build number in Launcher window
Yes, for the shallow clone problem and for the source tarball version problem I actually found a solution in the Kdenlive CMakeLists.txt:
How does that look? We still would have to define the version manually for source tarball builds though.
Code: Select all
# To be switched on when releasing.
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" OFF)
# Get current version.
set(VERSION "\"${KDENLIVE_VERSION}\"")
if(NOT RELEASE_BUILD)
if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
# Probably a Git workspace: determine the revision.
find_package(Git)
if(GIT_FOUND)
exec_program(${GIT_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}
ARGS "describe --tags"
OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
RETURN_VALUE TAG_RESULT
)
# git describe --tags failed, for example it fails if repo was checked with depth=1
if(NOT ${TAG_RESULT} EQUAL 0)
exec_program(${GIT_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}
ARGS "describe --always"
OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
)
endif(NOT ${TAG_RESULT} EQUAL 0)
message("Current Kdenlive Git revision is ${KDENLIVE_GIT_REVISION}")
set(VERSION "\"${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})\"")
else(GIT_FOUND)
message("Could not determine the Git revision")
endif(GIT_FOUND)
endif(EXISTS ${PROJECT_SOURCE_DIR}/.git)
endif(NOT RELEASE_BUILD)