File: DateTimeFormat.cmake

package info (click to toggle)
ibus-table-chinese 1.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 29,812 kB
  • sloc: sh: 106; makefile: 11
file content (37 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# - Date/time format module.
#
# Included by:
#   ManageVersion
#
# Defines the following macros:
#    TODAY(date_var format [locale])
#      - Get date of today in specified format and locale.
#        * Parameters:
#     	   date_var: Result date string
#          format: date format for date(1)
#          locale: locale of the string. Use current locale setting if
#            locale is not given.
#
# Provides the following variables:
#    TODAY_CHANGELOG: Today in the format that is used in RPM Changelog.
#     e.g. Wed 08 Aug 2010
#
#    TODAY_SHORT: Short presentation of today, e.g. 20100818.
#

IF(NOT DEFINED _DATE_TIME_FORMAT_CMAKE_)
    SET(_DATE_TIME_FORMAT_CMAKE_ "DEFINED")

    MACRO(TODAY date_var format)
	INCLUDE(ManageVariable)
	SET(_locale ${ARGV2})
	IF(_locale)
	    SET(ENV{LC_ALL} ${_locale})
	ENDIF(_locale)
	COMMAND_OUTPUT_TO_VARIABLE(${date_var} date --utc "${format}")
    ENDMACRO(TODAY date_var format)

    TODAY(TODAY_CHANGELOG "+%a %b %d %Y" "C")
    TODAY(TODAY_SHORT "+%Y%m%d" "C")
ENDIF(NOT DEFINED _DATE_TIME_FORMAT_CMAKE_)