summaryrefslogtreecommitdiffstats
path: root/modules/TDEVersion.cmake
blob: 29a695900b614b6af1c8167a7621d03680acbf54 (plain)
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
#################################################
#
#  (C) 2022 Michele Calgaro
#  michele (DOT) calgaro (AT) yahoo (DOT) it
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

# Centralized place where to set the minimum cmake version required in TDE

set( TDE_CMAKE_MINIMUM_VERSION 3.5 )


#################################################
#####
##### tde_set_project_version

macro( tde_set_project_version )

  set( DEFAULT_VERSION "R14.1.4~[DEVELOPMENT]" )

  unset( VERSION )

  if( EXISTS ${CMAKE_SOURCE_DIR}/.tdescminfo )
    file( STRINGS ${CMAKE_SOURCE_DIR}/.tdescminfo VERSION_STRING REGEX "^Version:.+$" )
    string( REGEX REPLACE "^Version: (R[0-9]+\\.[0-9]+\\.[0-9]+.*)$" "\\1" VERSION "${VERSION_STRING}" )
  endif()

  if( NOT VERSION )
    set( VERSION "${DEFAULT_VERSION}" )
  endif()

endmacro( )