summaryrefslogtreecommitdiff
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-10-10 07:59:19 -0400
committerBrad King <brad.king@kitware.com>2017-10-11 08:19:58 -0400
commit491d2108983990eeda7d91dbc958a7fa9060659f (patch)
treebdf19904e588a1f1dacbf49ea9776a8ff0ffd23c /Modules/ExternalProject.cmake
parenta91eb5e41f486628910f189bf40403568af013c7 (diff)
downloadcmake-491d2108983990eeda7d91dbc958a7fa9060659f.tar.gz
ExternalProject: Avoid if() auto-dereferene in quoted arguments
The implementation of this module doesn't expect such dereferences to happen, but can when a project sets a variable called `x`. Set `CMP0054` explicitly to get its NEW behavior. Fixes: #17335
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 76f5080d0d..419c9d67b0 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -854,6 +854,9 @@ The custom step could then be triggered from the main build like so::
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+
# Pre-compute a regex to match documented keywords for each command.
math(EXPR _ep_documentation_line_count "${CMAKE_CURRENT_LIST_LINE} - 4")
file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines
@@ -3035,3 +3038,5 @@ function(ExternalProject_Add name)
#
_ep_add_test_command(${name})
endfunction()
+
+cmake_policy(POP)