From ffd8d4441e62c9d4b48997acee03d43c3d98a3cb Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 16 Sep 2023 17:14:59 +0200 Subject: [PATCH] =?UTF-8?q?CMake=20>=3D=203.10=20=E2=86=92=20all=20policie?= =?UTF-8?q?s=20<=3D=2071=20are=20NEW=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GNUInstallDirs.cmake | 5 ----- _unittests/test_pkg-config.cmake | 1 - base.cmake | 6 ------ boost/FindBoost.cmake | 4 ---- cmake_reinstall.cmake.in | 1 - cmake_uninstall.cmake.in | 1 - cython/python/FindPython/Support.cmake | 2 +- find-external/OpenMP/FindOpenMP.cmake | 7 ------- version-script.cmake | 3 --- 9 files changed, 1 insertion(+), 29 deletions(-) diff --git a/GNUInstallDirs.cmake b/GNUInstallDirs.cmake index f95e6e2c5..fbf56b86c 100644 --- a/GNUInstallDirs.cmake +++ b/GNUInstallDirs.cmake @@ -124,9 +124,6 @@ Macros absolute paths where necessary, using the same logic. #]=======================================================================] -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced - # Convert a cache variable to PATH type macro(_GNUInstallDirs_cache_convert_to_path var description) @@ -380,5 +377,3 @@ foreach(dir ) GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_${dir} CMAKE_INSTALL_${dir}) endforeach() - -cmake_policy(POP) diff --git a/_unittests/test_pkg-config.cmake b/_unittests/test_pkg-config.cmake index 97bae316a..ca33930bc 100644 --- a/_unittests/test_pkg-config.cmake +++ b/_unittests/test_pkg-config.cmake @@ -1,6 +1,5 @@ include(cmake/pkg-config.cmake) -cmake_policy(SET CMP0054 NEW) # cmake -P macro(EXPECT_STREQUAL _lhs _rhs) if(NOT "${_lhs}" STREQUAL ${_rhs}) diff --git a/base.cmake b/base.cmake index 7ea1ba7de..c88de6f71 100644 --- a/base.cmake +++ b/base.cmake @@ -257,13 +257,10 @@ endmacro( # LIST : the list. VALUE : the value to be appended. # macro(_ADD_TO_LIST_IF_NOT_PRESENT LIST VALUE) - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) # To be more robust, value should be stripped if(NOT "${VALUE}" IN_LIST ${LIST}) list(APPEND ${LIST} "${VALUE}") endif() - cmake_policy(POP) endmacro( _ADD_TO_LIST_IF_NOT_PRESENT LIST @@ -348,12 +345,9 @@ macro(COMPUTE_PROJECT_ARGS _project_VARIABLE) set(_project_LANGUAGES "CXX") endif() - # CMake >= 3.0 - cmake_policy(SET CMP0048 NEW) set(${_project_VARIABLE} VERSION ${PROJECT_VERSION_FULL} LANGUAGES ${_project_LANGUAGES}) - # Append description for CMake >= 3.9 set(${_project_VARIABLE} ${${_project_VARIABLE}} DESCRIPTION ${PROJECT_DESCRIPTION}) endmacro(COMPUTE_PROJECT_ARGS) diff --git a/boost/FindBoost.cmake b/boost/FindBoost.cmake index 38b0d0026..4be6aedc4 100644 --- a/boost/FindBoost.cmake +++ b/boost/FindBoost.cmake @@ -384,8 +384,6 @@ Set ``Boost_NO_BOOST_CMAKE`` to ``ON``, to disable the search for boost-cmake. include(FindPackageHandleStandardArgs) # Save project's policies -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) # if IN_LIST if(POLICY CMP0102) cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var) endif() @@ -628,8 +626,6 @@ if (NOT Boost_NO_BOOST_CMAKE) find_package_handle_standard_args(Boost HANDLE_COMPONENTS CONFIG_MODE) _boost_set_legacy_variables_from_config() - # Restore project's policies - cmake_policy(POP) return() endif() endif() diff --git a/cmake_reinstall.cmake.in b/cmake_reinstall.cmake.in index fae9569ba..3b98befcb 100644 --- a/cmake_reinstall.cmake.in +++ b/cmake_reinstall.cmake.in @@ -12,7 +12,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -cmake_policy(SET CMP0007 NEW) if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") execute_process(COMMAND "@CMAKE_COMMAND@" --build "@PROJECT_BINARY_DIR@" --target uninstall --config $) endif() diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index 2d6c62c08..1dd0999c4 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -14,7 +14,6 @@ # along with this program. If not, see . # # This files comes from the CMake FAQ: http://www.cmake.org/Wiki/CMake_FAQ -cmake_policy(SET CMP0007 NEW) IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") RETURN() ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") diff --git a/cython/python/FindPython/Support.cmake b/cython/python/FindPython/Support.cmake index 82f0493b3..e0590b3ea 100644 --- a/cython/python/FindPython/Support.cmake +++ b/cython/python/FindPython/Support.cmake @@ -5,7 +5,7 @@ # This file is a "template" file used by various FindPython modules. # -cmake_policy (VERSION 3.5) +cmake_policy (VERSION 3.10) # # Initial configuration diff --git a/find-external/OpenMP/FindOpenMP.cmake b/find-external/OpenMP/FindOpenMP.cmake index 3b6725a16..4a66db9f6 100644 --- a/find-external/OpenMP/FindOpenMP.cmake +++ b/find-external/OpenMP/FindOpenMP.cmake @@ -92,11 +92,6 @@ should use the ``OpenMP__INCLUDE_DIRS`` _output_ variable if it needs to know what include directories are needed. #]=======================================================================] -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 - function(_OPENMP_FLAG_CANDIDATES LANG) if(NOT OpenMP_${LANG}_FLAG) unset(OpenMP_FLAG_CANDIDATES) @@ -775,5 +770,3 @@ unset(OpenMP_Fortran_TEST_SOURCE) unset(OpenMP_C_CXX_CHECK_VERSION_SOURCE) unset(OpenMP_Fortran_CHECK_VERSION_SOURCE) unset(OpenMP_Fortran_INCLUDE_LINE) - -cmake_policy(POP) diff --git a/version-script.cmake b/version-script.cmake index 4a548a8ac..335e4a482 100644 --- a/version-script.cmake +++ b/version-script.cmake @@ -18,10 +18,7 @@ include(CheckCCompilerFlag) if(${CMAKE_VERSION} VERSION_LESS 3.18.0) # Do nothing else() - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) # if IN_LIST include(CheckLinkerFlag) - cmake_policy(POP) endif() # _CHECK_VERSION_SCRIPT_SUPPORT