Raise CMake floor to 3.15...3.31 and use find_package(SQLite3) (subsumes #1084)#1478
Open
bmehta001 wants to merge 1 commit into
Open
Raise CMake floor to 3.15...3.31 and use find_package(SQLite3) (subsumes #1084)#1478bmehta001 wants to merge 1 commit into
bmehta001 wants to merge 1 commit into
Conversation
CMake 4.0 removed compatibility with cmake_minimum_required < 3.5, which broke configuration of this repo: wrappers/obj-c/CMakeLists.txt still declared 2.8.2. Normalize every repo-owned CMakeLists.txt to the range 3.15...3.31 so the project both configures under CMake 4.x and pins a predictable policy ceiling. 3.15 is the floor because the built-in FindSQLite3 module (used below) requires >= 3.14, and several existing files already required 3.15. Subsume microsoft#1084: in the legacy (non-vcpkg) Linux/macOS dependency path, replace the bare "sqlite3" link name with find_package(SQLite3 REQUIRED) and the imported SQLite::SQLite3 target, which carries its own include directories. Applied in lib, functests, and unittests; the static-.a fallbacks and the vcpkg/Android/Windows paths are unchanged. Vendored zlib CMakeLists are left untouched (already >= 3.5). Validated: - CMake 4.3.3 rejects the old 2.8.2 floor and accepts 3.15...3.31. - Repo root configures cleanly under CMake 4.3.3 (Windows, vcpkg deps). - find_package(SQLite3 REQUIRED) + SQLite::SQLite3 resolves on Linux. Files: CMakeLists.txt; 6 examples/*/CMakeLists.txt; lib/CMakeLists.txt; lib/android_build/{app,maesdk}/src/main/cpp/CMakeLists.txt; tests/{vcpkg,functests,unittests}/CMakeLists.txt; wrappers/{obj-c,swift}/CMakeLists.txt Resolves microsoft#1339. Supersedes microsoft#1084. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates the project’s CMake compatibility to configure cleanly with CMake 4.x by raising cmake_minimum_required() across repo-owned CMake projects to 3.15...3.31, and modernizes legacy (non-vcpkg) sqlite linking on Linux/macOS by using find_package(SQLite3) and the SQLite::SQLite3 imported target.
Changes:
- Raised the CMake policy/version floor across multiple repo-owned
CMakeLists.txtfiles to3.15...3.31(CMake 4.x compatible while pinning a policy ceiling). - Replaced legacy
"sqlite3"link-name usage withfind_package(SQLite3 REQUIRED)+SQLite::SQLite3in legacy (non-vcpkg) build paths for the library and test targets. - Normalized Android sample/app CMake floors to match the repo-wide baseline.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Raises the root project’s CMake minimum/policy range to 3.15...3.31 for CMake 4.x compatibility. |
| lib/CMakeLists.txt | In legacy non-vcpkg mode, resolves SQLite via find_package(SQLite3) and links SQLite::SQLite3 instead of bare sqlite3. |
| tests/functests/CMakeLists.txt | Uses find_package(SQLite3) + SQLite::SQLite3 for the fallback legacy sqlite link path. |
| tests/unittests/CMakeLists.txt | Uses find_package(SQLite3) + SQLite::SQLite3 for the fallback legacy sqlite link path. |
| tests/vcpkg/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31 for vcpkg integration test project. |
| wrappers/obj-c/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31 to avoid CMake 4.x configure failure. |
| wrappers/swift/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31. |
| lib/android_build/maesdk/src/main/cpp/CMakeLists.txt | Raises Android CMake minimum/policy range to 3.15...3.31. |
| lib/android_build/app/src/main/cpp/CMakeLists.txt | Raises Android CMake minimum/policy range to 3.15...3.31. |
| examples/c/SampleC-Guest/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31. |
| examples/cpp/EventSender/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31. |
| examples/cpp/MacProxy/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31. |
| examples/cpp/SampleCpp/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31. |
| examples/cpp/SampleCppMini/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31. |
| examples/objc/cocoa-app/CMakeLists.txt | Raises CMake minimum/policy range to 3.15...3.31. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Raise the CMake floor for every repo-owned
CMakeLists.txtto the range3.15...3.31, and switch the legacy (non-vcpkg) Linux/macOS SQLite link tofind_package(SQLite3)+ the importedSQLite::SQLite3target.Why
CMake 4.0 removed support for
cmake_minimum_required(VERSION <3.5). The repo still shippedwrappers/obj-c/CMakeLists.txtdeclaring2.8.2, so configuring with CMake 4.x fails with:Normalizing all repo-owned floors to
3.15...3.31makes the project configure under CMake 4.x while pinning a predictable policy ceiling.3.15is chosen as the floor because:FindSQLite3module (used here) requires CMake >= 3.14, and3.15.This also subsumes #1084: in the legacy non-vcpkg Linux/macOS path, the bare
"sqlite3"link name is replaced withfind_package(SQLite3 REQUIRED)andSQLite::SQLite3, which carries its own include directories. The static-.afallbacks (/usr/local, homebrew) and the vcpkg / Android-bundled / Windows.vcxprojpaths are unchanged.Vendored
zlib/**CMakeLists are intentionally left untouched (already>= 3.5, so CMake-4.0-safe).Files
CMakeLists.txt(root)examples/{c/SampleC-Guest,cpp/EventSender,cpp/MacProxy,cpp/SampleCpp,cpp/SampleCppMini,objc/cocoa-app}/CMakeLists.txtlib/CMakeLists.txt(floor +find_package(SQLite3))lib/android_build/{app,maesdk}/src/main/cpp/CMakeLists.txt(maesdk was3.10.2)tests/{vcpkg,functests,unittests}/CMakeLists.txt(functests/unittests:find_package(SQLite3))wrappers/{obj-c,swift}/CMakeLists.txt(obj-c was the2.8.2breakage)Validation
2.8.2floor (Compatibility with CMake < 3.5 has been removed) and accepts3.15...3.31(Configuring done).MATSDK_USE_VCPKG_DEPS=ON).find_package(SQLite3 REQUIRED)+SQLite::SQLite3resolves on Linux; the repo's legacy-Linux configure reaches the library target andfind_package(ZLIB)cleanly.Resolves #1339. Supersedes #1084.