]> git.mxchange.org Git - simgear.git/commitdiff
Port version-defined-in-a-file logic over from fg.
authorJames Turner <zakalawe@mac.com>
Sat, 21 May 2011 13:56:10 +0000 (14:56 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 21 May 2011 13:56:10 +0000 (14:56 +0100)
CMakeLists.txt
configure.ac
version [new file with mode: 0644]

index b2187a495af657587cd2493ace78cb8eca1e331b..489be89c3d72edf688bd6ed10d8ac768745e486d 100644 (file)
@@ -6,7 +6,9 @@ include (CPack)
 
 project(SimGear)
 
-set(SIMGEAR_VERSION "2.3.0")
+# read 'version' file into a variable (stripping any newlines or spaces)
+file(READ version versionFile)
+string(STRIP ${versionFile} SIMGEAR_VERSION)
 
 #packaging
 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
index e37cb8ed5f256e4c17f2df1cd8cc4f6dd501fbb9..9a9b2bb53a54c41f65a17c949dc1f97a0f949e14 100644 (file)
@@ -1,15 +1,17 @@
-dnl Process this file with autoget.sh to produce a working configure
+dnl Process this file with autogen.sh to produce a working configure
 dnl script.
 
-AC_INIT
+AC_INIT(SimGear, m4_esyscmd([cat ./version | tr -d '\n']), [http://www.flightgear.org])
+
+dnl Ensure touching the version causes autoconf to re-run
+AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/version'])
+
 AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx])
 
 dnl Require at least automake 2.52
 AC_PREREQ(2.52)
 
 dnl Initialize the automake stuff
-AM_INIT_AUTOMAKE(SimGear, 2.3.0)
-
 dnl Specify KAI C++ compiler and flags.
 dnl Borrowed with slight modification from blitz distribution.
 AC_ARG_WITH(cxx,
@@ -23,6 +25,9 @@ AC_ARG_WITH(cxx,
     ;;
   esac
 ])
+dnl set the $host variable based on local machine/os
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE([dist-bzip2])
 
 AC_ARG_ENABLE(headless,
         AS_HELP_STRING([--enable-headless],[Enable only packages for headless build]))
diff --git a/version b/version
new file mode 100644 (file)
index 0000000..276cbf9
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+2.3.0