Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you put the three components of the version number into the STARE.h file as well? #64

Open
captainkirk99 opened this issue Oct 4, 2020 · 4 comments

Comments

@captainkirk99
Copy link
Collaborator

I have to check for the correct version of STARE in the STAREmaster build (see SpatioTemporal/STAREmaster#65).

Currently we have this in STARE.h:

#define STARE_VERSION "0.16.2"

Which is great as a version string. But it is more helpful when checking the version in configure/cmake to have each component defined as an integer. Then I can use ifdefs with > to check that I have a good version. For example, here's what netCDF provides (in netcdf_meta.h):

#define NC_VERSION_MAJOR 4 /*!< netcdf-c major version. */
#define NC_VERSION_MINOR 7 /*!< netcdf-c minor version. */
#define NC_VERSION_PATCH 4 /*!< netcdf-c patch version. */
#define NC_VERSION_NOTE  "" /*!< netcdf-c note. May be blank. */

/*! netcdf-c version string.
 *
 * The format of the netcdf-c version string is as follows:
 * \code
 * NC_VERSION_MAJOR.NC_VERSION_MINOR.NC_VERSION_PATCH.NC_VERSION_NOTE
 * \endcode
 * Note that the trailing NC_VERSION_NOTE may be empty. It serves for
 * identifiers such as '-rc1', etc.
 */
#define NC_VERSION       "4.7.4"


This is created in CMake like this:

SET(NC_VERSION_MAJOR 4)
SET(NC_VERSION_MINOR 8)
SET(NC_VERSION_PATCH 0)
SET(NC_VERSION_NOTE "-development")
SET(netCDF_VERSION ${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}.${NC_VERSION_PATCH}${NC_VERSION_NOTE})

Can we put something similar in STARE?

The alternative is to parse the version string from within CMake/autoconf.

@michaelleerilee
Copy link
Collaborator

Could this be in STARE.h.in?

@michaelleerilee
Copy link
Collaborator

Re: STARE.h.in. No. I'm parsing and generating the required int defs. Will push soon.

@captainkirk99
Copy link
Collaborator Author

@michaelleerilee not quite sure about your question. This is in STARE.h which of course is generated at configure time from STARE.h.in.

What I'm requesting is the three additional numeric fields with the version number, in addition to the version string you already have there...

@michaelleerilee
Copy link
Collaborator

michaelleerilee commented Oct 10, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants