summaryrefslogtreecommitdiffstats
path: root/Modules/WriteBasicConfigVersionFile.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2014-01-06 20:20:44 (GMT)
committerBrad King <brad.king@kitware.com>2014-01-29 14:45:18 (GMT)
commit41d2f2c4cbf41bfe3ba7118c1fea0ed5e2f5f683 (patch)
treed8f0a2a12e5cc3997af7aab785c4934c0c7fadeb /Modules/WriteBasicConfigVersionFile.cmake
parent7e142c5ac2be11097f7ff905b1606179803043d7 (diff)
downloadCMake-41d2f2c4cbf41bfe3ba7118c1fea0ed5e2f5f683.zip
CMake-41d2f2c4cbf41bfe3ba7118c1fea0ed5e2f5f683.tar.gz
CMake-41d2f2c4cbf41bfe3ba7118c1fea0ed5e2f5f683.tar.bz2
write_basic_package_version_file: use PROJECT_VERSION
In the write_basic_package_version_file(), the VERSION argument is now optional. If none is given, it falls back to ${PROJECT_VERSION}. Alex
Diffstat (limited to 'Modules/WriteBasicConfigVersionFile.cmake')
-rw-r--r--Modules/WriteBasicConfigVersionFile.cmake8
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)