CMakeLists.txt: Moved the version number into a file version.txt.

This will allow us to retrieve version.txt from GitHub to determine if
an update is available.
This commit is contained in:
David Korth 2020-09-20 00:45:11 -04:00
parent ed1ae5e473
commit a3a1b6e1af
2 changed files with 14 additions and 1 deletions

View File

@ -1,7 +1,19 @@
# ROM Properties Page Shell Extension
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
CMAKE_POLICY(SET CMP0048 NEW)
PROJECT(rom-properties VERSION 1.6.1.1)
# Read the project version.
FILE(STRINGS version.txt RP_VERSION_FILE)
IF(NOT RP_VERSION_FILE)
MESSAGE(FATAL_ERROR "version.txt not found; cannot determine project version.")
ENDIF(NOT RP_VERSION_FILE)
LIST(GET RP_VERSION_FILE 0 RP_VERSION)
UNSET(RP_VERSION_FILE)
PROJECT(rom-properties VERSION ${RP_VERSION})
IF(PROJECT_VERSION_TWEAK)
SET(PROJECT_VERSION_DEVEL_PLUS "+")
ENDIF(PROJECT_VERSION_TWEAK)
MESSAGE(STATUS "ROM Properties Page Shell Extension v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_DEVEL_PLUS}")
# CMAKE_PROJECT_VERSION was introduced in 3.12.
IF(NOT CMAKE_PROJECT_VERSION OR NOT CMAKE_PROJECT_VERSION_MAJOR)

1
version.txt Normal file
View File

@ -0,0 +1 @@
1.6.1.1