diff --git a/dtool/Version.cmake b/dtool/Version.cmake index a9ca6c57b0..69efa2477c 100644 --- a/dtool/Version.cmake +++ b/dtool/Version.cmake @@ -1,52 +1,90 @@ -## Panda Version Information ## +# This file defines the current version number for Panda. It is read +# by the top CMakeLists.txt, which puts it in the global namespace for +# all CMake scripts for Panda. + set(PANDA_VERSION "1.9.0" CACHE STRING "Use dots to separate the major, minor, and sequence numbers.") -set(PANDA_OFFICIAL_VERSION FALSE CACHE BOOL - "If on, signifies this is a tagged release rather than a repository snapshot. -Scripts that generate source tarballs and/or binary releases for -distribution should explicitly set this to true.") -set(PANDA_DISTRIBUTOR "homebuilt" CACHE STRING + +option(PANDA_OFFICIAL_VERSION + "This variable will be defined to false in the CVS repository, but +scripts that generate source tarballs and/or binary releases for +distribution, by checking out Panda from an official CVS tag, +should explictly set this to true. When false, it indicates that +the current version of Panda was checked out from CVS, so it may +not be a complete representation of the indicated version." + OFF) + +set(PANDA_DISTRIBUTOR homebuilt CACHE STRING "This string is reported verbatim by PandaSystem::get_distributor(). -It should be set by whoever provides a particular distribution of Panda. -If you build your own Panda, leave this unchanged.") +It should be set by whoever provides a particular distribution of +Panda. If you build your own Panda, leave this unchanged.") -set(PANDA_PLUGIN_VERSION "1.1.0" CACHE STRING - "We also define a version for the Panda3D plugin/runtime. This is an -independent version number from PANDA_VERSION or PANDA_PACKAGE_VERSION, -because it is anticipated that this plugin code, once settled, -will need to be updated much less frequently than Panda itself.") -set(P3D_PLUGIN_VERSION "${PANDA_PLUGIN_VERSION}") -set(P3D_COREAPI_VERSION "${P3D_PLUGIN_VERSION}.1") +set(PANDA_PACKAGE_VERSION CACHE STRING + "This string is used to describe the Panda3D \"package\" associated +with this current build of Panda. It should increment with major +and minor version changes, but not sequence (or \"bugfix\") changes. +It should be unique for each unique distributor. The default is +the empty string, which means this build does not precisely match +any distributable Panda3D packages. If you are making a Panda3D +build which you will be using to produce a distributable Panda3D +package, you should set this string appropriately.") + +set(P3D_PLUGIN_VERSION "1.0.4" CACHE STRING + "We also define a version for the Panda3D plugin/runtime, +i.e. nppanda3d.dll, p3dactivex.ocx, and panda3d.exe. This is an +independent version number from PANDA_VERSION or +PANDA_PACKAGE_VERSION, because it is anticipated that this plugin +code, once settled, will need to be updated much less frequently +than Panda itself.") + +set(P3D_COREAPI_VERSION "${P3D_PLUGIN_VERSION}.1" CACHE STRING + "Finally, there's a separate version number for the Core API. At +first, we didn't believe we needed a Core API version number, but +in this belief we were naive. This version number is a little less +strict in its format requirements than P3D_PLUGIN_VERSION, above, +and it doesn't necessarily consist of a specific number of +integers, but by convention it will consist of four integers, with +the first three matching the plugin version, and the fourth integer +being incremented with each new Core API revision.") -## Parse Panda3D Subversions ## +# Separate the Panda3D version into its three components. string(REPLACE "." ";" PANDA_VERSION_LIST "${PANDA_VERSION}") list(GET PANDA_VERSION_LIST 0 PANDA_MAJOR_VERSION) list(GET PANDA_VERSION_LIST 1 PANDA_MINOR_VERSION) list(GET PANDA_VERSION_LIST 2 PANDA_SEQUENCE_VERSION) +# The version gets a "c" at the end if it's not an official one. if(PANDA_OFFICIAL_VERSION) - set(PANDA_VERSION_STR "${PANDA_VERSION}c") + set(VERSION_SUFFIX "") else() - set(PANDA_VERSION_STR "${PANDA_VERSION}c") + set(VERSION_SUFFIX "c") endif() +set(PANDA_VERSION_STR "${PANDA_VERSION}c") + +# This symbol is used to enforce ABI incompatibility between +# major versions of Panda3D. set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION}) +# The Panda version as a number, with three digits reserved +# for each component. math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_VERSION}*1000 + ${PANDA_SEQUENCE_VERSION}") - -## Parse Plugin-framework Subversions ## +# Separate the plugin version into its three components. string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}") list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION) list(GET P3D_PLUGIN_VERSION_LIST 1 P3D_PLUGIN_MINOR_VERSION) list(GET P3D_PLUGIN_VERSION_LIST 2 P3D_PLUGIN_SEQUENCE_VERSION) +set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}${VERSION_SUFFIX}") + +# The plugin version as dot-delimited integer quad, according to MS +# conventions for DLL version numbers. if(PANDA_OFFICIAL_VERSION) - set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}") - set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.1000") + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.1000") else() - set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}c") - set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.0") + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.0") endif() +# The same thing as a comma-delimited quad. string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") diff --git a/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake b/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake index db059b6870..f268bfbd21 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake +++ b/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake @@ -16,6 +16,6 @@ * Generated automatically by CMake. ***************************** DO NOT EDIT *************************/ -# include "dtoolbase.h" +#include "dtoolbase.h" EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@ = 0; diff --git a/dtool/src/dtoolutil/checkPandaVersion.h.cmake b/dtool/src/dtoolutil/checkPandaVersion.h.cmake index de76900fc0..583f3b00f6 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.h.cmake +++ b/dtool/src/dtoolutil/checkPandaVersion.h.cmake @@ -26,14 +26,14 @@ DLL; but the system linker will prevent the DLL from loading with an undefined symbol. */ -# include "dtoolbase.h" +#include "dtoolbase.h" extern EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@; -# ifndef WIN32 +#ifndef WIN32 /* For Windows, exporting the symbol from the DLL is sufficient; the DLL will not load unless all expected public symbols are defined. Other systems may not mind if the symbol is absent unless we explictly write code that references it. */ static int check_panda_version = @PANDA_VERSION_SYMBOL@; -# endif +#endif diff --git a/dtool/src/dtoolutil/pandaVersion.h.cmake b/dtool/src/dtoolutil/pandaVersion.h.cmake index 19321d09a8..350a229e4e 100644 --- a/dtool/src/dtoolutil/pandaVersion.h.cmake +++ b/dtool/src/dtoolutil/pandaVersion.h.cmake @@ -18,7 +18,7 @@ Do NOT attempt to edit the version number in this file. This is a generated file, and your changes to this file will not persist. To - increment the version number, modify dtool/PandaVersion.pp and + increment the version number, modify dtool/PandaVersion.cmake and re-run ppremake. ***************************** DO NOT EDIT *************************/ @@ -70,8 +70,8 @@ #if HAVE_P3D_PLUGIN /* Similar definitions for the plugin versioning, if in use. */ -#define P3D_PLUGIN_MAJOR_VERSION "@P3D_PLUGIN_MAJOR_VERSION@" -#define P3D_PLUGIN_MINOR_VERSION "@P3D_PLUGIN_MINOR_VERSION@" -#define P3D_PLUGIN_SEQUENCE_VERSION "@P3D_PLUGIN_SEQUENCE_VERSION@" +#define P3D_PLUGIN_MAJOR_VERSION @P3D_PLUGIN_MAJOR_VERSION@ +#define P3D_PLUGIN_MINOR_VERSION @P3D_PLUGIN_MINOR_VERSION@ +#define P3D_PLUGIN_SEQUENCE_VERSION @P3D_PLUGIN_SEQUENCE_VERSION@ #define P3D_COREAPI_VERSION_STR "@P3D_COREAPI_VERSION_STR@" #endif