From 491d2108983990eeda7d91dbc958a7fa9060659f Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Oct 2017 07:59:19 -0400 Subject: 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 --- Modules/ExternalProject.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 76f5080..419c9d6 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) -- cgit v0.12