cmake_minimum_required (VERSION 3.16)
|
|
if (WIN32)
|
message( FATAL_ERROR "Windows don't support pam modules." )
|
endif (WIN32)
|
|
#I don't know why this necessarily
|
set(CMAKE_FIND_LIBRARY_PREFIXES "")
|
set(CMAKE_FIND_LIBRARY_SUFFIXES "")
|
|
|
include(FindPkgConfig)
|
pkg_check_modules(CURL libcurl REQUIRED)
|
|
include_directories( SYSTEM ${CURL_INCLUDE_DIRS} )
|
|
project ("pam_omega")
|
|
add_library (pam_omega SHARED "OmegaOAuth2Pam.c")
|
|
target_link_libraries(pam_omega ${CURL_LIBRARIES} )
|
|
|
# TODO: Different linux distributives has different folders to install
|
install(TARGETS pam_omega DESTINATION /lib/x86_64-linux-gnu/security)
|
|
if (CMAKE_VERSION VERSION_GREATER 3.12)
|
set_property(TARGET pam_omega PROPERTY CXX_STANDARD 20)
|
endif()
|