generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#545: Store configured Python and NumPy versions in built code
- Loading branch information
1 parent
2880ea9
commit df4e611
Showing
3 changed files
with
40 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef NGEN_BMI_PY_BUILD_VERSIONS_HPP | ||
#define NGEN_BMI_PY_BUILD_VERSIONS_HPP | ||
|
||
#ifdef ACTIVATE_PYTHON | ||
|
||
#include <string> | ||
|
||
namespace models { | ||
namespace bmi { | ||
extern const int python_major; | ||
extern const int python_minor; | ||
// Store the patch version as a string because it may have a non-numeric suffix | ||
extern const std::string python_patch; | ||
|
||
// NumPy version is not broken down by CMake | ||
extern const std::string numpy_version; | ||
} | ||
} | ||
|
||
#endif // ACTIVATE_PYTHON | ||
|
||
#endif // NGEN_BMI_PY_BUILD_VERSIONS_HPP |
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,16 @@ | ||
#ifdef ACTIVATE_PYTHON | ||
|
||
#include "Bmi_Py_Build_Versions.hpp" | ||
|
||
namespace models { | ||
namespace bmi { | ||
|
||
const int python_major = ${Python_VERSION_MAJOR}; | ||
const int python_minor = ${Python_VERSION_MINOR}; | ||
const std::string python_patch = "${Python_VERSION_PATCH}"; | ||
|
||
const std::string numpy_version = "${Python_NumPy_VERSION}"; | ||
} | ||
} | ||
|
||
#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