forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (26 loc) · 873 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
include (SafeCheckSymbolExists)
include (LibAddMacros)
set (plugin passwd)
if (DEPENDENCY_PHASE)
add_definitions (-D_GNU_SOURCE -D_DARWIN_C_SOURCE)
safe_check_symbol_exists (fgetpwent "stdio.h;sys/types.h;pwd.h" TEST_FGETPWENT)
safe_check_symbol_exists (getline "stdio.h" TEST_GETLINE)
safe_check_symbol_exists (putpwent "stdio.h;sys/types.h;pwd.h" TEST_PUTPWENT)
if (TEST_FGETPWENT)
add_definitions (-DUSE_FGETPWENT)
elseif (TEST_GETLINE)
add_definitions (-DUSE_FGETPWENT_LOCAL)
else ()
remove_plugin (${plugin} "could not find fgetpwent nor getline.")
endif ()
# no need to remove the plugin as our fallbacks have no deps
if (TEST_PUTPWENT)
add_definitions (-DUSE_PUTPWENT)
endif (TEST_PUTPWENT)
endif ()
add_plugin (passwd
SOURCES passwd.h
passwd.c
COMPILE_DEFINITIONS ${PASSWD_COMPILE_DEFS}
ADD_TEST
INSTALL_TEST_DATA)