firebase-cpp-sdk icon indicating copy to clipboard operation
firebase-cpp-sdk copied to clipboard

[FR] Update the minimum required CMake version

Open Lyokone opened this issue 2 years ago • 5 comments

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

Lyokone avatar May 30 '24 11:05 Lyokone

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

dconeybe avatar May 30 '24 17:05 dconeybe

March 1st 2025, the error remains during build.

corepuncher avatar Feb 28 '25 23:02 corepuncher

Same here, I'm getting the same warning when I build

LeytonHouck avatar Mar 03 '25 01:03 LeytonHouck

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...?

MangelSpec avatar Nov 17 '25 14:11 MangelSpec

`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 value. Or, use the ... syntax to tell CMake that the project requires at least but has been updated to work with policies introduced by or earlier.

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 ?

Souravforever2000 avatar Dec 09 '25 14:12 Souravforever2000

any update?

nadavf24 avatar Dec 15 '25 14:12 nadavf24

any updates?

hwkim1127 avatar Dec 29 '25 01:12 hwkim1127

@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

PIYUSH-69 avatar Dec 31 '25 12:12 PIYUSH-69

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)")

nadavf24 avatar Dec 31 '25 15:12 nadavf24

With the latest flutter version 3.38.9 it's now impossible to release a Windows app :/

Tom3652 avatar Jan 30 '26 15:01 Tom3652

We have bumped cmake to 3.22 in #1812 .

AustinBenoit avatar Mar 06 '26 21:03 AustinBenoit