mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 13:30:44 +00:00
move get_git_hash definition to main CMakeLists.txt
This commit is contained in:
@@ -9,6 +9,21 @@ if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
message(FATAL_ERROR "In-source builds not allowed")
|
||||
endif()
|
||||
|
||||
function(get_git_hash _git_hash)
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
execute_process(
|
||||
COMMAND git rev-parse HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
if(NOT GIT_HASH)
|
||||
set(GIT_HASH "NO_GIT_COMMIT_HASH_DEFINED")
|
||||
endif()
|
||||
set(${_git_hash} "${GIT_HASH}" PARENT_SCOPE)
|
||||
endfunction(get_git_hash)
|
||||
|
||||
project(RenderDoc CXX C)
|
||||
|
||||
option(ENABLE_GL "Enable GL driver" ON)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
function(get_git_hash _git_hash)
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
execute_process(
|
||||
COMMAND git rev-parse HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
if(NOT GIT_HASH)
|
||||
set(GIT_HASH "NO_GIT_COMMIT_HASH_DEFINED")
|
||||
endif()
|
||||
set(${_git_hash} "${GIT_HASH}" PARENT_SCOPE)
|
||||
endfunction(get_git_hash)
|
||||
@@ -1,5 +1,3 @@
|
||||
include("${CMAKE_SOURCE_DIR}/GetGitHash.cmake")
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(RDOC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
Reference in New Issue
Block a user