From 4db06bcf07dd61503f8d5888ebaffc1fa52161f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Yl=C3=A4-Outinen?= Date: Mon, 17 Aug 2015 16:11:46 +0300 Subject: [PATCH] Use correct version in kvazaar.pc. Changes kvazaar.pc to use kvazaar version instead of the library version. The version number is extracted from global.h using sed. --- src/Makefile | 3 ++- src/global.h | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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 0fdb565cf..dfb70baf8 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