ukui-biometric-auth/pam-biometric/CMakeLists.txt

51 lines
1.8 KiB
CMake
Raw Normal View History

2022-06-02 16:34:46 +08:00
project(pam_biometric)
find_path(PAM_INCLUDE_DIR security/pam_modules.h)
find_library(PAM_LIB NAMES pam)
if(NOT PAM_INCLUDE_DIR OR NOT PAM_LIB)
message(FATAL_ERROR "pam_modules.h not found")
endif()
set(SCRIPTS_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/bin)
configure_file(
${PROJECT_SOURCE_DIR}/data/org.freedesktop.plicykit.pkexec.bioctl-helper.policy.in
${PROJECT_BINARY_DIR}/data/org.freedesktop.plicykit.pkexec.bioctl-helper.policy
)
configure_file(
${PROJECT_SOURCE_DIR}/data/org.freedesktop.plicykit.pkexec.biodrvctl.policy.in
${PROJECT_BINARY_DIR}/data/org.freedesktop.plicykit.pkexec.biodrvctl.policy
)
configure_file(
${PROJECT_SOURCE_DIR}/data/org.freedesktop.plicykit.pkexec.biorestart.policy.in
${PROJECT_BINARY_DIR}/data/org.freedesktop.plicykit.pkexec.biorestart.policy
)
set(pam_SRCS
pam_biometric.c
logger.c
)
include_directories(
../common
${PAM_INCLUDE_DIR}
2024-01-19 10:21:18 +08:00
${GLIB2_INCLUDE_DIRS}
2022-06-02 16:34:46 +08:00
)
add_library(pam_biometric SHARED ${pam_SRCS})
2024-01-19 10:21:18 +08:00
target_link_libraries(pam_biometric ${PAM_LIB} ${GLIB2_LIBRARIES})
2022-06-02 16:34:46 +08:00
#去除lib前缀
set_target_properties(pam_biometric PROPERTIES PREFIX "")
install(TARGETS pam_biometric DESTINATION /lib/security)
install(FILES pam-configs/pam-biometric DESTINATION /usr/share/pam-configs)
install(FILES data/ukui-biometric.conf DESTINATION /usr/share/ukui-biometric)
2022-06-02 16:34:46 +08:00
install(FILES
${PROJECT_BINARY_DIR}/data/org.freedesktop.plicykit.pkexec.bioctl-helper.policy
${PROJECT_BINARY_DIR}/data/org.freedesktop.plicykit.pkexec.biodrvctl.policy
${PROJECT_BINARY_DIR}/data/org.freedesktop.plicykit.pkexec.biorestart.policy
DESTINATION /usr/share/polkit-1/actions
)
install(FILES utils/bioctl utils/bioctl-helper utils/biodrvctl utils/biorestart DESTINATION bin PERMISSIONS ${CONDOR_SCRIPT_PERMS})