Use find_package to search for Corrosion (#7797)

First try to search for corrosion before fetching it
This commit is contained in:
scristall-bennu 2025-03-05 11:19:47 -07:00 committed by GitHub
parent 390f8aaf50
commit be59032ecb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,13 +9,17 @@ project(Slint HOMEPAGE_URL "https://slint.dev/" LANGUAGES C CXX VERSION 1.10.0)
include(FeatureSummary)
include(CMakeDependentOption)
include(FetchContent)
FetchContent_Declare(
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.5.1
)
FetchContent_MakeAvailable(Corrosion)
find_package(Corrosion QUIET 0.5)
if (NOT Corrosion_FOUND)
include(FetchContent)
FetchContent_Declare(
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.5.1
)
FetchContent_MakeAvailable(Corrosion)
endif (NOT Corrosion_FOUND)
list(PREPEND CMAKE_MODULE_PATH ${Corrosion_SOURCE_DIR}/cmake)
find_package(Rust 1.82 REQUIRED MODULE)