From 89ed11ae6f98319bbba2c34e7c0e1d1a5c8dd547 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 18 Aug 2021 15:24:30 -0400 Subject: CheckLanguage: Avoid CMP0126 warning The macro's implementation converts a normal variable into a cache variable intentionally, so both are set. Explicitly set CMP0126 to NEW to avoid a warning in trace mode. This won't affect the module behavior because the code path does not activate if a normal variable is already defined anyway. Fixes: #22548 --- Modules/CheckLanguage.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index 928881c..559c103 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -36,6 +36,9 @@ Example: include_guard(GLOBAL) +cmake_policy(PUSH) +cmake_policy(SET CMP0126 NEW) + macro(check_language lang) if(NOT DEFINED CMAKE_${lang}_COMPILER) set(_desc "Looking for a ${lang} compiler") @@ -110,3 +113,5 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" endif() endmacro() + +cmake_policy(POP) -- cgit v0.12