mirror of
				https://github.com/gnif/LookingGlass.git
				synced 2025-11-03 22:22:08 +00:00 
			
		
		
		
	[all] cmake: check for VERSION file before using git describe
				
					
				
			In order to make it easier for package maintainers that manage LG inside their own git repository we should use the version file if it exists over calling git describe.
This commit is contained in:
		@@ -1,15 +1,16 @@
 | 
				
			|||||||
execute_process(
 | 
					if (EXISTS ${PROJECT_TOP}/VERSION)
 | 
				
			||||||
	COMMAND git describe --always --abbrev=10 --dirty=+ --tags
 | 
						file(READ ${PROJECT_TOP}/VERSION GIT_REV)
 | 
				
			||||||
	WORKING_DIRECTORY "${PROJECT_TOP}"
 | 
					else()
 | 
				
			||||||
        OUTPUT_VARIABLE GIT_REV
 | 
						execute_process(
 | 
				
			||||||
        ERROR_QUIET)
 | 
							COMMAND git describe --always --abbrev=10 --dirty=+ --tags
 | 
				
			||||||
 | 
							WORKING_DIRECTORY "${PROJECT_TOP}"
 | 
				
			||||||
 | 
							OUTPUT_VARIABLE GIT_REV
 | 
				
			||||||
 | 
							ERROR_QUIET)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ("${GIT_REV}" STREQUAL "")
 | 
					if ("${GIT_REV}" STREQUAL "")
 | 
				
			||||||
	if (EXISTS ${PROJECT_TOP}/VERSION)
 | 
						set(GIT_REV "UNKNOWN")
 | 
				
			||||||
		file(READ ${PROJECT_TOP}/VERSION GIT_REV)
 | 
					 | 
				
			||||||
	else()
 | 
					 | 
				
			||||||
		set(GIT_REV "UNKNOWN")
 | 
					 | 
				
			||||||
	endif()
 | 
					 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
string(STRIP "${GIT_REV}" GIT_VERSION)
 | 
					string(STRIP "${GIT_REV}" GIT_VERSION)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user