-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
33 lines (24 loc) · 1.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cmake_minimum_required(VERSION 3.16)
project(LinuxHello)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
find_package(PAM REQUIRED)
find_package(OpenCV REQUIRED)
find_package(dlib REQUIRED)
set(CMAKE_SHARED_MODULE_PREFIX "")
add_library(pam_linux_hello MODULE src/pam_main.cpp)
target_link_libraries(pam_linux_hello pam)
#It must be wrong to add sources in this way. But this is my first CMake project so I'm still learning.
add_executable(linux-hello src/main.cpp src/face_recognition.h src/face_recognition_model_v1.h src/snapshot.h src/darkness.h src/darkness.cpp src/face_recognition_model_v1.cpp src/snapshot.cpp src/face_recognition.cpp src/User.h include/CLI11.hpp include/cpptoml.h)
target_link_libraries(linux-hello pam ${OpenCV_LIBS} dlib::dlib)
install(TARGETS pam_linux_hello DESTINATION /lib/x86_64-linux-gnu/security/)
install(FILES linux_hello DESTINATION /usr/share/pam-configs/)
install(FILES config.toml DESTINATION /etc/linux-hello/)
install(DIRECTORY data DESTINATION /etc/linux-hello)
install(DIRECTORY DESTINATION /etc/linux-hello/models)
install(TARGETS linux-hello DESTINATION /usr/bin/)