summaryrefslogtreecommitdiffstats
path: root/Modules/UseSWIG.cmake
diff options
context:
space:
mode:
authorJuan Ramos <juan.ramos@kitware.com>2024-03-29 20:51:59 (GMT)
committerJuan Ramos <juan.ramos@kitware.com>2024-03-29 20:51:59 (GMT)
commit3cd64287fefd536561c155a0fbb1f549ab066d0e (patch)
treef8ad4a5d09c90dae7be0dec761f298fb330bfac8 /Modules/UseSWIG.cmake
parent2e3692bde08c071fdb00f201eaa6dc0116de436b (diff)
downloadCMake-3cd64287fefd536561c155a0fbb1f549ab066d0e.zip
CMake-3cd64287fefd536561c155a0fbb1f549ab066d0e.tar.gz
CMake-3cd64287fefd536561c155a0fbb1f549ab066d0e.tar.bz2
Modules: Fix CMP0159 warnings in modules when tracing
Closes: #25829
Diffstat (limited to 'Modules/UseSWIG.cmake')
-rw-r--r--Modules/UseSWIG.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index f264fb6..c58511a 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -466,7 +466,10 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
# try to get module name from "%module foo" syntax
if ( EXISTS "${infile}" )
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file ( STRINGS "${infile}" module_basename REGEX "[ ]*%module[ ]*[a-zA-Z0-9_]+.*" )
+ cmake_policy(POP)
endif ()
if ( module_basename )
string ( REGEX REPLACE "[ ]*%module[ ]*([a-zA-Z0-9_]+).*" "\\1" module_basename "${module_basename}" )
@@ -474,7 +477,10 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
else ()
# try to get module name from "%module (options=...) foo" syntax
if ( EXISTS "${infile}" )
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file ( STRINGS "${infile}" module_basename REGEX "[ ]*%module[ ]*\\(.*\\)[ ]*[a-zA-Z0-9_]+.*" )
+ cmake_policy(POP)
endif ()
if ( module_basename )
string ( REGEX REPLACE "[ ]*%module[ ]*\\(.*\\)[ ]*([a-zA-Z0-9_]+).*" "\\1" module_basename "${module_basename}" )