mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-29 18:52:29 +00:00 
			
		
		
		
	[CMake] Fix detection of git description and hash for CMake 2.8.12
This commit is contained in:
		
							parent
							
								
									3229bedb36
								
							
						
					
					
						commit
						80c0c4f663
					
				
					 2 changed files with 8 additions and 4 deletions
				
			
		|  | @ -109,7 +109,7 @@ if (EXISTS "${GIT_DIR}") | ||||||
|       endif() |       endif() | ||||||
|       message(STATUS "Using Git hash in version output: ${Z3GITHASH}") |       message(STATUS "Using Git hash in version output: ${Z3GITHASH}") | ||||||
|       # This mimics the behaviour of the old build system. |       # This mimics the behaviour of the old build system. | ||||||
|       string(APPEND Z3_FULL_VERSION_STR " ${Z3GITHASH}") |       set(Z3_FULL_VERSION_STR "${Z3_FULL_VERSION_STR} ${Z3GITHASH}") | ||||||
|     else() |     else() | ||||||
|       message(STATUS "Not using Git hash in version output") |       message(STATUS "Not using Git hash in version output") | ||||||
|       unset(Z3GITHASH) # Used in configure_file() |       unset(Z3GITHASH) # Used in configure_file() | ||||||
|  | @ -122,7 +122,7 @@ if (EXISTS "${GIT_DIR}") | ||||||
|       endif() |       endif() | ||||||
|       message(STATUS "Using Git description in version output: ${Z3_GIT_DESCRIPTION}") |       message(STATUS "Using Git description in version output: ${Z3_GIT_DESCRIPTION}") | ||||||
|       # This mimics the behaviour of the old build system. |       # This mimics the behaviour of the old build system. | ||||||
|       string(APPEND Z3_FULL_VERSION_STR " ${Z3_GIT_DESCRIPTION}") |       set(Z3_FULL_VERSION_STR "${Z3_FULL_VERSION_STR} ${Z3_GIT_DESCRIPTION}") | ||||||
|     else() |     else() | ||||||
|       message(STATUS "Not including git descrption in version") |       message(STATUS "Not including git descrption in version") | ||||||
|     endif() |     endif() | ||||||
|  |  | ||||||
|  | @ -99,7 +99,9 @@ function(get_git_head_hash GIT_DIR OUTPUT_VAR) | ||||||
|     message(FATAL_ERROR \""${GIT_DIR}\" is not an absolute path") |     message(FATAL_ERROR \""${GIT_DIR}\" is not an absolute path") | ||||||
|   endif() |   endif() | ||||||
|   find_package(Git) |   find_package(Git) | ||||||
|   if (NOT Git_FOUND) |   # NOTE: Use `GIT_FOUND` rather than `Git_FOUND` which was only | ||||||
|  |   # available in CMake >= 3.5 | ||||||
|  |   if (NOT GIT_FOUND) | ||||||
|     set(${OUTPUT_VAR} "GIT-NOTFOUND" PARENT_SCOPE) |     set(${OUTPUT_VAR} "GIT-NOTFOUND" PARENT_SCOPE) | ||||||
|     return() |     return() | ||||||
|   endif() |   endif() | ||||||
|  | @ -146,7 +148,9 @@ function(get_git_head_describe GIT_DIR OUTPUT_VAR) | ||||||
|     message(FATAL_ERROR \""${GIT_DIR}\" is not an absolute path") |     message(FATAL_ERROR \""${GIT_DIR}\" is not an absolute path") | ||||||
|   endif() |   endif() | ||||||
|   find_package(Git) |   find_package(Git) | ||||||
|   if (NOT Git_FOUND) |   # NOTE: Use `GIT_FOUND` rather than `Git_FOUND` which was only | ||||||
|  |   # available in CMake >= 3.5 | ||||||
|  |   if (NOT GIT_FOUND) | ||||||
|     set(${OUTPUT_VAR} "GIT-NOTFOUND" PARENT_SCOPE) |     set(${OUTPUT_VAR} "GIT-NOTFOUND" PARENT_SCOPE) | ||||||
|     return() |     return() | ||||||
|   endif() |   endif() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue