build: add glaze dependency with FetchContent fallback (#13666)

This commit is contained in:
davc0n
2026-03-16 00:53:28 +02:00
committed by GitHub
parent 902e8de7f0
commit 30c498acf4
2 changed files with 19 additions and 3 deletions
+3 -3
View File
@@ -11,10 +11,10 @@ set(CMAKE_CXX_STANDARD 23)
pkg_check_modules(hyprpm_deps REQUIRED IMPORTED_TARGET tomlplusplus hyprutils>=0.7.0)
find_package(glaze 7.0.0 QUIET)
find_package(glaze 7...<8 QUIET)
if (NOT glaze_FOUND)
set(GLAZE_VERSION v7.0.0)
message(STATUS "glaze dependency not found, retrieving ${GLAZE_VERSION} with FetchContent")
set(GLAZE_VERSION v7.2.0)
message(STATUS "hyprpm: glaze dependency not found, retrieving ${GLAZE_VERSION} with FetchContent")
include(FetchContent)
FetchContent_Declare(
glaze
+16
View File
@@ -11,11 +11,27 @@ find_package(PkgConfig REQUIRED)
pkg_check_modules(starthyprland_deps REQUIRED IMPORTED_TARGET hyprutils>=0.10.3)
find_package(glaze 7...<8 QUIET)
if (NOT glaze_FOUND)
set(GLAZE_VERSION v7.2.0)
message(STATUS "start: glaze dependency not found, retrieving ${GLAZE_VERSION} with FetchContent")
include(FetchContent)
FetchContent_Declare(
glaze
GIT_REPOSITORY https://github.com/stephenberry/glaze.git
GIT_TAG ${GLAZE_VERSION}
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(glaze)
endif()
file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp")
add_executable(start-hyprland ${SRCFILES})
target_link_libraries(start-hyprland PUBLIC PkgConfig::starthyprland_deps)
target_link_libraries(start-hyprland PUBLIC glaze::glaze)
install(TARGETS start-hyprland)