From f0985b145fe6805273088a75aa014b918b53b224 Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Tue, 14 Jan 2025 21:35:58 +0500 Subject: [PATCH] Fix deprecation warning: Compatibility with CMake < 3.10 will be removed from a future version of CMake. (#1585) Signed-off-by: Vladislav Shchapov --- CMakeLists.txt | 11 +++++++++-- cmake/python/test_launcher.cmake | 7 ++++++- examples/CMakeLists.txt | 4 ++-- examples/common/gui/CMakeLists.txt | 4 ++-- .../concurrent_hash_map/count_strings/CMakeLists.txt | 4 ++-- .../shortpath/CMakeLists.txt | 4 ++-- .../getting_started/sub_string_finder/CMakeLists.txt | 4 ++-- examples/graph/binpack/CMakeLists.txt | 4 ++-- examples/graph/cholesky/CMakeLists.txt | 4 ++-- examples/graph/dining_philosophers/CMakeLists.txt | 4 ++-- examples/graph/fgbzip2/CMakeLists.txt | 4 ++-- examples/graph/logic_sim/CMakeLists.txt | 4 ++-- examples/graph/som/CMakeLists.txt | 4 ++-- examples/migration/recursive_fibonacci/CMakeLists.txt | 4 ++-- examples/parallel_for/game_of_life/CMakeLists.txt | 4 ++-- examples/parallel_for/polygon_overlay/CMakeLists.txt | 4 ++-- examples/parallel_for/seismic/CMakeLists.txt | 4 ++-- examples/parallel_for/tachyon/CMakeLists.txt | 4 ++-- .../parallel_preorder/CMakeLists.txt | 4 ++-- examples/parallel_pipeline/square/CMakeLists.txt | 4 ++-- examples/parallel_reduce/convex_hull/CMakeLists.txt | 4 ++-- examples/parallel_reduce/pi/CMakeLists.txt | 4 ++-- examples/parallel_reduce/primes/CMakeLists.txt | 4 ++-- examples/task_arena/fractal/CMakeLists.txt | 4 ++-- examples/task_group/sudoku/CMakeLists.txt | 4 ++-- examples/test_all/fibonacci/CMakeLists.txt | 4 ++-- 26 files changed, 63 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0416364300..12273b3e36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +# If the running version of CMake is older than 3.12, the extra ... dots will be seen as version component separators, +# resulting in the ... part being ignored and preserving the pre-3.12 behavior of basing policies on . +cmake_minimum_required(VERSION 3.5.0...3.31.3) # Enable CMake policies @@ -35,6 +37,11 @@ elseif (DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) message(FATAL_ERROR "CMAKE_MSVC_RUNTIME_LIBRARY was defined while policy CMP0091 is not available. Use CMake 3.15 or newer.") endif() +if (POLICY CMP0148) + # CMake 3.27: The FindPythonInterp and FindPythonLibs modules are removed + cmake_policy(SET CMP0148 OLD) +endif() + if (TBB_WINDOWS_DRIVER AND (NOT ("${CMAKE_MSVC_RUNTIME_LIBRARY}" STREQUAL MultiThreaded OR "${CMAKE_MSVC_RUNTIME_LIBRARY}" STREQUAL MultiThreadedDebug))) message(FATAL_ERROR "Enabled TBB_WINDOWS_DRIVER requires CMAKE_MSVC_RUNTIME_LIBRARY to be set to MultiThreaded or MultiThreadedDebug.") endif() diff --git a/cmake/python/test_launcher.cmake b/cmake/python/test_launcher.cmake index 9b1bdde988..a9aa630900 100644 --- a/cmake/python/test_launcher.cmake +++ b/cmake/python/test_launcher.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +if (POLICY CMP0148) + # CMake 3.27: The FindPythonInterp and FindPythonLibs modules are removed + cmake_policy(SET CMP0148 OLD) +endif() + find_package(PythonInterp 3.5 REQUIRED) file(GLOB_RECURSE MODULES_LIST "${PYTHON_MODULE_BUILD_PATH}/*TBB.py*" ) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 16f1c4552a..6cc153530c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(tbb_examples CXX) diff --git a/examples/common/gui/CMakeLists.txt b/examples/common/gui/CMakeLists.txt index ea8b0060aa..c06088f246 100644 --- a/examples/common/gui/CMakeLists.txt +++ b/examples/common/gui/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) set(EXAMPLES_UI_MODE "con" CACHE STRING "EXAMPLES_UI_MODE") diff --git a/examples/concurrent_hash_map/count_strings/CMakeLists.txt b/examples/concurrent_hash_map/count_strings/CMakeLists.txt index 77efd2f66f..0126127212 100644 --- a/examples/concurrent_hash_map/count_strings/CMakeLists.txt +++ b/examples/concurrent_hash_map/count_strings/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(count_strings CXX) diff --git a/examples/concurrent_priority_queue/shortpath/CMakeLists.txt b/examples/concurrent_priority_queue/shortpath/CMakeLists.txt index 624a59285f..311f450787 100644 --- a/examples/concurrent_priority_queue/shortpath/CMakeLists.txt +++ b/examples/concurrent_priority_queue/shortpath/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(shortpath CXX) diff --git a/examples/getting_started/sub_string_finder/CMakeLists.txt b/examples/getting_started/sub_string_finder/CMakeLists.txt index 91792dde1d..602d4d8f42 100644 --- a/examples/getting_started/sub_string_finder/CMakeLists.txt +++ b/examples/getting_started/sub_string_finder/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(sub_string_finder_simple CXX) project(sub_string_finder_extended CXX) diff --git a/examples/graph/binpack/CMakeLists.txt b/examples/graph/binpack/CMakeLists.txt index 3d3b79215a..e10539183d 100644 --- a/examples/graph/binpack/CMakeLists.txt +++ b/examples/graph/binpack/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(binpack CXX) diff --git a/examples/graph/cholesky/CMakeLists.txt b/examples/graph/cholesky/CMakeLists.txt index 2e8273ae71..5a70abc4ac 100644 --- a/examples/graph/cholesky/CMakeLists.txt +++ b/examples/graph/cholesky/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(cholesky CXX) diff --git a/examples/graph/dining_philosophers/CMakeLists.txt b/examples/graph/dining_philosophers/CMakeLists.txt index d46af59b1d..6be17caa88 100644 --- a/examples/graph/dining_philosophers/CMakeLists.txt +++ b/examples/graph/dining_philosophers/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(dining_philosophers CXX) diff --git a/examples/graph/fgbzip2/CMakeLists.txt b/examples/graph/fgbzip2/CMakeLists.txt index 7a9142a52c..694942e28f 100644 --- a/examples/graph/fgbzip2/CMakeLists.txt +++ b/examples/graph/fgbzip2/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(fgbzip2 CXX) diff --git a/examples/graph/logic_sim/CMakeLists.txt b/examples/graph/logic_sim/CMakeLists.txt index 99e1cc8f0b..5538f3f2bf 100644 --- a/examples/graph/logic_sim/CMakeLists.txt +++ b/examples/graph/logic_sim/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(logic_sim CXX) diff --git a/examples/graph/som/CMakeLists.txt b/examples/graph/som/CMakeLists.txt index c2dd1a8088..a942695035 100644 --- a/examples/graph/som/CMakeLists.txt +++ b/examples/graph/som/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) include(../../common/cmake/common.cmake) project(som CXX) diff --git a/examples/migration/recursive_fibonacci/CMakeLists.txt b/examples/migration/recursive_fibonacci/CMakeLists.txt index 57e027cfbf..47757c5e6e 100644 --- a/examples/migration/recursive_fibonacci/CMakeLists.txt +++ b/examples/migration/recursive_fibonacci/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Intel Corporation +# Copyright (c) 2023-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(recursive_fibonacci CXX) diff --git a/examples/parallel_for/game_of_life/CMakeLists.txt b/examples/parallel_for/game_of_life/CMakeLists.txt index 596342424c..df5dd9d864 100644 --- a/examples/parallel_for/game_of_life/CMakeLists.txt +++ b/examples/parallel_for/game_of_life/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(game_of_life CXX) diff --git a/examples/parallel_for/polygon_overlay/CMakeLists.txt b/examples/parallel_for/polygon_overlay/CMakeLists.txt index a45aaa6824..ee62e3d5f0 100644 --- a/examples/parallel_for/polygon_overlay/CMakeLists.txt +++ b/examples/parallel_for/polygon_overlay/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(polygon_overlay CXX) diff --git a/examples/parallel_for/seismic/CMakeLists.txt b/examples/parallel_for/seismic/CMakeLists.txt index 61675f19a5..f2b4f538ca 100644 --- a/examples/parallel_for/seismic/CMakeLists.txt +++ b/examples/parallel_for/seismic/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(seismic CXX) diff --git a/examples/parallel_for/tachyon/CMakeLists.txt b/examples/parallel_for/tachyon/CMakeLists.txt index 752fddeff1..7303ce107c 100644 --- a/examples/parallel_for/tachyon/CMakeLists.txt +++ b/examples/parallel_for/tachyon/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(tachyon CXX) diff --git a/examples/parallel_for_each/parallel_preorder/CMakeLists.txt b/examples/parallel_for_each/parallel_preorder/CMakeLists.txt index 8e98d3604f..1232474fb1 100644 --- a/examples/parallel_for_each/parallel_preorder/CMakeLists.txt +++ b/examples/parallel_for_each/parallel_preorder/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(parallel_preorder CXX) diff --git a/examples/parallel_pipeline/square/CMakeLists.txt b/examples/parallel_pipeline/square/CMakeLists.txt index 184c787ed9..f4545901b0 100644 --- a/examples/parallel_pipeline/square/CMakeLists.txt +++ b/examples/parallel_pipeline/square/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(square CXX) diff --git a/examples/parallel_reduce/convex_hull/CMakeLists.txt b/examples/parallel_reduce/convex_hull/CMakeLists.txt index 0492244a6a..d5f0085629 100644 --- a/examples/parallel_reduce/convex_hull/CMakeLists.txt +++ b/examples/parallel_reduce/convex_hull/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(convex_hull_bench CXX) project(convex_hull_sample CXX) diff --git a/examples/parallel_reduce/pi/CMakeLists.txt b/examples/parallel_reduce/pi/CMakeLists.txt index 62ebe022f7..01dd07d028 100644 --- a/examples/parallel_reduce/pi/CMakeLists.txt +++ b/examples/parallel_reduce/pi/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Intel Corporation +# Copyright (c) 2023-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(pi CXX) diff --git a/examples/parallel_reduce/primes/CMakeLists.txt b/examples/parallel_reduce/primes/CMakeLists.txt index 987d4656cb..23b985863f 100644 --- a/examples/parallel_reduce/primes/CMakeLists.txt +++ b/examples/parallel_reduce/primes/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(primes CXX) diff --git a/examples/task_arena/fractal/CMakeLists.txt b/examples/task_arena/fractal/CMakeLists.txt index 857dae642e..c8eef2d0c6 100644 --- a/examples/task_arena/fractal/CMakeLists.txt +++ b/examples/task_arena/fractal/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(fractal CXX) diff --git a/examples/task_group/sudoku/CMakeLists.txt b/examples/task_group/sudoku/CMakeLists.txt index f514662aba..8ce40a5861 100644 --- a/examples/task_group/sudoku/CMakeLists.txt +++ b/examples/task_group/sudoku/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(sudoku CXX) diff --git a/examples/test_all/fibonacci/CMakeLists.txt b/examples/test_all/fibonacci/CMakeLists.txt index 3b2368e06c..80e937f262 100644 --- a/examples/test_all/fibonacci/CMakeLists.txt +++ b/examples/test_all/fibonacci/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023 Intel Corporation +# Copyright (c) 2019-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5.0...3.31.3) project(fibonacci CXX)