summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-08 11:20:27 -0400
committerNils Gladitz <nilsgladitz@gmail.com>2014-09-11 21:23:24 +0200
commite177e7affb10fc25b71d4c9d9796c9df7fcdb800 (patch)
treee360cc84926b07a8c0c300968816428dc24bf8e1
parent425acc522ff27014ffcc1d1f902f3702dd6c7aa7 (diff)
downloadcmake-e177e7affb10fc25b71d4c9d9796c9df7fcdb800.tar.gz
FPHSA: Avoid if() dereferencing of quoted variable
Legacy invocations may pass a variable name where "DEFAULT_MSG" belongs. When comparing FPHSA_FAIL_MESSAGE to "DEFAULT_MSG", use a leading "x" on both sides to avoid mistaking the value of the message for a variable name.
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index d03041852d..e8d1dfb905 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -201,7 +201,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# now that we collected all arguments, process them
- if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+ if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
endif()