cmake: don't install pam file if exists

fixes #209
This commit is contained in:
Vaxry 2024-03-21 15:45:26 +00:00
parent f77e17e4d2
commit e0d7e8f946

View file

@ -83,5 +83,9 @@ protocol("unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml" "linux-dmabuf-unst
# Installation # Installation
install(TARGETS hyprlock) install(TARGETS hyprlock)
install(FILES "pam/hyprlock" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d") install(CODE "
if (NOT EXISTS \"${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d/hyprlock\")
install(FILES \"${CMAKE_SOURCE_DIR}/pam/hyprlock\" DESTINATION \"${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d\")
endif()
")