diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-06-20 00:14:36 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-06-19 17:34:44 +0200 |
commit | 2a496fc80d844771fd47c0b8542f77854680ff0a (patch) | |
tree | 92d2ff633491b5da6584afa8bc1ac019feda3426 | |
parent | 088f3e3bdc452caa533533c16ee5b1133cfb0592 (diff) | |
download | tde-cmake-v3.5.13-sru.tar.gz tde-cmake-v3.5.13-sru.zip |
Make sure to check for existance of ${CMAKE_SOURCE_DIR}/.tdescminfov3.5.13-sru
before trying to read it.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 4940b4ebe7d5520f88aaa85eb2c6f9b31d3a03f1)
-rw-r--r-- | modules/TDEVersion.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/TDEVersion.cmake b/modules/TDEVersion.cmake index 689eff6..f9c281a 100644 --- a/modules/TDEVersion.cmake +++ b/modules/TDEVersion.cmake @@ -19,8 +19,11 @@ macro( tde_set_project_version ) unset( VERSION ) - file( STRINGS ${CMAKE_SOURCE_DIR}/.tdescminfo VERSION_STRING REGEX "^Version:.+$" ) - string( REGEX REPLACE "^Version: ([0-9]+\.[0-9]+\.[0-9]+.*)$" "\\1" VERSION "${VERSION_STRING}" ) + if( EXISTS ${CMAKE_SOURCE_DIR}/.tdescminfo ) + file( STRINGS ${CMAKE_SOURCE_DIR}/.tdescminfo VERSION_STRING REGEX "^Version:.+$" ) + string( REGEX REPLACE "^Version: ([0-9]+\.[0-9]+\.[0-9]+.*)$" "\\1" VERSION "${VERSION_STRING}" ) + endif() + if( NOT VERSION ) set( VERSION "${DEFAULT_VERSION}" ) endif() |