From 15bbf1ea7581a8a872296435b28d679c7e42a466 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Sat, 20 Jun 2020 09:45:22 -0500 Subject: Handle cmake dependencies which require a specified version Some CMake packages fail to find at all if no version is specified. This commit adds a cmake_version parameter to dependency() to allow you to specify the requested version. --- mesonbuild/dependencies/data/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mesonbuild/dependencies/data') diff --git a/mesonbuild/dependencies/data/CMakeLists.txt b/mesonbuild/dependencies/data/CMakeLists.txt index 26c067d..acbf648 100644 --- a/mesonbuild/dependencies/data/CMakeLists.txt +++ b/mesonbuild/dependencies/data/CMakeLists.txt @@ -9,7 +9,11 @@ set(_packageName "${NAME}") string(TOUPPER "${_packageName}" PACKAGE_NAME) while(TRUE) - find_package("${NAME}" QUIET COMPONENTS ${COMPS}) + if ("${VERSION}" STREQUAL "") + find_package("${NAME}" QUIET COMPONENTS ${COMPS}) + else() + find_package("${NAME}" "${VERSION}" QUIET COMPONENTS ${COMPS}) + endif() # ARCHS has to be set via the CMD interface if(${_packageName}_FOUND OR ${PACKAGE_NAME}_FOUND OR "${ARCHS}" STREQUAL "") -- cgit v1.1