diff --git a/dev/benchmarks/complex_layout/windows/CMakeLists.txt b/dev/benchmarks/complex_layout/windows/CMakeLists.txt index d438ed55c4..e5249ec113 100644 --- a/dev/benchmarks/complex_layout/windows/CMakeLists.txt +++ b/dev/benchmarks/complex_layout/windows/CMakeLists.txt @@ -12,7 +12,7 @@ set(BINARY_NAME "complex_layout") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/dev/integration_tests/flutter_gallery/windows/CMakeLists.txt b/dev/integration_tests/flutter_gallery/windows/CMakeLists.txt index 899fe2f7aa..7bcccd0e73 100644 --- a/dev/integration_tests/flutter_gallery/windows/CMakeLists.txt +++ b/dev/integration_tests/flutter_gallery/windows/CMakeLists.txt @@ -3,7 +3,7 @@ project(flutter_gallery LANGUAGES CXX) set(BINARY_NAME "flutter_gallery") -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") diff --git a/dev/integration_tests/ui/windows/CMakeLists.txt b/dev/integration_tests/ui/windows/CMakeLists.txt index 950267e782..2c530c16f0 100644 --- a/dev/integration_tests/ui/windows/CMakeLists.txt +++ b/dev/integration_tests/ui/windows/CMakeLists.txt @@ -8,7 +8,7 @@ set(BINARY_NAME "ui") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/dev/integration_tests/windows_startup_test/windows/CMakeLists.txt b/dev/integration_tests/windows_startup_test/windows/CMakeLists.txt index 334308a189..04d2abc343 100644 --- a/dev/integration_tests/windows_startup_test/windows/CMakeLists.txt +++ b/dev/integration_tests/windows_startup_test/windows/CMakeLists.txt @@ -8,7 +8,7 @@ set(BINARY_NAME "windows_startup_test") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/dev/manual_tests/windows/CMakeLists.txt b/dev/manual_tests/windows/CMakeLists.txt index af381b95f3..6a0c8e0d9b 100644 --- a/dev/manual_tests/windows/CMakeLists.txt +++ b/dev/manual_tests/windows/CMakeLists.txt @@ -3,7 +3,7 @@ project(manual_tests LANGUAGES CXX) set(BINARY_NAME "manual_tests") -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") diff --git a/examples/api/windows/CMakeLists.txt b/examples/api/windows/CMakeLists.txt index 56a9a607ca..8d3590ee41 100644 --- a/examples/api/windows/CMakeLists.txt +++ b/examples/api/windows/CMakeLists.txt @@ -3,7 +3,7 @@ project(dartpad_curve2_d_0 LANGUAGES CXX) set(BINARY_NAME "dartpad_curve2_d_0") -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") diff --git a/examples/flutter_view/windows/CMakeLists.txt b/examples/flutter_view/windows/CMakeLists.txt index b9fb5292d1..0485fb94f2 100644 --- a/examples/flutter_view/windows/CMakeLists.txt +++ b/examples/flutter_view/windows/CMakeLists.txt @@ -12,7 +12,7 @@ set(BINARY_NAME "flutter_view") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/examples/hello_world/windows/CMakeLists.txt b/examples/hello_world/windows/CMakeLists.txt index 94417c99a9..51ca9d1db7 100644 --- a/examples/hello_world/windows/CMakeLists.txt +++ b/examples/hello_world/windows/CMakeLists.txt @@ -8,7 +8,7 @@ set(BINARY_NAME "hello_world") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/examples/platform_channel/windows/CMakeLists.txt b/examples/platform_channel/windows/CMakeLists.txt index a36526998b..a8a64c8d51 100644 --- a/examples/platform_channel/windows/CMakeLists.txt +++ b/examples/platform_channel/windows/CMakeLists.txt @@ -8,7 +8,7 @@ set(BINARY_NAME "platform_channel") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/examples/platform_view/windows/CMakeLists.txt b/examples/platform_view/windows/CMakeLists.txt index f8a5f5f6fd..36fa4a7d46 100644 --- a/examples/platform_view/windows/CMakeLists.txt +++ b/examples/platform_view/windows/CMakeLists.txt @@ -12,7 +12,7 @@ set(BINARY_NAME "platform_view") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/packages/flutter_tools/templates/app_shared/windows.tmpl/CMakeLists.txt.tmpl b/packages/flutter_tools/templates/app_shared/windows.tmpl/CMakeLists.txt.tmpl index 5e2a3058fa..78f98b83d5 100644 --- a/packages/flutter_tools/templates/app_shared/windows.tmpl/CMakeLists.txt.tmpl +++ b/packages/flutter_tools/templates/app_shared/windows.tmpl/CMakeLists.txt.tmpl @@ -8,7 +8,7 @@ set(BINARY_NAME "{{projectName}}") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(SET CMP0063 NEW) +cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/packages/flutter_tools/templates/plugin/windows.tmpl/CMakeLists.txt.tmpl b/packages/flutter_tools/templates/plugin/windows.tmpl/CMakeLists.txt.tmpl index 79f6b75e7a..160ea50f88 100644 --- a/packages/flutter_tools/templates/plugin/windows.tmpl/CMakeLists.txt.tmpl +++ b/packages/flutter_tools/templates/plugin/windows.tmpl/CMakeLists.txt.tmpl @@ -8,6 +8,10 @@ cmake_minimum_required(VERSION 3.14) set(PROJECT_NAME "{{projectName}}") project(${PROJECT_NAME} LANGUAGES CXX) +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + # This value is used when generating builds using this plugin, so it must # not be changed set(PLUGIN_NAME "{{projectName}}_plugin")