forked from FESOM/fesom2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request FESOM#13 from FESOM/version_info
Version info
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
find_package(Git QUIET) | ||
if(Git_FOUND) | ||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} | ||
OUTPUT_VARIABLE FESOM_GIT_SHA | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
else() | ||
set(FESOM_GIT_SHA "unknown") | ||
message("git not found, setting FESOM_GIT_SHA to: ${FESOM_GIT_SHA}") | ||
endif() | ||
|
||
configure_file(${FESOM_ORIGINAL_VERSION_FILE} ${FESOM_GENERATED_VERSION_FILE} @ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module fesom_version_info_module | ||
private | ||
public fesom_git_sha | ||
|
||
contains | ||
|
||
|
||
pure function fesom_git_sha() result(x) | ||
character(:), allocatable :: x | ||
! EO args | ||
x = "@FESOM_GIT_SHA@" | ||
end function | ||
|
||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters