[sword-devel] SWORD_VERSION

Troy A. Griffitts scribe at crosswire.org
Tue Oct 25 07:37:49 MST 2011


Hey Jaak,

I can see how this is useful, though I believe the standard way to 
handle this with any package is to define what you need with, e.g.,

pkg-config --atleast-version=1.6.2 sword

You can define what you want, like INCLUDES_WLC_VERSIFICATION, or 
whatever you need to have special code for, based on the SWORD library 
version.  Unless you change the whole world of package versioning 
formats, I'm not sure it helps much for just us to add a new format.  If 
you still want to use the comparable version number in your code, you 
could currently do something like

SWORD_VERSION := $(shell pkg-config --modversion sword | awk -F. 
'{printf("%0.2x%0.2x%0.2x\n",$$1,$$2,$$3)}')
CFLAGS += -DSWORD_VERSION=0x$(SWORD_VERSION)

which would also work for you with any package.

Hope this helps.  If you still think we should define a special hex 
version number in future releases, please let me know.

Troy



On 10/24/2011 08:12 AM, Jaak Ristioja wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Troy!
>
> I'm afraid that this doesn't help much if I need to conditionally
> compile stuff based on the version of Sword. The following preprocessor
> directive just wouldn't work, if the the macro were in the form of #.#.#:
>
>    #if SWORD_VERSION>  1.6.1
>
> Did you check out how QT_VERSION works?
>
> Jaak
>
>
> On 24.10.2011 01:44, Troy A. Griffitts wrote:
>> You can use a few things:
>>
>> CFLAGS += -DSWORD_VERSION=`pkg-config --modversion sword`
>>
>> _________________
>>
>> #include<swversion.h>
>> #include<iostream>
>>
>> using namespace sword;
>> using namespace std;
>>
>> int main(int argc, char **argv) {
>>
>>       cout<<  SWVersion::currentVersion<<  endl;
>>
>>       return 0;
>> }
>>
>> _______________
>>
>> #include<sword/config.h>
>> #include<iostream>
>>
>> using namespace std;
>>
>> int main(int argc, char **argv) {
>>
>>      cout<<  PACKAGE_VERSION<<  endl;
>>
>>      return 0;
>> }
>>
>> __________________
>>
>> Hope this helps,
>>
>> Troy
>>
>>
>>
>>
>> On 10/23/2011 2:45 PM, Jaak Ristioja wrote:
>> Hello!
>>
>> Could the Sword library please provide a SWORD_VERSION (and possibly
>> SWORD_VERSION_STR) macro alike the QT_VERSION macro in Qt (see
>> http://doc.qt.nokia.com/latest/qtglobal.html#QT_VERSION ). This would
>> allow compilation of applications using Sword to be more easily
>> (backward and forward) compatible with different Sword versions. Thanks!
>>
>> Blessings!
>> Jaak Ristioja
>> BibleTime team
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.17 (GNU/Linux)
>
> iQgcBAEBAgAGBQJOpQG0AAoJELeXyoqzFNdNVng//0VDTIoPbJse4TIRPVl8cFqk
> GsXvNwgsrM6jyxhNYn/wN3d2hbkisUYdyY+h/SDC4zq1l4+keNjZcHKrrxVlsIsz
> 3n5DlUCvcs1jQRNzEd6IYjZPkwJGKb1PZiOQpG5qxfNT45/IsHuS6TBvvY7mzTcw
> ADEkdi8lXbGUI5wBuOirG9Z9veZeDUscf6aYzOq4yXn7pic2oKwO0swSJYAxWA2u
> WKHjW+MCJg4F7ZYKWWjICydaB5T+MbWNglpi9dAPyiDZ0GdbSqZzwB31tYr2mPcr
> 0fz5oGPDcfNj+8wGWs+VqbjqW7XSiTHPaEdtHkzwZ4O7DbXCf5WJ6/fxz3S52RsY
> ZIhBBD7PRObC2Ihwq4jZE3ExyorqFWHMQnthnlIPwcTHrLyt9SvioCLteYH5vYq1
> Iev3JmVH4V8ay62Y6XNxZHxog7z0QHfwylicHkSEC7YtTOksrrfNKFQxekbVZdq4
> DA5StzipIsP19kfyVAusdX7bOlKUBxKABFYuHZ1mLJ7xTKkEyptXj7UTvwbVxXMh
> ZLsOu11pEyefvDdZaFGSXXtU9Nwrur+EtAQ8jghi4/gYiORZo3Y8/0FTq7BdVFku
> dH54DrWgDbb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cEgz1wVZ86V7r9mBvv4KwAAJW+kPcZuhFRPKAT
> JeU+i/7XWBlV8TaJLatI
> =RJ/i
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list