VersionConfiguration.cmake 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Get the current date.
  2. # include(WebClientVariables)
  3. string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
  4. # Get git revision version
  5. include(GetGitRevisionDescription)
  6. get_git_head_revision(REFSPEC FULL_GIT_REVISION)
  7. if(FULL_GIT_REVISION STREQUAL "GITDIR-NOTFOUND")
  8. set(GIT_REVISION "git")
  9. else(FULL_GIT_REVISION STREQUAL "GITDIR-NOTFOUND")
  10. string(SUBSTRING ${FULL_GIT_REVISION} 0 8 GIT_REVISION)
  11. endif(FULL_GIT_REVISION STREQUAL "GITDIR-NOTFOUND")
  12. # Get the build number if available
  13. if(DEFINED ENV{BUILD_NUMBER})
  14. set(VERSION_BUILD "$ENV{BUILD_NUMBER}")
  15. set(VERSION_BUILD_NR "$ENV{BUILD_NUMBER}")
  16. else()
  17. set(VERSION_BUILD "dev")
  18. set(VERSION_BUILD_NR "0")
  19. endif()
  20. set(VERSION_MAJOR 1)
  21. set(VERSION_MINOR 3)
  22. set(VERSION_NANO 5)
  23. option(UPGRADE_DEBUG "" OFF)
  24. if(UPGRADE_DEBUG)
  25. set(VERSION_STRING "1.0.4.177-195ef65f")
  26. set(VERSION_STRING_SHORT "1.0.4")
  27. set(CANONICAL_VERSION_STRING "1.0.4-195ef65f")
  28. else()
  29. set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_NANO}.${VERSION_BUILD}-${GIT_REVISION}")
  30. set(VERSION_STRING_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_NANO}")
  31. set(CANONICAL_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_NANO}-${GIT_REVISION}")
  32. endif()
  33. configure_file(src/core/Version.cpp.in src/core/Version.cpp)