Debian Codegraph @

CMakeLists.txt

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 cmake_minimum_required (VERSION 2.6)
2 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
3
4 project(pam-abl)
5 set(PAM_ABL_COMMON_SRC
6 config.c
7 dbfun.c
8 log.c
9 pam_abl.c
10 rule.c
11 typefun.c
12 )
13
14
15 set(PAM_ABL_TOOLS_SRC
16 tools.c
17 )
18
19 set(PAM_ABL_LIB_SRC
20 pam_functions.c
21 )
22
23 set(PAM_ABL_TEST_SRC
24 test_abl.c
25 test.c
26 test_db.c
27 test_rule.c
28 test_types.c
29 test_config.c
30 )
31
32 find_package(BerkeleyDB REQUIRED)
33 find_package(Pam REQUIRED)
34
35 #Building pam-abl using a different version of Berkeley db.
36 #If you have only one version of Berkeley db installed, it should normally work without any changes.
37 #If you have multiple versions installed, you can specify the version to use by providing the params
38 #on the commandline when calling cmake:
39 # -DDB_LIBRARY=<db version, "db-4.7">
40 # -DDB_INCLUDE_DIR=<db include dir>
41 # -DDB_LINK_DIR=<db link dir>
42 #
43 #for example: cmake -DDB_INCLUDE_DIR=/db-5.3.15/include/ -DDB_LINK_DIR=/db-5.3.15/lib/ -DDB_LIBRARY=db-5.3
44 #or it can be as easy as: cmake -DDB_LIBRARY=db-4.7 ../
45 if (DEFINED DB_LINK_DIR)
46 link_directories(${DB_LINK_DIR})
47 endif(DEFINED DB_LINK_DIR)
48
49 #if you want a debug build, please add "-DCMAKE_BUILD_TYPE=Debug" as param to the cmake call
50 if( NOT CMAKE_BUILD_TYPE)
51 set( CMAKE_BUILD_TYPE Release)
52 endif( NOT CMAKE_BUILD_TYPE)
53
54 include_directories(${DB_INCLUDE_DIR} ${PAM_INCLUDE_DIRS})
55 add_definitions(-W -Wall -Wshadow -Winit-self -Wredundant-decls -Wcast-align -Wfloat-equal -Winline -Wunreachable-code
56 -Wmissing-declarations -Wswitch-enum -Wswitch-default -Wformat -Wmain -Wextra -Wunused -Wmissing-noreturn)
57 set(CMAKE_SHARED_LIBRARY_PREFIX "")
58
59 add_executable(pam-abl_bin ${PAM_ABL_COMMON_SRC} ${PAM_ABL_TOOLS_SRC})
60 set_target_properties(pam-abl_bin PROPERTIES OUTPUT_NAME pam_abl)
61 set_target_properties(pam-abl_bin PROPERTIES COMPILE_DEFINITIONS "TOOLS")
62 target_link_libraries(pam-abl_bin ${DB_LIBRARY} )
63
64 add_executable(pam-abl_test ${PAM_ABL_COMMON_SRC} ${PAM_ABL_TEST_SRC})
65 set_target_properties(pam-abl_test PROPERTIES OUTPUT_NAME pam_abl_test)
66 set_target_properties(pam-abl_test PROPERTIES COMPILE_DEFINITIONS "TEST")
67 target_link_libraries(pam-abl_test ${DB_LIBRARY} )
68
69 add_library(pam-abl_lib SHARED ${PAM_ABL_COMMON_SRC} ${PAM_ABL_LIB_SRC})
70 set_target_properties(pam-abl_lib PROPERTIES OUTPUT_NAME pam_abl)
71 target_link_libraries(pam-abl_lib ${DB_LIBRARY} ${PAM_LIBRARY})
72
73 INSTALL(TARGETS pam-abl_bin
74 RUNTIME DESTINATION bin
75 )
76 INSTALL(TARGETS pam-abl_lib DESTINATION lib/security)