summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-07 12:54:33 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-07-07 12:54:33 (GMT)
commitc9feebb9e88532680c0cbd6066f9ffaf45f747b1 (patch)
tree1f1307ef16a720fee3e41a771277986857eee11d /Modules
parent55c38b0077fe4c56eafbc4f6a5aa3f6b83839c2c (diff)
parentb47c125ff7f088c87183e6ad60850aefdaf43757 (diff)
downloadCMake-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.cmake8
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()