cmake: allow config-mode Grantlee5 discovery from CMAKE_PREFIX_PATH (use Grantlee5Config.cmake if present)

This commit is contained in:
Copilot authored and Torsten Wierschin committed 2026-07-21 13:39:07 +02:00
1 parent cef0d47ebc
commit f18fce26e2
1 file changed
+10
+10
View File
@@ -18,6 +18,16 @@ if (PKG_CONFIG_FOUND)
endif()
endif()
# Try config-mode: look for Grantlee5Config.cmake in CMAKE_PREFIX_PATH or installed location
find_file(_Grantlee5Config NAMES Grantlee5Config.cmake PATHS ${CMAKE_PREFIX_PATH} NO_DEFAULT_PATH PATH_SUFFIXES Grantlee5)
if(_Grantlee5Config)
include(${_Grantlee5Config})
if(TARGET Grantlee5::Templates)
set(Grantlee5_FOUND TRUE)
return()
endif()
endif()
# Not found: provide helpful message and stop. Downstream CMakeLists check TARGET Grantlee5::Templates
set(Grantlee5_FOUND FALSE)
message(STATUS "Grantlee5 not found (shim cmake/FindGrantlee5.cmake); codegen_grantlee will be skipped if present.")