diff options
author | Brad King <brad.king@kitware.com> | 2024-04-01 13:42:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-04-01 13:43:14 (GMT) |
commit | ad13d016217741903b1eb8c83e6929dc504d55b5 (patch) | |
tree | 2a2e765a36d6700aaa38891e24c82139a29a5e70 | |
parent | dea9982990368c3af03bcda27f190cc7f29a2bf0 (diff) | |
parent | 3cd64287fefd536561c155a0fbb1f549ab066d0e (diff) | |
download | CMake-ad13d016217741903b1eb8c83e6929dc504d55b5.zip CMake-ad13d016217741903b1eb8c83e6929dc504d55b5.tar.gz CMake-ad13d016217741903b1eb8c83e6929dc504d55b5.tar.bz2 |
Merge topic 'cmp0159_warnings'
3cd64287fe Modules: Fix CMP0159 warnings in modules when tracing
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9385
70 files changed, 290 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index cb2162c..6d82304 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -96,7 +96,10 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) # Load the resulting information strings. if(CMAKE_${lang}_ABI_COMPILED) message(CHECK_PASS "done") + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 32 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") + cmake_policy(POP) set(ABI_SIZEOF_DPTR "NOTFOUND") set(ABI_BYTE_ORDER "NOTFOUND") set(ABI_NAME "NOTFOUND") diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 7d063ed..e75018b 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -919,9 +919,12 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(SIMULATE_VERSION) set(CMAKE_${lang}_COMPILER_ID_STRING_REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]") foreach(encoding "" "ENCODING;UTF-16LE" "ENCODING;UTF-16BE") + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${file}" CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 38 ${encoding} REGEX "${CMAKE_${lang}_COMPILER_ID_STRING_REGEX}") + cmake_policy(POP) if(NOT CMAKE_${lang}_COMPILER_ID_STRINGS STREQUAL "") break() endif() diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake index 705ef8a..19827f1 100644 --- a/Modules/CMakeVerifyManifest.cmake +++ b/Modules/CMakeVerifyManifest.cmake @@ -31,7 +31,10 @@ found in the .manifest file. # it will put the list of versions found into the variable # specified by list_var function(crt_version file list_var) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${file}" strings REGEX "Microsoft.VC...CRT" NEWLINE_CONSUME) + cmake_policy(POP) foreach(s ${strings}) set(has_match 1) string(REGEX diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 01ce1d2..849d691 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -92,6 +92,7 @@ include_guard(GLOBAL) block(SCOPE_FOR POLICIES) cmake_policy(SET CMP0054 NEW) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> #----------------------------------------------------------------------------- # Helper function. DO NOT CALL DIRECTLY. diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake index 627866a..e332c14 100644 --- a/Modules/FindALSA.cmake +++ b/Modules/FindALSA.cmake @@ -43,6 +43,9 @@ The following cache variables may also be set: the absolute path of the asound library #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h DOC "The ALSA (asound) include directory" ) @@ -74,3 +77,5 @@ if(ALSA_FOUND) endif() mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY) + +cmake_policy(POP) diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake index f959356..8faa653 100644 --- a/Modules/FindArmadillo.cmake +++ b/Modules/FindArmadillo.cmake @@ -34,6 +34,9 @@ This module sets the following variables: ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech") #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(ARMADILLO_INCLUDE_DIR NAMES armadillo PATHS "$ENV{ProgramFiles}/Armadillo/include" @@ -133,3 +136,5 @@ unset(_ARMA_USE_ARPACK) unset(_ARMA_USE_HDF5) unset(_ARMA_CONFIG_CONTENTS) unset(_ARMA_HEADER_CONTENTS) + +cmake_policy(POP) diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake index 326e700..4714dfc 100644 --- a/Modules/FindBZip2.cmake +++ b/Modules/FindBZip2.cmake @@ -55,6 +55,9 @@ The following variables are provided for backward compatibility: Superseded by ``BZIP2_VERSION``. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + set(_BZIP2_PATHS PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]" ) @@ -120,3 +123,5 @@ if (BZIP2_FOUND) endif () mark_as_advanced(BZIP2_INCLUDE_DIR) + +cmake_policy(POP) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 248ea8b..11a38df 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -387,6 +387,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> function(_boost_get_existing_target component target_var) set(names "${component}") diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index ee242bb..5ce8a90 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -72,6 +72,9 @@ Hints #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) if(NOT CURL_NO_CURL_CMAKE) @@ -86,6 +89,8 @@ if(NOT CURL_NO_CURL_CMAKE) find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE) # The upstream curl package sets CURL_VERSION, not CURL_VERSION_STRING. set(CURL_VERSION_STRING "${CURL_VERSION}") + + cmake_policy(POP) return() endif() endif() @@ -241,3 +246,5 @@ if(CURL_FOUND) endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake index cf0d341..ceed009 100644 --- a/Modules/FindCups.cmake +++ b/Modules/FindCups.cmake @@ -41,6 +41,9 @@ The following cache variables may also be set: the directory containing the Cups headers #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(CUPS_INCLUDE_DIR cups/cups.h ) find_library(CUPS_LIBRARIES NAMES cups ) @@ -98,3 +101,5 @@ if (CUPS_FOUND) INTERFACE_INCLUDE_DIRECTORIES "${CUPS_INCLUDE_DIR}") endif () endif () + +cmake_policy(POP) diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake index 762931e..398a415 100644 --- a/Modules/FindEXPAT.cmake +++ b/Modules/FindEXPAT.cmake @@ -41,6 +41,9 @@ Hints #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_package(PkgConfig QUIET) pkg_check_modules(PC_EXPAT QUIET expat) @@ -156,3 +159,5 @@ if(EXPAT_FOUND) endif() mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY) + +cmake_policy(POP) diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake index 5228831..9cce952 100644 --- a/Modules/FindFontconfig.cmake +++ b/Modules/FindFontconfig.cmake @@ -34,6 +34,8 @@ This will define the following variables in your project: #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls @@ -101,3 +103,5 @@ if(Fontconfig_FOUND) set(Fontconfig_LIBRARIES ${Fontconfig_LIBRARY}) set(Fontconfig_INCLUDE_DIRS ${Fontconfig_INCLUDE_DIR}) endif() + +cmake_policy(POP) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 82885cb..6d0ed68 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -47,6 +47,9 @@ The user may set the environment variable ``FREETYPE_DIR`` to the root directory of a Freetype installation. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # Created by Eric Wing. # Modifications by Alexander Neundorf. # This file has been renamed to "FindFreetype.cmake" instead of the correct @@ -202,3 +205,5 @@ if(Freetype_FOUND) endif() endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake index e6eac30..a9c5740 100644 --- a/Modules/FindGDAL.cmake +++ b/Modules/FindGDAL.cmake @@ -72,6 +72,9 @@ The following variables may be set to modify the search strategy: # #include "gdal.h" +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(GDAL_INCLUDE_DIR gdal.h HINTS ENV GDAL_DIR @@ -197,3 +200,5 @@ if (GDAL_FOUND) INTERFACE_INCLUDE_DIRECTORIES "${GDAL_INCLUDE_DIR}") endif () endif () + +cmake_policy(POP) diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake index cea9cd8..9a11b88 100644 --- a/Modules/FindGIF.cmake +++ b/Modules/FindGIF.cmake @@ -46,6 +46,9 @@ Hints ``./configure --prefix=$GIF_DIR``. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # Created by Eric Wing. # Modifications by Alexander Neundorf, Ben Campbell @@ -126,3 +129,5 @@ if(GIF_FOUND) endif() mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY) + +cmake_policy(POP) diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake index dff53e1..f6b7b1a 100644 --- a/Modules/FindGLEW.cmake +++ b/Modules/FindGLEW.cmake @@ -223,7 +223,10 @@ endif() # Read version from GL/glew.h file if(EXISTS "${GLEW_INCLUDE_DIR}/GL/glew.h") + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${GLEW_INCLUDE_DIR}/GL/glew.h" _contents REGEX "^VERSION_.+ [0-9]+") + cmake_policy(POP) if(_contents) string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" GLEW_VERSION_MAJOR "${_contents}") string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" GLEW_VERSION_MINOR "${_contents}") diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake index 1943847..e9d8109 100644 --- a/Modules/FindGSL.cmake +++ b/Modules/FindGSL.cmake @@ -59,6 +59,9 @@ help this module find the correct files:: #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) #============================================================================= @@ -229,3 +232,5 @@ if( GSL_FOUND AND NOT TARGET GSL::gsl ) INTERFACE_LINK_LIBRARIES GSL::gslcblas ) endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 4634876..41f192b 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -175,7 +175,10 @@ Use the results: include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS ${_gtkversion_hdr} _contents REGEX "#define GTK_M[A-Z]+_VERSION[ \t]+") + cmake_policy(POP) if(_contents) string(REGEX REPLACE ".*#define GTK_MAJOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_major} "${_contents}") string(REGEX REPLACE ".*#define GTK_MINOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_minor} "${_contents}") @@ -211,7 +214,10 @@ endfunction() #============================================================= function(_GTK2_SIGCXX_GET_VERSION _OUT_major _OUT_minor _OUT_micro _sigcxxversion_hdr) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS ${_sigcxxversion_hdr} _contents REGEX "#define SIGCXX_M[A-Z]+_VERSION[ \t]+") + cmake_policy(POP) if(_contents) string(REGEX REPLACE ".*#define SIGCXX_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_major} "${_contents}") string(REGEX REPLACE ".*#define SIGCXX_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_minor} "${_contents}") diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index 92334e4..c2128a9 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -125,7 +125,10 @@ macro(__gtest_determine_windows_library_type _var) if(EXISTS "${${_var}}") file(TO_NATIVE_PATH "${${_var}}" _lib_path) get_filename_component(_name "${${_var}}" NAME_WE) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${${_var}}" _match REGEX "${_name}\\.dll" LIMIT_COUNT 1) + cmake_policy(POP) if(NOT _match STREQUAL "") set(${_var}_TYPE SHARED PARENT_SCOPE) else() diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index a44c6f9..1df33a8 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -157,6 +157,9 @@ The following variables can be set to guide the search for HDF5 libraries and in include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # We haven't found HDF5 yet. Clear its state in case it is set in the parent # scope somewhere else. We can't rely on it because different components may # have been requested for this call. @@ -1243,3 +1246,5 @@ if (HDF5_FIND_DEBUG) endif() unset(_lang) unset(_HDF5_NEED_TO_SEARCH) + +cmake_policy(POP) diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake index 9724d2c..ca09444 100644 --- a/Modules/FindHSPELL.cmake +++ b/Modules/FindHSPELL.cmake @@ -25,6 +25,9 @@ Once done this will define HSPELL_MINOR_VERSION - The minor version of Hspell #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(HSPELL_INCLUDE_DIR hspell.h) find_library(HSPELL_LIBRARIES NAMES hspell) @@ -43,3 +46,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL VERSION_VAR HSPELL_VERSION_STRING) mark_as_advanced(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES) + +cmake_policy(POP) diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake index 9514d2d..4708aff 100644 --- a/Modules/FindICU.cmake +++ b/Modules/FindICU.cmake @@ -89,6 +89,9 @@ Other variables one may set to control this module are:: ICU_DEBUG - Set to ON to enable debug output from FindICU. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # Written by Roger Leigh <rleigh@codelibre.net> set(icu_programs @@ -435,3 +438,5 @@ if(ICU_DEBUG) endif() unset(icu_programs) + +cmake_policy(POP) diff --git a/Modules/FindIconv.cmake b/Modules/FindIconv.cmake index 1426174..879ff16f 100644 --- a/Modules/FindIconv.cmake +++ b/Modules/FindIconv.cmake @@ -75,6 +75,9 @@ The following cache variables may also be set: #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) if(CMAKE_C_COMPILER_LOADED) include(${CMAKE_CURRENT_LIST_DIR}/CheckCSourceCompiles.cmake) @@ -180,3 +183,5 @@ if(Iconv_FOUND) set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES "${Iconv_LIBRARIES}") endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake index 95eeabd..04f5a23 100644 --- a/Modules/FindIntl.cmake +++ b/Modules/FindIntl.cmake @@ -82,6 +82,9 @@ The following cache variables may also be set: ``msgfmt``, etc.), use :module:`FindGettext`. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) if(CMAKE_C_COMPILER_LOADED) include(${CMAKE_CURRENT_LIST_DIR}/CheckCSourceCompiles.cmake) @@ -181,3 +184,5 @@ if(Intl_FOUND) INTERFACE_LINK_LIBRARIES "${Intl_LIBRARIES}") endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index 3f243de..08a0bd3 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake @@ -56,6 +56,9 @@ Obsolete variables where to find the JPEG library. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(JPEG_INCLUDE_DIR jpeglib.h) set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static) @@ -140,3 +143,5 @@ if(JPEG_FOUND) endif() mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR) + +cmake_policy(POP) diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake index 9a62669..981bedc 100644 --- a/Modules/FindJasper.cmake +++ b/Modules/FindJasper.cmake @@ -42,6 +42,9 @@ The following cache variables may also be set: where to find the Jasper library (debug). #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(JASPER_INCLUDE_DIR jasper/jasper.h) mark_as_advanced(JASPER_INCLUDE_DIR) @@ -88,3 +91,5 @@ if(JASPER_FOUND) endif() endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake index eaace4f..34b2e82 100644 --- a/Modules/FindLTTngUST.cmake +++ b/Modules/FindLTTngUST.cmake @@ -37,6 +37,9 @@ This module sets the following ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(LTTNGUST_INCLUDE_DIRS NAMES lttng/tracepoint.h) find_library(LTTNGUST_LIBRARIES NAMES lttng-ust) @@ -100,3 +103,5 @@ find_package_handle_standard_args(LTTngUST FOUND_VAR LTTNGUST_FOUND LTTNGUST_INCLUDE_DIRS VERSION_VAR LTTNGUST_VERSION_STRING) mark_as_advanced(LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS) + +cmake_policy(POP) diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake index 9d3ac13..38a43db 100644 --- a/Modules/FindLibArchive.cmake +++ b/Modules/FindLibArchive.cmake @@ -31,6 +31,9 @@ The module defines the following ``IMPORTED`` targets: #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(LibArchive_INCLUDE_DIR NAMES archive.h PATHS @@ -81,3 +84,5 @@ if(LibArchive_FOUND) INTERFACE_INCLUDE_DIRECTORIES "${LibArchive_INCLUDE_DIR}") endif () endif() + +cmake_policy(POP) diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake index 1b3929b..7b0c530 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -58,6 +58,9 @@ The following variables are provided for backward compatibility: #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(LIBLZMA_INCLUDE_DIR lzma.h ) if(NOT LIBLZMA_LIBRARY) find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib) @@ -140,3 +143,5 @@ if (LIBLZMA_FOUND) endif() endif() endif () + +cmake_policy(POP) diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake index ce28d03..1c5f9be 100644 --- a/Modules/FindLibXml2.cmake +++ b/Modules/FindLibXml2.cmake @@ -52,6 +52,9 @@ The following cache variables may also be set: path to the LibXml2 library #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # use pkg-config to get the directories and then use these values # in the find_path() and find_library() calls find_package(PkgConfig QUIET) @@ -122,3 +125,5 @@ if(LIBXML2_XMLLINT_EXECUTABLE AND NOT TARGET LibXml2::xmllint) add_executable(LibXml2::xmllint IMPORTED) set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}") endif() + +cmake_policy(POP) diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake index a9920ee..1154ae1 100644 --- a/Modules/FindLibXslt.cmake +++ b/Modules/FindLibXslt.cmake @@ -45,6 +45,9 @@ for using xslt): Contains the full path to the xsltproc executable if found. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # use pkg-config to get the directories and then use these values # in the find_path() and find_library() calls find_package(PkgConfig QUIET) @@ -133,3 +136,5 @@ if(LIBXSLT_XSLTPROC_EXECUTABLE AND NOT TARGET LibXslt::xsltproc) add_executable(LibXslt::xsltproc IMPORTED) set_target_properties(LibXslt::xsltproc PROPERTIES IMPORTED_LOCATION "${LIBXSLT_XSLTPROC_EXECUTABLE}") endif() + +cmake_policy(POP) diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake index b56a7b1..b4106c4 100644 --- a/Modules/FindLua.cmake +++ b/Modules/FindLua.cmake @@ -45,6 +45,7 @@ locations other than lua/ cmake_policy(PUSH) # Policies apply to functions at definition-time cmake_policy(SET CMP0012 NEW) # For while(TRUE) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> unset(_lua_include_subdirs) unset(_lua_library_names) diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake index 405a7a7..2249ab1 100644 --- a/Modules/FindLua51.cmake +++ b/Modules/FindLua51.cmake @@ -26,6 +26,9 @@ This is because, the lua location is not standardized and may exist in locations other than lua/ #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(LUA_INCLUDE_DIR lua.h HINTS ENV LUA_DIR @@ -73,3 +76,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 VERSION_VAR LUA_VERSION_STRING) mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) + +cmake_policy(POP) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 834a3e1..f4e8b94 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -265,6 +265,7 @@ Additionally, the following variables are deprecated: cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) find_package(PkgConfig QUIET) diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index caef8f4..84f7c62 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -291,6 +291,7 @@ Reference cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> set(_FindMatlab_SELF_DIR "${CMAKE_CURRENT_LIST_DIR}") diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake index 4189b32..d5d26a1 100644 --- a/Modules/FindOpenACC.cmake +++ b/Modules/FindOpenACC.cmake @@ -70,6 +70,9 @@ If set, will the correct target accelerator flag set to the <target> will be returned with OpenACC_<lang>_FLAGS. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + set(OpenACC_C_CXX_TEST_SOURCE " int main(void){ @@ -306,3 +309,5 @@ unset(OpenACC_C_CXX_TEST_SOURCE) unset(OpenACC_Fortran_TEST_SOURCE) unset(OpenACC_C_CXX_CHECK_VERSION_SOURCE) unset(OpenACC_Fortran_CHECK_VERSION_SOURCE) + +cmake_policy(POP) diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 1d36b9b..077a239 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -96,6 +96,7 @@ cmake_policy(PUSH) cmake_policy(SET CMP0012 NEW) # if() recognizes numbers and booleans cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced cmake_policy(SET CMP0057 NEW) # if IN_LIST +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> function(_OPENMP_FLAG_CANDIDATES LANG) if(NOT OpenMP_${LANG}_FLAG) diff --git a/Modules/FindOpenSP.cmake b/Modules/FindOpenSP.cmake index 25d0e6f..4255aef 100644 --- a/Modules/FindOpenSP.cmake +++ b/Modules/FindOpenSP.cmake @@ -63,6 +63,9 @@ The following cache variables may also be set: #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_package(PkgConfig QUIET) if (PkgConfig_FOUND) pkg_check_modules(PC_OpenSP QUIET opensp) @@ -158,3 +161,5 @@ set_package_properties(OpenSP PROPERTIES URL "http://openjade.sourceforge.net/doc/index.htm" DESCRIPTION "An SGML System Conforming to International Standard ISO 8879" ) + +cmake_policy(POP) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 3683f39..77dec00 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -111,6 +111,9 @@ The following variables may be set to control search behavior: locations. Useful on multi-lib systems. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) unset(_OpenSSL_extra_static_deps) if(UNIX AND @@ -792,3 +795,5 @@ unset(_OpenSSL_extra_static_deps) unset(_OpenSSL_has_dependency_dl) unset(_OpenSSL_has_dependency_threads) unset(_OpenSSL_has_dependency_zlib) + +cmake_policy(POP) diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake index 27909bc..9df2a62 100644 --- a/Modules/FindOpenSceneGraph.cmake +++ b/Modules/FindOpenSceneGraph.cmake @@ -101,6 +101,9 @@ This module defines the following output variables: target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES}) #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # # Naming convention: # Local variables of the form _osg_foo @@ -230,3 +233,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSceneGraph unset(_osg_component_founds) set(OPENSCENEGRAPH_INCLUDE_DIRS ${OPENSCENEGRAPH_INCLUDE_DIR}) + +cmake_policy(POP) diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index 043b69c..4294326 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -48,6 +48,9 @@ Since PNG depends on the ZLib compression library, none of the above will be defined unless ZLib can be found. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # Default install location on windows when installing from included cmake build # From FindZLIB.cmake set(_PNG_x86 "(x86)") @@ -177,3 +180,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args(PNG REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR VERSION_VAR PNG_VERSION_STRING) + +cmake_policy(POP) diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 84bc1ed..1984e18 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -93,6 +93,7 @@ is set regardless of the presence of the ``Server`` component in find_package ca cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include") set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}") diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index a7ee0c4..8ad3270 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -218,6 +218,9 @@ Example: GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc) #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + function(protobuf_generate) set(_options APPEND_PATH DESCRIPTORS) set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS DEPENDENCIES) @@ -782,3 +785,5 @@ foreach(Camel string(TOUPPER ${Camel} UPPER) set(${UPPER} ${${Camel}}) endforeach() + +cmake_policy(POP) diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 0256867..410b736 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -20,6 +20,8 @@ cmake_policy (SET CMP0057 NEW) cmake_policy (SET CMP0124 NEW) # registry view behavior cmake_policy (SET CMP0134 NEW) +# file(STRINGS) with REGEX updates CMAKE_MATCH_<n> +cmake_policy(SET CMP0159 NEW) if (NOT DEFINED _PYTHON_PREFIX) message (FATAL_ERROR "FindPython: INTERNAL ERROR") diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index b13d96b..112adae 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -48,6 +48,9 @@ get the currently active Python version by default with a consistent version of PYTHON_LIBRARIES. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + cmake_policy(GET CMP0148 _FindPythonLibs_CMP0148) if(_FindPythonLibs_CMP0148 STREQUAL "NEW") message(FATAL_ERROR "The FindPythonLibs module has been removed by policy CMP0148.") @@ -55,6 +58,7 @@ endif() if(_FindPythonLibs_testing) set(_FindPythonLibs_included TRUE) + cmake_policy(POP) return() endif() @@ -410,3 +414,5 @@ extern \"C\" { execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET) endfunction() + +cmake_policy(POP) diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index da82e59..5a0037c 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -34,6 +34,9 @@ Also defined, but not for general use are: library. This is only required by Qt3 on Windows. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # These are around for backwards compatibility # they will be set # QT_WRAP_CPP, set true if QT_MOC_EXECUTABLE is found @@ -47,6 +50,7 @@ if(QT4_FOUND) if(NOT Qt3_FIND_QUIETLY) message( STATUS "Qt3 and Qt4 cannot be used together in one project.") endif() + cmake_policy(POP) return() endif() endif() @@ -304,3 +308,5 @@ mark_as_advanced( QT_WRAP_CPP QT_WRAP_UI ) + +cmake_policy(POP) diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 7691eb7..a4c8668 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -110,6 +110,9 @@ This needed to change because "proper" SDL convention is #include because not all systems place things in SDL/ (see FreeBSD). #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(SDL_INCLUDE_DIR SDL.h HINTS ENV SDLDIR @@ -235,3 +238,5 @@ if(SDL_FOUND) INTERFACE_LINK_LIBRARIES "${SDL_LIBRARY}") endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindSDL_gfx.cmake b/Modules/FindSDL_gfx.cmake index 2dd96e9..82c2039 100644 --- a/Modules/FindSDL_gfx.cmake +++ b/Modules/FindSDL_gfx.cmake @@ -24,6 +24,9 @@ This module defines: ``./configure --prefix=$SDLDIR`` used in building SDL. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_path(SDL_GFX_INCLUDE_DIRS NAMES SDL_framerate.h @@ -84,3 +87,5 @@ if(SDL_gfx_FOUND) INTERFACE_LINK_LIBRARIES "${SDL_GFX_LIBRARIES}") endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index 324fef5..33a0695 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -33,6 +33,9 @@ $SDLDIR is an environment variable that would correspond to the ./configure --prefix=$SDLDIR used in building SDL. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + if(NOT SDL_IMAGE_INCLUDE_DIR AND SDLIMAGE_INCLUDE_DIR) set(SDL_IMAGE_INCLUDE_DIR ${SDLIMAGE_INCLUDE_DIR} CACHE PATH "directory cache entry initialized from old variable name") @@ -95,3 +98,5 @@ set(SDLIMAGE_INCLUDE_DIR ${SDL_IMAGE_INCLUDE_DIRS}) set(SDLIMAGE_FOUND ${SDL_IMAGE_FOUND}) mark_as_advanced(SDL_IMAGE_LIBRARY SDL_IMAGE_INCLUDE_DIR) + +cmake_policy(POP) diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index 8ed3cb4..f48015e 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -33,6 +33,9 @@ $SDLDIR is an environment variable that would correspond to the ./configure --prefix=$SDLDIR used in building SDL. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + if(NOT SDL_MIXER_INCLUDE_DIR AND SDLMIXER_INCLUDE_DIR) set(SDL_MIXER_INCLUDE_DIR ${SDLMIXER_INCLUDE_DIR} CACHE PATH "directory cache entry initialized from old variable name") @@ -95,3 +98,5 @@ set(SDLMIXER_INCLUDE_DIR ${SDL_MIXER_INCLUDE_DIRS}) set(SDLMIXER_FOUND ${SDL_MIXER_FOUND}) mark_as_advanced(SDL_MIXER_LIBRARY SDL_MIXER_INCLUDE_DIR) + +cmake_policy(POP) diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake index 639e5bd..9d0b949 100644 --- a/Modules/FindSDL_net.cmake +++ b/Modules/FindSDL_net.cmake @@ -32,6 +32,9 @@ $SDLDIR is an environment variable that would correspond to the ./configure --prefix=$SDLDIR used in building SDL. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + if(NOT SDL_NET_INCLUDE_DIR AND SDLNET_INCLUDE_DIR) set(SDL_NET_INCLUDE_DIR ${SDLNET_INCLUDE_DIR} CACHE PATH "directory cache entry initialized from old variable name") @@ -94,3 +97,5 @@ set(SDLNET_INCLUDE_DIR ${SDL_NET_INCLUDE_DIRS}) set(SDLNET_FOUND ${SDL_NET_FOUND}) mark_as_advanced(SDL_NET_LIBRARY SDL_NET_INCLUDE_DIR) + +cmake_policy(POP) diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 3443959..50b4b55 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -84,6 +84,9 @@ parses the error output for known symbol names to figure out which libraries are needed. #]] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + set(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags") mark_as_advanced(SDL_SOUND_EXTRAS) @@ -371,3 +374,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_sound REQUIRED_VARS SDL_SOUND_LIBRARY SDL_SOUND_INCLUDE_DIR VERSION_VAR SDL_SOUND_VERSION_STRING) + +cmake_policy(POP) diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake index d67c089..8f3b02a 100644 --- a/Modules/FindSDL_ttf.cmake +++ b/Modules/FindSDL_ttf.cmake @@ -32,6 +32,9 @@ $SDLDIR is an environment variable that would correspond to the ./configure --prefix=$SDLDIR used in building SDL. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + if(NOT SDL_TTF_INCLUDE_DIR AND SDLTTF_INCLUDE_DIR) set(SDL_TTF_INCLUDE_DIR ${SDLTTF_INCLUDE_DIR} CACHE PATH "directory cache entry initialized from old variable name") @@ -94,3 +97,5 @@ set(SDLTTF_INCLUDE_DIR ${SDL_TTF_INCLUDE_DIRS}) set(SDLTTF_FOUND ${SDL_TTF_FOUND}) mark_as_advanced(SDL_TTF_LIBRARY SDL_TTF_INCLUDE_DIR) + +cmake_policy(POP) diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake index e8d6b40..308a444 100644 --- a/Modules/FindSQLite3.cmake +++ b/Modules/FindSQLite3.cmake @@ -32,6 +32,9 @@ This module will set the following variables if found: #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + find_package(PkgConfig QUIET) pkg_check_modules(PC_SQLite3 QUIET sqlite3) @@ -75,3 +78,5 @@ if(SQLite3_FOUND) INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}") endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index fe1e94e..27beaa0 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -67,6 +67,7 @@ The following cache variables may also be set: cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> set(_TIFF_args) if (TIFF_FIND_VERSION) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 0f45b63..2262119 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -221,6 +221,7 @@ environment. cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> # Provide compatibility with a common invalid component request that # was silently ignored prior to CMake 3.24. diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake index a7fb766..338d0c0 100644 --- a/Modules/FindXalanC.cmake +++ b/Modules/FindXalanC.cmake @@ -44,6 +44,9 @@ The following cache variables may also be set: the Xalan library #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # Written by Roger Leigh <rleigh@codelibre.net> function(_XalanC_GET_VERSION version_hdr) @@ -153,3 +156,5 @@ if(XalanC_FOUND) set_target_properties(XalanC::XalanC PROPERTIES INTERFACE_LINK_LIBRARIES XercesC::XercesC) endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake index d39bbf6..ee6a401 100644 --- a/Modules/FindXercesC.cmake +++ b/Modules/FindXercesC.cmake @@ -47,6 +47,9 @@ The following cache variables may also be set: Debug and Release variants are found separately. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # Written by Roger Leigh <rleigh@codelibre.net> function(_XercesC_GET_VERSION version_hdr) @@ -149,3 +152,5 @@ if(XercesC_FOUND) endif() endif() endif() + +cmake_policy(POP) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index 4e7d5d6..0842f4c 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -84,6 +84,9 @@ module where to look. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + if(ZLIB_FIND_COMPONENTS AND NOT ZLIB_FIND_QUIETLY) message(AUTHOR_WARNING "ZLIB does not provide any COMPONENTS. Calling\n" @@ -232,3 +235,5 @@ if(ZLIB_FOUND) endif() endif() endif() + +cmake_policy(POP) diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index d65c865..c975a4b 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -76,8 +76,11 @@ endif() # Load symbols from INFO:symbol[] strings in the executable. set(FortranCInterface_SYMBOLS) if(FortranCInterface_EXE) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${FortranCInterface_EXE}" _info_strings LIMIT_COUNT 8 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") + cmake_policy(POP) foreach(info ${_info_strings}) if("${info}" MATCHES "INFO:symbol\\[([^]]*)\\]") list(APPEND FortranCInterface_SYMBOLS ${CMAKE_MATCH_1}) diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index c2bd14f..64d477b 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -52,8 +52,11 @@ macro(_record_compiler_features lang compile_flags feature_list) if (_result EQUAL 0) if(EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin") + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin" features REGEX "${lang}_FEATURE:.*") + cmake_policy(POP) foreach(info ${features}) string(REPLACE "${lang}_FEATURE:" "" info ${info}) string(SUBSTRING ${info} 0 1 has_feature) diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake index 1c353ba..42f6d2c 100644 --- a/Modules/KDE3Macros.cmake +++ b/Modules/KDE3Macros.cmake @@ -213,7 +213,10 @@ macro(KDE3_AUTOMOC) if (EXISTS ${_abs_FILE} AND NOT _skip) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS ${_abs_FILE} _match REGEX "#include +[^ ]+\\.moc[\">]") + cmake_policy(POP) get_filename_component(_abs_PATH ${_abs_FILE} PATH) diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index 307e4c9..cecdde8 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -32,6 +32,7 @@ endif() cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> # If using Android tools for Visual Studio, compile a sample project to get the # NDK path and set the processor from the generator platform. diff --git a/Modules/Platform/Android/Determine-Compiler-NDK.cmake b/Modules/Platform/Android/Determine-Compiler-NDK.cmake index a4d67c4..4e58d69 100644 --- a/Modules/Platform/Android/Determine-Compiler-NDK.cmake +++ b/Modules/Platform/Android/Determine-Compiler-NDK.cmake @@ -46,6 +46,9 @@ endif() # -target <triple> # -gcc-toolchain <ndk>/toolchains/<triple-or-arch>-<gcc-version> +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + # Glob available toolchains in the NDK, restricted by any version request. if(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION STREQUAL "clang") set(_ANDROID_TOOL_PATTERNS "*-clang" "*-clang[0-9].[0-9]") @@ -269,3 +272,5 @@ unset(_ANDROID_TOOL_PREFIX) unset(_ANDROID_TOOL_CLANG_NAME) unset(_ANDROID_TOOL_CLANG_VERS) unset(_ANDROID_TOOL_LLVM_NAME) + +cmake_policy(POP) diff --git a/Modules/Platform/CrayLinuxEnvironment.cmake b/Modules/Platform/CrayLinuxEnvironment.cmake index 648806f..daff647 100644 --- a/Modules/Platform/CrayLinuxEnvironment.cmake +++ b/Modules/Platform/CrayLinuxEnvironment.cmake @@ -6,7 +6,10 @@ if(DEFINED ENV{CRAYOS_VERSION}) elseif(DEFINED ENV{XTOS_VERSION}) set(CMAKE_SYSTEM_VERSION "$ENV{XTOS_VERSION}") elseif(EXISTS /etc/opt/cray/release/cle-release) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS /etc/opt/cray/release/cle-release release REGEX "^RELEASE=.*") + cmake_policy(POP) string(REGEX REPLACE "^RELEASE=(.*)$" "\\1" CMAKE_SYSTEM_VERSION "${release}") unset(release) elseif(EXISTS /etc/opt/cray/release/clerelease) diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 8d5bf8c..1b9cece 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -159,7 +159,10 @@ function(_apple_resolve_supported_archs_for_sdk_from_system_lib sdk_path ret ret # Newer SDKs ship text based dylib stub files which contain the architectures supported by the # library in text form. if(EXISTS "${system_lib_tbd_path}") + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${system_lib_tbd_path}" tbd_lines REGEX "^(archs|targets): +\\[.+\\]") + cmake_policy(POP) if(NOT tbd_lines) set(${ret_failed} TRUE PARENT_SCOPE) return() diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake index 47e266d..9e1d473 100644 --- a/Modules/ProcessorCount.cmake +++ b/Modules/ProcessorCount.cmake @@ -207,7 +207,10 @@ function(ProcessorCount var) # Systems with /proc/cpuinfo: set(cpuinfo_file /proc/cpuinfo) if(EXISTS "${cpuinfo_file}") + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$") + cmake_policy(POP) list(LENGTH procs count) #message("ProcessorCount: trying cpuinfo '${cpuinfo_file}'") endif() diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake index 12b6816..03c8588 100644 --- a/Modules/TestBigEndian.cmake +++ b/Modules/TestBigEndian.cmake @@ -91,12 +91,17 @@ macro(__TEST_BIG_ENDIAN_LEGACY_IMPL VARIABLE) if(HAVE_${VARIABLE}) + cmake_policy(PUSH) + cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin" CMAKE_TEST_ENDIANESS_STRINGS_LE LIMIT_COUNT 1 REGEX "THIS IS LITTLE ENDIAN") file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin" CMAKE_TEST_ENDIANESS_STRINGS_BE LIMIT_COUNT 1 REGEX "THIS IS BIG ENDIAN") + cmake_policy(POP) + # on mac, if there are universal binaries built both will be true # return the result depending on the machine on which cmake runs if(CMAKE_TEST_ENDIANESS_STRINGS_BE AND CMAKE_TEST_ENDIANESS_STRINGS_LE) diff --git a/Modules/UseJava/ClearClassFiles.cmake b/Modules/UseJava/ClearClassFiles.cmake index f3115c6..2c41665 100644 --- a/Modules/UseJava/ClearClassFiles.cmake +++ b/Modules/UseJava/ClearClassFiles.cmake @@ -3,6 +3,9 @@ # This script deletes compiled Java class files. +cmake_policy(PUSH) +cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n> + if(CMAKE_JAVA_CLASS_OUTPUT_PATH) if(EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist") file(STRINGS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist" classes) @@ -15,3 +18,5 @@ if(CMAKE_JAVA_CLASS_OUTPUT_PATH) else() message(FATAL_ERROR "Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH") endif() + +cmake_policy(POP) 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}" ) |