-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor versioning system and enhance build metadata.
Replaced hardcoded versioning with a dynamic CMake-driven system using `Info.h` to embed version, parallelization, and commit metadata directly into the build. Simplified Python version parsing and renamed `LOGGING_LEVEL` to `POLYHEDRAL_GRAVITY_LOGGING_LEVEL` for consistency. Consolidated version management and improved Git commit hash handling.
- Loading branch information
Showing
13 changed files
with
142 additions
and
102 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 |
---|---|---|
|
@@ -3,4 +3,5 @@ cmake-build-* | |
build | ||
polyhedral_gravity.egg-info | ||
dist | ||
docs/Doxyfile | ||
docs/Doxyfile | ||
src/polyhedralGravity/Info.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
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 was deleted.
Oops, something went wrong.
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
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
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,36 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
// ########################################################################################## | ||
// Please note! The content of this file is automatically modified by the CMake build system | ||
// which replaces the variables | ||
// ########################################################################################## | ||
|
||
namespace polyhedralGravity { | ||
|
||
/** | ||
* The API version of the polyhedral gravity model's interface. | ||
* The value is set by the CMake configuration. | ||
*/ | ||
constexpr std::string_view POLYHEDRAL_GRAVITY_VERSION = "@POLYHEDRAL_GRAVITY_VERSION@"; | ||
|
||
/** | ||
* The API parallelization backend of the polyhedral gravity model's interface. | ||
* The value is set by the CMake configuration. | ||
*/ | ||
constexpr std::string_view POLYHEDRAL_GRAVITY_PARALLELIZATION = "@POLYHEDRAL_GRAVITY_PARALLELIZATION@"; | ||
|
||
/** | ||
* The API commit with which it was compiled. | ||
* The value is set by the CMake configuration. | ||
*/ | ||
constexpr std::string_view POLYHEDRAL_GRAVITY_COMMIT_HASH = "@POLYHEDRAL_GRAVITY_COMMIT_HASH@"; | ||
|
||
/** | ||
* The API's Loggin Level. Determines the amount of output. | ||
* The value is set by the CMake configuration. | ||
*/ | ||
constexpr std::string_view POLYHEDRAL_GRAVITY_LOGGING_LEVEL = "@POLYHEDRAL_GRAVITY_LOGGING_LEVEL@"; | ||
|
||
}// namespace polyhedralGravity |
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
# Modify the version with a new release | ||
set(PROJECT_VERSION 3.2.1) | ||
set(POLYHEDRAL_GRAVITY_VERSION ${PROJECT_VERSION}) | ||
|
||
# Get the Git information | ||
get_git_commit_hash(POLYHEDRAL_GRAVITY_COMMIT_HASH) | ||
is_git_working_tree_clean(POLYHEDRAL_GRAVITY_WORKING_TREE) | ||
|
||
# Append "-modified" to the commit hash if the working tree is not clean | ||
if (NOT ${POLYHEDRAL_GRAVITY_WORKING_TREE}) | ||
set(POLYHEDRAL_GRAVITY_COMMIT_HASH "${POLYHEDRAL_GRAVITY_COMMIT_HASH}+modified") | ||
endif () | ||
|
||
# Configure the output header file | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/src/polyhedralGravity/Info.h.in" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/src/polyhedralGravity/Info.h" | ||
) |