summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-06-20 00:14:36 +0900
committerSlávek Banko <slavek.banko@axis.cz>2022-06-19 17:34:44 +0200
commit2a496fc80d844771fd47c0b8542f77854680ff0a (patch)
tree92d2ff633491b5da6584afa8bc1ac019feda3426
parent088f3e3bdc452caa533533c16ee5b1133cfb0592 (diff)
downloadcmake-v3.5.13-sru.tar.gz
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.cmake7
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()