mirror of
				https://github.com/eclipse/upm.git
				synced 2025-11-04 09:05:34 +03:00 
			
		
		
		
	cmake: If git-describe failes with *-NOTFOUND, tag version dirty
There is a case where git_describe was returning 'HEAD-HASH-NOTFOUND' which missed the STREQUAL check and VERSION was set incorrectly. Changed the STREQUAL to a MATCH on -NOTFOUND. In this way, any of the -NOTFOUND returns change the version to dirty. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
		@@ -94,9 +94,11 @@ set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for
 | 
			
		||||
# Make a version file containing the current version from git.
 | 
			
		||||
include (GetGitRevisionDescription)
 | 
			
		||||
git_describe (VERSION "--tags")
 | 
			
		||||
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
 | 
			
		||||
  message (WARNING "Install git to compile a production UPM!")
 | 
			
		||||
# If git_describe fails, use a dirty version
 | 
			
		||||
if (${VERSION} MATCHES -NOTFOUND)
 | 
			
		||||
  set (VERSION "v0.8.0-dirty")
 | 
			
		||||
  message (WARNING "Failed to retrieve UPM version with 'git describe' (using "
 | 
			
		||||
      "${VERSION}). Check that git is installed and this is a valid git repo.")
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
message (STATUS "UPM Version ${VERSION}")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user