Skip to content

Commit 98a15da

Browse files
committed
Work-around cmake bug
As it turns out, the cmake version shipped with ubuntu 24.04 can not correctly handle ALIAS targets as CMAKE_REQUIRED_LIBRARIES. We didn't realize before because the ubuntu 24.04 vm available for github actions ships another version of cmake, (3.31.5 instead of 3.28)
1 parent 1e4b6d1 commit 98a15da

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

cmake/FindPAM.cmake

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22

33
pkg_check_modules(PAM QUIET IMPORTED_TARGET pam)
44

5-
if (PAM_FOUND)
6-
add_library(PAM::PAM ALIAS PkgConfig::PAM)
7-
else()
5+
if (NOT PAM_FOUND)
86
find_library(PAM_LINK_LIBRARIES NAMES pam REQUIRED)
97
find_path(PAM_INCLUDE_DIRS NAMES security/pam_modules.h)
8+
endif()
109

11-
add_library(PAM::PAM UNKNOWN IMPORTED)
10+
add_library(PAM::PAM UNKNOWN IMPORTED)
1211

13-
set_target_properties(PAM::PAM PROPERTIES
14-
IMPORTED_LOCATION "${PAM_LINK_LIBRARIES}"
15-
INTERFACE_INCLUDE_DIRECTORIES "${PAM_INCLUDE_DIRS}"
16-
)
17-
endif()
12+
set_target_properties(PAM::PAM PROPERTIES
13+
IMPORTED_LOCATION "${PAM_LINK_LIBRARIES}"
14+
INTERFACE_INCLUDE_DIRECTORIES "${PAM_INCLUDE_DIRS}"
15+
)
1816

1917
find_package_handle_standard_args(PAM
2018
REQUIRED_VARS PAM_LINK_LIBRARIES PAM_INCLUDE_DIRS

0 commit comments

Comments
 (0)