diff --git a/src/Makefile b/src/Makefile index 2606a58b2..5f37ce2fd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -304,9 +304,10 @@ endif .PHONY: kvazaar.pc init_submodules install install-pc install-prog install-lib .PHONY: install-dylib install-dll clean +kvazaar.pc: KVZ_VERSION = $(shell sed -n 's/^#define\s\+KVZ_VERSION\s\+\(.*\)/\1/ p' global.h) kvazaar.pc: kvazaar.pc.in Makefile sed -e "s;@prefix@;$(PREFIX);" -e "s;@libdir@;$(LIBDIR);" \ - -e "s;@VERSION@;$(VER_MAJOR).$(VER_MINOR).$(VER_RELEASE);" \ + -e "s;@VERSION@;$(KVZ_VERSION);" \ -e "s;@LIBS@;$(LIBS);" kvazaar.pc.in > $@ init_submodules: diff --git a/src/global.h b/src/global.h index a741d7dab..938e9b5fe 100644 --- a/src/global.h +++ b/src/global.h @@ -137,7 +137,12 @@ typedef int16_t coeff_t; //#define SIGN3(x) ((x) > 0) ? +1 : ((x) == 0 ? 0 : -1) #define SIGN3(x) (((x) > 0) - ((x) < 0)) -#define VERSION_STRING "0.5.0" + +#define QUOTE(x) #x +#define QUOTE_EXPAND(x) QUOTE(x) + +#define KVZ_VERSION 0.5.0 +#define VERSION_STRING QUOTE_EXPAND(KVZ_VERSION) //#define VERBOSE 1