diff options
author | Loïc Collignon <loic.collignon@iot.bzh> | 2017-07-11 06:36:33 +0200 |
---|---|---|
committer | Loïc Collignon <loic.collignon@iot.bzh> | 2017-07-11 06:36:33 +0200 |
commit | 0455a7401f9f0f9bfad82c5ddf04f7dd70b0b852 (patch) | |
tree | 819bc150cb62c8eb344656086bbb52892f5288b8 /pam_agl/CMakeLists.txt | |
parent | 66b90d26cfd555b2aa5fef67d31e539a70256719 (diff) |
first somewhat working version.
Change-Id: I3101dc6b8add87eccac3bbf177b1320137f72463
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'pam_agl/CMakeLists.txt')
-rw-r--r-- | pam_agl/CMakeLists.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pam_agl/CMakeLists.txt b/pam_agl/CMakeLists.txt new file mode 100644 index 0000000..564a025 --- /dev/null +++ b/pam_agl/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.1) +project(pam_agl) + +include(FindPkgConfig) + +# Require PAM but there is no find_package +set(PAM_INCLUDE_DIR "/usr/include/") +set(PAM_LIBRARY "/lib64/libpam.so.0") +include_directories(${PAM_INCLUDE_DIR}) + +# Find json-c +pkg_check_modules(${JSON_C} REQUIRED json-c) +include_directories(${${JSON_C}_INCLUDE_DIRS}) +add_compile_options(${${JSON_C}_CFLAGS}) + +# Add the target +add_library(pam_agl SHARED pam_agl.c) +target_link_libraries(pam_agl ${PAM_LIBRARY} ${${JSON_C}_LIBRARIES}) +#list (APPEND link_libraries ${${JSON_C}_LDFLAGS}) +set_property(TARGET pam_agl PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET pam_agl PROPERTY PREFIX "") + +if (NOT DEFINED CMAKE_INSTALL_LIBDIR) + get_filename_component(CMAKE_INSTALL_LIBDIR ${PAM_LIBRARY} DIRECTORY) +endif() + +install(TARGETS pam_agl + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/security/") |