diff options
Diffstat (limited to 'Modules/WriteBasicConfigVersionFile.cmake')
-rw-r--r-- | Modules/WriteBasicConfigVersionFile.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake index 95187b4..7d28e95 100644 --- a/Modules/WriteBasicConfigVersionFile.cmake +++ b/Modules/WriteBasicConfigVersionFile.cmake @@ -6,7 +6,7 @@ # # :: # -# WRITE_BASIC_CONFIG_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion) ) +# WRITE_BASIC_CONFIG_VERSION_FILE( filename [VERSION major.minor.patch] COMPATIBILITY (AnyNewerVersion|SameMajorVersion) ) # # # @@ -46,7 +46,11 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename) endif() if("${CVF_VERSION}" STREQUAL "") - message(FATAL_ERROR "No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()") + if ("${PROJECT_VERSION}" STREQUAL "") + message(FATAL_ERROR "No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()") + else() + set(CVF_VERSION "${PROJECT_VERSION}") + endif() endif() configure_file("${versionTemplateFile}" "${_filename}" @ONLY) |