rublon-ssh/PAM/ssh/lib/CMakeLists.txt
rublon-bwi 6b9d2f938c
Bwi/v2.1.0 (#15)
* Add phone call authentication method

* Remove dynamic mem allocation from error handler

* Add more error handling code

* Move error handling to different file

* Remove Socket IO dependency

* cleanup in websocket code

* Add rapidjson as cmake dependency

* Added Dockerfiles as primary build system for packages

* Changed policy in CMakeList to work with lower version of CMake

* Fix opensuse builds

* Link filesystem library in gcc 8.5 or older
2024-11-18 12:57:20 +01:00

65 lines
1.3 KiB
CMake
Executable File

add_library(rublon-ssh
SHARED
pam.cpp
)
set_target_properties(rublon-ssh PROPERTIES PREFIX "")
set_target_properties(rublon-ssh PROPERTIES OUTPUT_NAME "pam_rublon")
target_compile_options(rublon-ssh
PUBLIC
-flto
)
target_link_options(rublon-ssh
PUBLIC
-fpic
-flto
)
target_include_directories(rublon-ssh
PUBLIC
SYSTEM ${rapidjson_SOURCE_DIR}/include
)
target_link_libraries(rublon-ssh
PUBLIC
rublon-ssh-ifc
websockets
-lcurl
-lssl
-lcrypto
)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 8.5)
target_link_libraries(rublon-ssh
PUBLIC
-lstdc++fs
)
endif()
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|alma|rocky" )
message(INFO " detected rhel base system")
set(_destination /usr/lib64/security/)
elseif(${outOS} MATCHES "opensuse-leap" )
message(INFO " detected suse base system")
set(_destination /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
DESTINATION
${_destination}
COMPONENT
PAM
)