[sword-devel] SWORD 1.7.0RC2
Troy A. Griffitts
scribe at crosswire.org
Mon Aug 12 00:34:08 MST 2013
OK, I've put together a scheme which moves the new version macros into
our swversion.h file. The new scheme goes out to 4 segments as we
support in the SWVersion class. Here are the defines. Please add your
comments and ask question, but I hope these will be self-explanitory.
My only concert about SWORD_VERSION_NUM is the possible size we might
get to if we ever get to 5.0. Don't know how compilers handle macro
checking on values over 4GB.
#define SWORD_VERSION_NUM 106902000
#define SWORD_VERSION_STR "1.6.902"
#define SWORD_VERSION_MAJOR 1
#define SWORD_VERSION_MINOR 6
#define SWORD_VERSION_MICRO 902
#define SWORD_VERSION_NANO 0
As for RCs, I've always bumped the subsequent segment up to near max
(901 for RC1). Not sure if this is standard but it keeps the versions
sortable and is mostly obvious to a human what is going on. I'm happy
to change this is someone has problems with it.
As for padding of the new SWORD_VERSION_NUM for comparisons, the final 2
segments are ###, wereas the second is ## and the first obviously
shouldn't be padded or it will change the value to octal :)
Again, if you hate this, I can change it, but I compromised between
consistency (all ###) and dangerously high values (> 4GB).
Comments welcome. Waiting for Greg to get this into svn before RC3.
On 08/07/2013 12:53 AM, Jaak Ristioja wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> On Tue, Aug 6, 2013 at 11:12 AM, Troy A. Griffitts wrote:
>> My only mention of this is to show that we're not simply speaking
>> of obtaining version information when discussion whether or not to
>> use pkg-config.
> Just to be clear, I'm not against providing sword.pc files so that
> people could use pkg-config in projects to detect Sword and required
> compile options. But I'm not sure whether it were a proper place for
> passing #defines such as SWORD_VERSION. For feature test macros (see
> "man 7 feature_test_macros") this is probably still a good place thou.
> As for the ease of use pkg-config aims to provide, I know a similar
> way to also improve Sword for projects using CMake so that those need
> no more CMake code than a regular FIND_PACKAGE() call, which will
> define the respective Sword_INCLUDE_DIRS, Sword_LIBRARIES,
> Sword_DEFINITIONS, Sword_VERSION_MINOR etc variables. For BibleTime
> this approach would mean we could delete the cmake/FindSword.cmake
> sword detection logic file and just use FIND_PACKAGE(Sword 1.7.0
> REQUIRED) to have all the respective variables defined. Using this
> approach Sword can put the version define into the Sword_DEFINITIONS
> variable, and I'd be happy that I don't have to mess around fixing
> BibleTime's logic for detecting Sword. This also beats trying to use
> pkg-config from inside CMake.
> If this approach were to be implemented by Sword, the issue about
> whether the version macro needs to be in #defined in an include header
> file would probably become miniscule for BibleTime and other projects
> using CMake. So from this perspective I think I can better understand
> Troys standpoint. :) But although this pkg-config like approach for
> CMake projects would practically solve the issue BibleTime currently
> has with 1.7.0RC2, I still retain my position that generally it were
> good to define the version macro in a header file.
> Since Sword has two parallel build systems, both need to be maintained
> (both should generate the same files for installation, including the
> generated *.pc, *.h etc files). As far as I'm familiar with both build
> systems, neither makes it technically infeasible to implement what has
> been discussed in this thread. I'm willing to help as much as I can,
> but I'm more familiar with pure M4, pure CMake and poking Greg via IRC
> than with autotools. :)
> On 06.08.2013 19:26, Greg Hellings wrote:
>> CMake supports the same syntax as autotools for populating files
>> such as sword.pc. Since CMake already has the version information
>> in the string form, the only difficult part from my viewpoint is
>> to properly parse that into whatever final form we decide, whether
>> that's a _MAJOR, _MINOR and _PATCH or a single numeric version
>> with expanded numbers of variables.
> Personally, I'd add both forms just in case, but if I had to choose,
> I'd choose a single numeric version because it would result in simpler
> C/C++ preprocessor commands for most common version checks.
> Troy, can you please give us some information about the current
> SWORD_NUMVERSION values? From the commit (SVN 2952), I conclude that
> it equals (MAJOR * 10^5) + (MINOR * 10^3) + PATCH, but how exactly
> does PATCH relate to regular, alpha-, beta- and RC versions?
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.20 (GNU/Linux)
> -----END PGP SIGNATURE-----
> sword-devel mailing list: sword-devel at crosswire.org
> Instructions to unsubscribe/change your settings at above page
More information about the sword-devel