Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work-around cmake bug #356

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions cmake/FindPAM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

pkg_check_modules(PAM QUIET IMPORTED_TARGET pam)

if (PAM_FOUND)
add_library(PAM::PAM ALIAS PkgConfig::PAM)
else()
if (NOT PAM_FOUND)
find_library(PAM_LINK_LIBRARIES NAMES pam REQUIRED)
find_path(PAM_INCLUDE_DIRS NAMES security/pam_modules.h)
endif()

add_library(PAM::PAM UNKNOWN IMPORTED)
add_library(PAM::PAM UNKNOWN IMPORTED)

set_target_properties(PAM::PAM PROPERTIES
IMPORTED_LOCATION "${PAM_LINK_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${PAM_INCLUDE_DIRS}"
)
endif()
set_target_properties(PAM::PAM PROPERTIES
IMPORTED_LOCATION "${PAM_LINK_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${PAM_INCLUDE_DIRS}"
)

find_package_handle_standard_args(PAM
REQUIRED_VARS PAM_LINK_LIBRARIES PAM_INCLUDE_DIRS
Expand Down
Loading