version.inc 1.9 KB
Newer Older
1 2 3
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)

H
Hui Li 已提交
4 5 6
IF (DEFINED VERNUMBER)
  SET(TD_VER_NUMBER ${VERNUMBER})
ELSE ()
P
plum-lihui 已提交
7
  SET(TD_VER_NUMBER "2.0.10.0")
H
Hui Li 已提交
8
ENDIF ()
9

H
Hui Li 已提交
10 11 12 13 14
IF (DEFINED VERCOMPATIBLE)
  SET(TD_VER_COMPATIBLE ${VERCOMPATIBLE})
ELSE ()
  SET(TD_VER_COMPATIBLE "2.0.0.0")
ENDIF ()
15

H
Hui Li 已提交
16 17 18 19
IF (DEFINED GITINFO)
  SET(TD_VER_GIT ${GITINFO})
ELSE ()
  SET(TD_VER_GIT "community")
20 21
ENDIF ()

H
Hui Li 已提交
22 23 24 25
IF (DEFINED GITINFOI)
  SET(TD_VER_GIT_INTERNAL ${GITINFOI})
ELSE ()
  SET(TD_VER_GIT_INTERNAL "internal")
26 27
ENDIF ()

H
Hui Li 已提交
28 29 30 31
IF (DEFINED VERDATE)
  SET(TD_VER_DATE ${VERDATE})
ELSE ()
  STRING(TIMESTAMP TD_VER_DATE "%Y-%m-%d %H:%M:%S") 
32 33
ENDIF ()

H
Hui Li 已提交
34 35 36 37
IF (DEFINED VERTYPE)
  SET(TD_VER_VERTYPE ${VERTYPE})
ELSE ()
  SET(TD_VER_VERTYPE "stable")
38
ENDIF ()
H
Hui Li 已提交
39 40 41 42

IF (DEFINED CPUTYPE)
  SET(TD_VER_CPUTYPE ${CPUTYPE})
ELSE ()
S
Shengliang Guan 已提交
43 44
  IF (TD_WINDOWS_32)
    SET(TD_VER_CPUTYPE "x86")
S
Shengliang Guan 已提交
45 46 47 48 49 50
  ELSEIF (TD_LINUX_32)
    SET(TD_VER_CPUTYPE "x86")  
  ELSEIF (TD_ARM_32)
    SET(TD_VER_CPUTYPE "x86")  
  ELSEIF (TD_MIPS_32)
    SET(TD_VER_CPUTYPE "x86")  
S
Shengliang Guan 已提交
51 52 53
  ELSE ()
    SET(TD_VER_CPUTYPE "x64")
  ENDIF ()
54 55
ENDIF ()

H
Hui Li 已提交
56 57 58 59
IF (DEFINED OSTYPE)
  SET(TD_VER_OSTYPE ${OSTYPE})
ELSE ()
  SET(TD_VER_OSTYPE "Linux")
60 61
ENDIF ()

H
Hui Li 已提交
62 63 64 65 66 67 68 69 70 71 72 73 74
MESSAGE(STATUS "============= compile version parameter information start ============= ")
MESSAGE(STATUS "ver number:" ${TD_VER_NUMBER})
MESSAGE(STATUS "compatible ver number:" ${TD_VER_COMPATIBLE})
MESSAGE(STATUS "communit commit id:" ${TD_VER_GIT})
MESSAGE(STATUS "internal commit id:" ${TD_VER_GIT_INTERNAL})
MESSAGE(STATUS "build date:" ${TD_VER_DATE})
MESSAGE(STATUS "ver type:" ${TD_VER_VERTYPE})
MESSAGE(STATUS "ver cpu:" ${TD_VER_CPUTYPE})
MESSAGE(STATUS "os type:" ${TD_VER_OSTYPE})
MESSAGE(STATUS "============= compile version parameter information end  ============= ")

STRING(REPLACE "." "_" TD_LIB_VER_NUMBER ${TD_VER_NUMBER})

75
CONFIGURE_FILE("${TD_COMMUNITY_DIR}/src/util/src/version.c.in" "${TD_COMMUNITY_DIR}/src/util/src/version.c")