summaryrefslogtreecommitdiff
path: root/Modules/WriteCompilerDetectionHeader.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-06-05 12:34:16 +0200
committerStephen Kelly <steveire@gmail.com>2014-06-05 13:58:27 +0200
commit567af1a596455b096c9261317b1562ceb89f2e95 (patch)
treeeeae400c6c7947941342fedab7a4d3130926faf9 /Modules/WriteCompilerDetectionHeader.cmake
parent2336ec514080014430589166287e076c7e5608d8 (diff)
downloadcmake-567af1a596455b096c9261317b1562ceb89f2e95.tar.gz
WCDH: Issue a better message for version compatibility.
Diffstat (limited to 'Modules/WriteCompilerDetectionHeader.cmake')
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index f80943dbdc..3f8d835b7f 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -197,8 +197,13 @@ function(write_compiler_detection_header
if(NOT _WCD_VERSION)
set(_WCD_VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
endif()
- if (_WCD_VERSION VERSION_LESS 3.1.0) # Version which introduced this function
- message(FATAL_ERROR "VERSION parameter too low.")
+ set(_min_version 3.1.0) # Version which introduced this function
+ if (_WCD_VERSION VERSION_LESS _min_version)
+ set(err "VERSION compatibility for write_compiler_detection_header is set to ${_WCD_VERSION}, which is too low.")
+ set(err "${err} It must be set to at least ${_min_version}. ")
+ set(err "${err} Either set the VERSION parameter to the write_compiler_detection_header function, or update")
+ set(err "${err} your minimum required CMake version with the cmake_minimum_required command.")
+ message(FATAL_ERROR "${err}")
endif()
set(compilers