mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-12-29 13:20:05 +01:00
Make detection of pam library more portable (#840)
FreeBSD has the pam library installed in the base system. However, it does not provide pam.pc file. So pkg_check_modules() fails to detect pam library. With this change, cmake tries to find it using find_library() first and falls back to pkg_check_modules().
This commit is contained in:
parent
bdf0ef8282
commit
347e05a40e
1 changed files with 13 additions and 2 deletions
|
|
@ -86,14 +86,25 @@ pkg_check_modules(
|
|||
pangocairo
|
||||
libdrm
|
||||
gbm
|
||||
pam
|
||||
hyprutils>=0.8.0
|
||||
sdbus-c++>=2.0.0
|
||||
hyprgraphics)
|
||||
find_library(PAM_FOUND pam)
|
||||
if(PAM_FOUND)
|
||||
message(STATUS "Found pam")
|
||||
set(PAM_LIB ${PAM_FOUND})
|
||||
else()
|
||||
pkg_check_modules(PAM IMPORTED_TARGET pam)
|
||||
if(PAM_FOUND)
|
||||
set(PAM_LIB PkgConfig::PAM)
|
||||
else()
|
||||
message(FATAL_ERROR "The required library libpam was not found.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp")
|
||||
add_executable(hyprlock ${SRCFILES})
|
||||
target_link_libraries(hyprlock PRIVATE pam rt Threads::Threads PkgConfig::deps
|
||||
target_link_libraries(hyprlock PRIVATE ${PAM_LIB} rt Threads::Threads PkgConfig::deps
|
||||
OpenGL::EGL OpenGL::GLES3)
|
||||
|
||||
# protocols
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue