add_library(rublon-ssh-pam SHARED pam.cpp ) set_target_properties(rublon-ssh-pam PROPERTIES PREFIX "") set_target_properties(rublon-ssh-pam PROPERTIES OUTPUT_NAME "pam_rublon") target_compile_options(rublon-ssh-pam PUBLIC -flto -Wno-deprecated-declarations ) target_link_options(rublon-ssh-pam PUBLIC -fpic -flto ) target_link_libraries(rublon-ssh-pam PUBLIC rublon-ssh -lcurl -lssl -lcrypto -lsioclient_tls ) execute_process ( COMMAND bash -c "awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"'" OUTPUT_VARIABLE outOS ) if(${outOS} MATCHES "centos|rhel" ) message(INFO "detected rhen base system") set(_destination /usr/lib64/security/) elseif(${outOS} MATCHES "debian|ubuntu") message(INFO "detected debian based system") set(_destination /usr/lib/x86_64-linux-gnu/security/) endif() install( TARGETS rublon-ssh-pam DESTINATION ${_destination} COMPONENT PAM )