Make sure to check for existance of ${CMAKE_SOURCE_DIR}/.tdescminfo

before trying to read it.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 4940b4ebe7)
r14.0.x
Michele Calgaro 2 years ago
parent 82576df1c0
commit 26f52b5d7e
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -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()

Loading…
Cancel
Save