diff options
author | Brad King <brad.king@kitware.com> | 2014-07-07 12:54:33 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-07-07 12:54:33 (GMT) |
commit | c9feebb9e88532680c0cbd6066f9ffaf45f747b1 (patch) | |
tree | 1f1307ef16a720fee3e41a771277986857eee11d /Modules | |
parent | 55c38b0077fe4c56eafbc4f6a5aa3f6b83839c2c (diff) | |
parent | b47c125ff7f088c87183e6ad60850aefdaf43757 (diff) | |
download | CMake-c9feebb9e88532680c0cbd6066f9ffaf45f747b1.zip CMake-c9feebb9e88532680c0cbd6066f9ffaf45f747b1.tar.gz CMake-c9feebb9e88532680c0cbd6066f9ffaf45f747b1.tar.bz2 |
Merge topic 'WriteCompilerDetectionHeader-valid-prefix'
b47c125f WCDH: Ensure that the prefix argument to the macro is valid.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/WriteCompilerDetectionHeader.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 593176c..86137e2 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -235,6 +235,14 @@ function(write_compiler_detection_header message(FATAL_ERROR "Unparsed arguments: ${_WCD_UNPARSED_ARGUMENTS}") endif() + if (prefix_arg STREQUAL "") + message(FATAL_ERROR "A prefix must be specified") + endif() + string(MAKE_C_IDENTIFIER ${prefix_arg} cleaned_prefix) + if (NOT prefix_arg STREQUAL cleaned_prefix) + message(FATAL_ERROR "The prefix must be a valid C identifier.") + endif() + if(NOT _WCD_VERSION) set(_WCD_VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION}) endif() |