summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-06-20 00:14:36 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-06-20 00:14:46 +0900
commit4940b4ebe7d5520f88aaa85eb2c6f9b31d3a03f1 (patch)
treed188e17ad41599cce5f81c7f47697afe4ea4e20b
parent11a6934bbb70fd1dde99b77afcec2855c69699b6 (diff)
downloadcmake-master.tar.gz
cmake-master.zip
Make sure to check for existance of ${CMAKE_SOURCE_DIR}/.tdescminfoHEADmaster
before trying to read it. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--modules/TDEVersion.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/TDEVersion.cmake b/modules/TDEVersion.cmake
index a222152..138e272 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: (R[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: (R[0-9]+\.[0-9]+\.[0-9]+.*)$" "\\1" VERSION "${VERSION_STRING}" )
+ endif()
+
if( NOT VERSION )
set( VERSION "${DEFAULT_VERSION}" )
endif()