diff options
author | Markus Härer <markus.haerer@gmx.net> | 2024-03-09 17:59:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-09 17:59:05 +0100 |
commit | 4ddc576847c1ce6cc24d0957ab0abf50bcba07c8 (patch) | |
tree | 7b222da11e5039108f710fe283b7bbed2044cc21 /cmake/modules/FindLibDRM.cmake | |
parent | 4a9cb641fb9a418e9c93732155e2fe29c2f74e9a (diff) | |
parent | 5f6b42fd111b28d5571923152c47e7094de5e3cd (diff) |
Merge pull request #24755 from fuzzard/cmake_fixups_standardisation
[cmake] Find Module cleanup and modernisation
Diffstat (limited to 'cmake/modules/FindLibDRM.cmake')
-rw-r--r-- | cmake/modules/FindLibDRM.cmake | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cmake/modules/FindLibDRM.cmake b/cmake/modules/FindLibDRM.cmake index efb7003c97..8fbd7f4354 100644 --- a/cmake/modules/FindLibDRM.cmake +++ b/cmake/modules/FindLibDRM.cmake @@ -8,17 +8,26 @@ # LibDRM::LibDRM - The LibDRM library if(NOT TARGET LIBDRM::LIBDRM) + + if(LibDRM_FIND_VERSION) + if(LibDRM_FIND_VERSION_EXACT) + set(LibDRM_FIND_SPEC "=${LibDRM_FIND_VERSION_COMPLETE}") + else() + set(LibDRM_FIND_SPEC ">=${LibDRM_FIND_VERSION_COMPLETE}") + endif() + endif() + find_package(PkgConfig) if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_LIBDRM libdrm>=2.4.95 QUIET) + pkg_check_modules(PC_LIBDRM libdrm${LibDRM_FIND_SPEC} QUIET) endif() find_path(LIBDRM_INCLUDE_DIR NAMES drm.h PATH_SUFFIXES libdrm drm - PATHS ${PC_LIBDRM_INCLUDEDIR} + HINTS ${PC_LIBDRM_INCLUDEDIR} NO_CACHE) find_library(LIBDRM_LIBRARY NAMES drm - PATHS ${PC_LIBDRM_LIBDIR} + HINTS ${PC_LIBDRM_LIBDIR} NO_CACHE) set(LIBDRM_VERSION ${PC_LIBDRM_VERSION}) |