Skip to content

Commit

Permalink
Configure only gets the git hash tag when the source is a git repo.
Browse files Browse the repository at this point in the history
Close #25
  • Loading branch information
justusc committed Aug 6, 2015
1 parent 673ccab commit 073879b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ set(BUILD_TESTING_SHARED FALSE CACHE BOOLEAN "BUILD_TESTING_SHARED")
# Get the git revision tag information
##########################

find_package(Git REQUIRED)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse -q HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE TILEDARRAY_REVISION )
string(REGEX MATCH "[0-9a-f]*"
TILEDARRAY_REVISION "${TILEDARRAY_REVISION}")
if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
find_package(Git REQUIRED)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse -q HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE TILEDARRAY_REVISION )
string(REGEX MATCH "[0-9a-f]*"
TILEDARRAY_REVISION "${TILEDARRAY_REVISION}")
else()
set(TILEDARRAY_REVISION "${TILEDARRAY_VERSION}")
endif()

##########################
# Check C++11 features
Expand Down

0 comments on commit 073879b

Please sign in to comment.