[FR] Update the minimum required CMake version
Feature proposal
- Firebase Component: All
FlutterFire is using Firebase CPP SDK for Windows compatibility. We are getting a warning when compiling
CMake Deprecation Warning at /build/windows/x64/extracted/firebase_cpp_sdk_windows/CMakeLists.txt:17 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
I see that this is caused by this line: https://github.com/firebase/firebase-cpp-sdk/blob/df09d59cd0af503229ed412490e5f3938dbc2c24/release_build_files/CMakeLists.txt#L17
I'm wondering if it's needed to support this minimum CMake.
Reference issue https://github.com/firebase/flutterfire/issues/12849
Drive-by comment: This github repo officially documents cmake 3.7 as the minimum-supported version: https://github.com/firebase/firebase-cpp-sdk/blob/main/README.md
HOWEVER, last time I tried, when building for Android the build fails if using cmake 3.7 and I had to use cmake 3.6.
There have been a lot of great features added to cmake since 3.7 so it would be pretty nice to use a newer version as the minimum supported. For example, cmake 3.12 adds a far-better mechanism to find a Python interpreter:
find_package(Python3 COMPONENTS Interpreter REQUIRED)
e.g. https://github.com/firebase/firebase-ios-sdk/blob/02d963ce64a2f2187a058a3746e9ea8fa4ace986/cmake/python_setup.cmake#L79-L86
March 1st 2025, the error remains during build.
Same here, I'm getting the same warning when I build
CMake Error at .../build/windows/extracted/firebase_cpp_sdk_windows/CMakeLists.txt:17 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
After 1.5 years and using cmake version 4.1.2, we finally reached the point of ERROR and no deprecated WARNING anymore. Any updates on this...?
`CMake Error at C:/Users/Admin/StudioProjects/incredibleyears_desktop_new/build/windows/x64/extracted/firebase_cpp_sdk_windows/CMakeLists.txt:17 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
Error: Unable to generate build files`
I am also facing the same problem when i try to run my flutter windows application and can't resolve till last 2 days. Any update on this issue ? How to fix it ?
any update?
any updates?
@hwkim1127 @nadavf24 @Souravforever2000
ADDING THE BELOW LINE HELPED ME SOLVE THE ISSUUE
set(CMAKE_POLICY_VERSION_MINIMUM 3.10)
Project-level configuration.
cmake_minimum_required(VERSION 3.14) project(svenska_technologies LANGUAGES CXX) set(CMAKE_POLICY_VERSION_MINIMUM 3.10)
The name of the executable created for the application. Change this to change
the on-disk name of your application.
AFTER THE CHANGES REMEBER TO DO THE FOLLOWING COMMANDS
Flutter clean Flutter pub get
Thanks, i solved it using the following lines
add_custom_command(
OUTPUT ${firebase_external_flatc}
COMMAND cd ${firebase_external_flatc_build_dir} ${COMMAND_CONCAT}
${ENV_COMMAND} ${FIREBASE_FLATC_CMAKE_COMMAND} ${FLATBUFFERS_SOURCE_DIR} ${COMMAND_CONCAT}
${ENV_COMMAND} ${FIREBASE_FLATC_CMAKE_COMMAND} --build . --target flatc
COMMENT "Building flatc (the FlatBuffer schema compiler)")
to this
add_custom_command(
OUTPUT ${firebase_external_flatc}
COMMAND cd ${firebase_external_flatc_build_dir} ${COMMAND_CONCAT}
${ENV_COMMAND} ${FIREBASE_FLATC_CMAKE_COMMAND} -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ${FLATBUFFERS_SOURCE_DIR} ${COMMAND_CONCAT}
${ENV_COMMAND} ${FIREBASE_FLATC_CMAKE_COMMAND} --build . --target flatc
COMMENT "Building flatc (the FlatBuffer schema compiler)")
With the latest flutter version 3.38.9 it's now impossible to release a Windows app :/
We have bumped cmake to 3.22 in #1812 .