TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

79 lines
2.8 KiB

  1. #################################################
  2. #
  3. # (C) 2012-2020 Trinity Project
  4. #
  5. # Improvements and feedback are welcome
  6. #
  7. # This file is released under GPL >= 2
  8. #
  9. #################################################
  10. if( NOT TDE_RELEASE_ENTITIES )
  11. set( TDEVERSION_FILE "${CMAKE_SOURCE_DIR}/tdecore/tdeversion.h" )
  12. set( ENTITIES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/customization/entities/general.entities" )
  13. if( NOT EXISTS ${TDEVERSION_FILE} )
  14. file( RELATIVE_PATH TDEVERSION_FILE ${CMAKE_SOURCE_DIR} ${TDEVERSION_FILE} )
  15. tde_message_fatal( "${TDEVERSION_FILE} not found! Check your sources." )
  16. endif( )
  17. if( NOT EXISTS ${ENTITIES_FILE} )
  18. file( RELATIVE_PATH ENTITIES_FILE ${CMAKE_SOURCE_DIR} ${ENTITIES_FILE} )
  19. tde_message_fatal( "${ENTITIES_FILE} not found! Check your sources." )
  20. endif( )
  21. # read source metadata
  22. tde_read_src_metadata()
  23. # read TDE_VERSION_STRING
  24. file( STRINGS ${TDEVERSION_FILE} TDE_VERSION_STRING REGEX "define TDE_VERSION_STRING" )
  25. string( REGEX REPLACE ".*#define TDE_VERSION_STRING \"([^\"]*)\".*" "\\1"
  26. TDE_VERSION_STRING "${TDE_VERSION_STRING}" )
  27. if( "${TDE_VERSION_STRING}" STREQUAL "" )
  28. tde_message_fatal( "Cannot determine the Trinity version number." )
  29. endif( )
  30. # compose TDE_RELEASE_DATE
  31. if( "${TDE_VERSION_STRING}" MATCHES "DEVELOPMENT" )
  32. tde_curdatetime( TDE_RELEASE_DATE )
  33. else( )
  34. if( TDE_SCM_MODULE_DATETIME )
  35. set( TDE_RELEASE_DATE "${TDE_SCM_MODULE_DATETIME}" )
  36. else( )
  37. if( ${CMAKE_SYSTEM_NAME} MATCHES "BSD" )
  38. set( GNU_FIND_EXECUTABLE "gfind" )
  39. else( )
  40. set( GNU_FIND_EXECUTABLE "find" )
  41. endif( )
  42. execute_process(
  43. COMMAND ${GNU_FIND_EXECUTABLE} ${TDEVERSION_FILE} -printf "%Tm/%Te/%TY"
  44. OUTPUT_VARIABLE TDE_RELEASE_DATE
  45. OUTPUT_STRIP_TRAILING_WHITESPACE
  46. )
  47. endif( )
  48. endif( )
  49. string( REGEX REPLACE "^([0-9]+)/([0-9]+)*/([0-9]+).*" "2010-\\3"
  50. TDE_RELEASE_COPYRIGHT "${TDE_RELEASE_DATE}" )
  51. string( REGEX REPLACE "^([0-9]+)/([0-9]+)*/([0-9]+).*" "\\1"
  52. _release_month_num "${TDE_RELEASE_DATE}" )
  53. math( EXPR _release_month_index "${_release_month_num}-1" )
  54. set( _month_names "January;February;March;April;May;June;July;August;September;October;November;December" )
  55. list( GET _month_names ${_release_month_index} _release_month_name )
  56. string( REGEX REPLACE
  57. "^([0-9]+)/([0-9]+)*/([0-9]+).*"
  58. "${_release_month_name} \\2, \\3"
  59. TDE_RELEASE_DATE "${TDE_RELEASE_DATE}" )
  60. # update entities
  61. file( RELATIVE_PATH ENTITIES_FILE ${CMAKE_SOURCE_DIR} ${ENTITIES_FILE} )
  62. message( STATUS "Updating ${ENTITIES_FILE}
  63. TDE Release Version: ${TDE_VERSION_STRING}
  64. TDE Release Date: ${TDE_RELEASE_DATE}
  65. TDE Release Copyright: ${TDE_RELEASE_COPYRIGHT}"
  66. )
  67. set( TDE_RELEASE_ENTITIES 1 CACHE INTERNAL "" )
  68. endif( )