THRIFT-1438: lib/cpp/src/windows/config.h should read version from configure.ac rather than a #define
Client: compiler
Patch: Jake Farrell

Converts compiler/cpp/src/windows/version.h to a template and automates uses of configure.ac version rather than a random #define version string.



git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1352767 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am
index b7d1b50..391f35d 100644
--- a/compiler/cpp/Makefile.am
+++ b/compiler/cpp/Makefile.am
@@ -105,6 +105,6 @@
              $(WINDOWS_DIST)
 
 clean-local:
-	$(RM) thriftl.cc thrifty.cc thrifty.h version.h
+	$(RM) thriftl.cc thrifty.cc thrifty.h version.h windows/version.h
 
 src/main.cc: version.h
diff --git a/compiler/cpp/src/windows/version.h b/compiler/cpp/src/windows/version.h.in
similarity index 96%
rename from compiler/cpp/src/windows/version.h
rename to compiler/cpp/src/windows/version.h.in
index 9e681d5..94b7c56 100644
--- a/compiler/cpp/src/windows/version.h
+++ b/compiler/cpp/src/windows/version.h.in
@@ -29,7 +29,7 @@
 #endif
 
 #define PATH_MAX MAX_PATH
-#define THRIFT_VERSION "0.9.0-dev"
+#define THRIFT_VERSION "@PACKAGE_VERSION@"
 
 #ifndef S_ISDIR
 #define S_ISDIR(mode)  (((mode) & S_IFMT) == S_IFDIR)
diff --git a/configure.ac b/configure.ac
index 6855f35..e595447 100755
--- a/configure.ac
+++ b/configure.ac
@@ -574,6 +574,7 @@
   Makefile
   compiler/cpp/Makefile
   compiler/cpp/version.h
+  compiler/cpp/src/windows/version.h
   lib/Makefile
   lib/cpp/Makefile
   lib/cpp/test/Makefile