PandaVersion.cmake 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # This file defines the current version number for Panda. It is read
  2. # by the top CMakeLists.txt, which puts it in the global namespace for
  3. # all CMake scripts for Panda.
  4. set(PANDA_VERSION "1.9.0" CACHE STRING
  5. "Use dots to separate the major, minor, and sequence numbers.")
  6. option(PANDA_OFFICIAL_VERSION
  7. "This variable will be defined to false in the CVS repository, but
  8. scripts that generate source tarballs and/or binary releases for
  9. distribution, by checking out Panda from an official CVS tag,
  10. should explictly set this to true. When false, it indicates that
  11. the current version of Panda was checked out from CVS, so it may
  12. not be a complete representation of the indicated version."
  13. OFF)
  14. set(PANDA_DISTRIBUTOR homebuilt CACHE STRING
  15. "This string is reported verbatim by PandaSystem::get_distributor().
  16. It should be set by whoever provides a particular distribution of
  17. Panda. If you build your own Panda, leave this unchanged.")
  18. set(PANDA_DIST_USE_LICENSES "BSD-3;BSD-2;MIT" CACHE STRING
  19. "This is a list of allowed licenses for 3rd-party packages to build
  20. support for when performing a Distribution build of Panda3d.
  21. Note: This only is checked for packages that CMake has declared with a
  22. particular license. Some packages don't have a listed license because
  23. they are almost always required/used, or because they are only used in
  24. plugins that can be easily removed (eg. directx, ffmpeg, fmod, ...).")
  25. set(PANDA_PACKAGE_VERSION CACHE STRING
  26. "This string is used to describe the Panda3D \"package\" associated
  27. with this current build of Panda. It should increment with major
  28. and minor version changes, but not sequence (or \"bugfix\") changes.
  29. It should be unique for each unique distributor. The default is
  30. the empty string, which means this build does not precisely match
  31. any distributable Panda3D packages. If you are making a Panda3D
  32. build which you will be using to produce a distributable Panda3D
  33. package, you should set this string appropriately.")
  34. set(P3D_PLUGIN_VERSION "1.0.4" CACHE STRING
  35. "We also define a version for the Panda3D plugin/runtime,
  36. i.e. nppanda3d.dll, p3dactivex.ocx, and panda3d.exe. This is an
  37. independent version number from PANDA_VERSION or
  38. PANDA_PACKAGE_VERSION, because it is anticipated that this plugin
  39. code, once settled, will need to be updated much less frequently
  40. than Panda itself.")
  41. set(P3D_COREAPI_VERSION "${P3D_PLUGIN_VERSION}.1" CACHE STRING
  42. "Finally, there's a separate version number for the Core API. At
  43. first, we didn't believe we needed a Core API version number, but
  44. in this belief we were naive. This version number is a little less
  45. strict in its format requirements than P3D_PLUGIN_VERSION, above,
  46. and it doesn't necessarily consist of a specific number of
  47. integers, but by convention it will consist of four integers, with
  48. the first three matching the plugin version, and the fourth integer
  49. being incremented with each new Core API revision.")
  50. mark_as_advanced(PANDA_VERSION PANDA_OFFICIAL_VERSION
  51. PANDA_PACKAGE_VERSION P3D_PLUGIN_VERSION P3D_COREAPI_VERSION
  52. PANDA_DIST_USE_LICENSES)
  53. # Separate the Panda3D version into its three components.
  54. string(REPLACE "." ";" PANDA_VERSION_LIST "${PANDA_VERSION}")
  55. list(GET PANDA_VERSION_LIST 0 PANDA_MAJOR_VERSION)
  56. list(GET PANDA_VERSION_LIST 1 PANDA_MINOR_VERSION)
  57. list(GET PANDA_VERSION_LIST 2 PANDA_SEQUENCE_VERSION)
  58. # The version gets a "c" at the end if it's not an official one.
  59. if(PANDA_OFFICIAL_VERSION)
  60. set(VERSION_SUFFIX "")
  61. else()
  62. set(VERSION_SUFFIX "c")
  63. endif()
  64. set(PANDA_VERSION_STR "${PANDA_VERSION}${VERSION_SUFFIX}")
  65. # This symbol is used to enforce ABI incompatibility between
  66. # major versions of Panda3D.
  67. set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION})
  68. # The Panda version as a number, with three digits reserved
  69. # for each component.
  70. math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_VERSION}*1000 + ${PANDA_SEQUENCE_VERSION}")
  71. # Separate the plugin version into its three components.
  72. string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}")
  73. list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION)
  74. list(GET P3D_PLUGIN_VERSION_LIST 1 P3D_PLUGIN_MINOR_VERSION)
  75. list(GET P3D_PLUGIN_VERSION_LIST 2 P3D_PLUGIN_SEQUENCE_VERSION)
  76. set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}${VERSION_SUFFIX}")
  77. # The plugin version as dot-delimited integer quad, according to MS
  78. # conventions for DLL version numbers.
  79. if(PANDA_OFFICIAL_VERSION)
  80. set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.1000")
  81. else()
  82. set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.0")
  83. endif()
  84. # The same thing as a comma-delimited quad.
  85. string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}")