forked from USEPA/Stormwater-Management-Model
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e46106
commit 16fe864
Showing
5 changed files
with
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,4 @@ tests/solver/data/feng* | |
|
||
# Generated files | ||
*_export.h | ||
version.h |
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,40 @@ | ||
# | ||
# version.cmake - generate SWMM version information header | ||
# | ||
# Created: November 2, 2021 | ||
# Updated: | ||
# | ||
# Author: Michael E. Tryby | ||
# US EPA - ORD/CESER | ||
# | ||
# Usage: | ||
# To overwrite version.h file with current info into set GEN_VER_HEADER=ON. | ||
|
||
if(GEN_VER_HEADER) | ||
|
||
# Get the latest commit hash for the working branch | ||
execute_process( | ||
COMMAND | ||
git rev-parse HEAD | ||
WORKING_DIRECTORY | ||
${CMAKE_CURRENT_LIST_DIR} | ||
OUTPUT_VARIABLE | ||
GIT_HASH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
# Generate a build id | ||
string( | ||
TIMESTAMP BUILD_ID UTC | ||
) | ||
|
||
# Configure the version header | ||
configure_file( | ||
../../extern/version.h.in version.h | ||
) | ||
|
||
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/version.h | ||
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/ | ||
) | ||
|
||
endif() |
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,27 @@ | ||
/* | ||
* version.h - SWMM version information | ||
* | ||
* Created on: Nov 2, 2021 | ||
* | ||
* Author: Michael E. Tryby | ||
* US EPA - ORD/CESER | ||
*/ | ||
|
||
|
||
#ifndef VERSION_H_ | ||
#define VERSION_H_ | ||
|
||
|
||
|
||
#define VERSION "@swmm-solver_VERSION@" | ||
#define VERSION_MAJOR @swmm-solver_VERSION_MAJOR@ | ||
#define VERSION_MINOR @swmm-solver_VERSION_MINOR@ | ||
#define VERSION_PATCH @swmm-solver_VERSION_PATCH@ | ||
|
||
#define GIT_HASH "@GIT_HASH@" | ||
|
||
#define BUILD_ID "@BUILD_ID@" | ||
|
||
|
||
|
||
#endif /* VERSION_H_ */ |
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