diff options
-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 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() |