1
0
mirror of https://github.com/rd235/cado synced 2024-12-26 14:03:07 +01:00

Fix CADO_SPOOL_DIR path and change PostInstall flag

This commit is contained in:
Mattia Biondi 2020-05-03 15:34:22 +02:00
parent 8cadce02ae
commit 792020b65d
2 changed files with 38 additions and 35 deletions

View File

@ -1,34 +1,37 @@
cmake_minimum_required(VERSION 3.13)
project(cado
VERSION 0.9.4
DESCRIPTION "Capability Ambient DO. Provide users just the capabilities they need."
HOMEPAGE_URL "https://github.com/rd235/cado"
LANGUAGES C)
VERSION 0.9.4
DESCRIPTION "Capability Ambient DO. Provide users just the capabilities they need."
HOMEPAGE_URL "https://github.com/rd235/cado"
LANGUAGES C)
include(GNUInstallDirs)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2 -O2 -Wall -pedantic")
set(LIBS_REQUIRED cap execs mhash pam pam_misc)
option(CADO_RUN_POST_INSTALL "Run PostInstall.cmake" ON)
foreach(THISLIB IN LISTS LIBS_REQUIRED)
find_library(${THISLIB}_library ${THISLIB})
if(NOT ${THISLIB}_library)
message(FATAL_ERROR "library lib${THISLIB} not found")
endif()
find_library(${THISLIB}_library ${THISLIB})
if(NOT ${THISLIB}_library)
message(FATAL_ERROR "library lib${THISLIB} not found")
endif()
endforeach(THISLIB)
if (WITHEDITOR)
set(EDITOR "${WITHEDITOR}")
set(EDITOR "${WITHEDITOR}")
else (WITHEDITOR)
set(EDITOR "/usr/bin/vi")
set(EDITOR "/usr/bin/vi")
endif (WITHEDITOR)
# Spool dir for scado files
set(CADO_SPOOL_DIR "/usr/local/var/spool/cado")
set(CADO_SPOOL_DIR
"${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/${CMAKE_PROJECT_NAME}")
configure_file(
"include/config.h.in"
"include/config.h"
"include/config.h.in"
"include/config.h"
)
add_subdirectory(man)

View File

@ -1,27 +1,27 @@
cmake_minimum_required(VERSION 3.13)
add_executable(
cado cado.c pam_check.c get_user_groups.c capset_from_namelist.c
read_conf.c set_ambient_cap.c compute_digest.c file_utils.c
scado_parse.c cado_scado_check.c
cado cado.c pam_check.c get_user_groups.c capset_from_namelist.c
read_conf.c set_ambient_cap.c compute_digest.c file_utils.c
scado_parse.c cado_scado_check.c
)
target_include_directories(cado PRIVATE ${PROJECT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include)
target_link_libraries(
cado ${pam_library} ${pam_misc_library} ${cap_library} ${mhash_library}
${execs_library})
cado ${pam_library} ${pam_misc_library} ${cap_library} ${mhash_library}
${execs_library})
add_executable(cadrop cadrop.c capset_from_namelist.c set_ambient_cap.c)
target_include_directories(cadrop PRIVATE ${PROJECT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include)
target_link_libraries(cadrop ${cap_library})
add_executable(
scado scado.c pam_check.c file_utils.c compute_digest.c
capset_from_namelist.c scado_parse.c
scado scado.c pam_check.c file_utils.c compute_digest.c
capset_from_namelist.c scado_parse.c
)
target_include_directories(scado PRIVATE ${PROJECT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include)
target_link_libraries(
scado ${pam_library} ${pam_misc_library} ${cap_library} ${mhash_library}
${execs_library}
scado ${pam_library} ${pam_misc_library} ${cap_library} ${mhash_library}
${execs_library}
)
add_executable(caprint caprint.c)
@ -29,19 +29,19 @@ target_include_directories(caprint PRIVATE ${PROJECT_SOURCE_DIR}/include ${CMAKE
target_link_libraries(caprint ${cap_library})
install(
TARGETS cado cadrop scado caprint
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
TARGETS cado cadrop scado caprint
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
if(NOT DEBUILD)
install(
CODE "execute_process(
COMMAND ${CMAKE_COMMAND}
-DBINDIR=${CMAKE_INSTALL_FULL_BINDIR}
-DLIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}
-DCADO_SPOOL_DIR=${CADO_SPOOL_DIR}
-P ${PROJECT_SOURCE_DIR}/PostInstall.cmake
)"
)
if(CADO_RUN_POST_INSTALL)
install(
CODE "execute_process(
COMMAND ${CMAKE_COMMAND}
-DBINDIR=${CMAKE_INSTALL_FULL_BINDIR}
-DLIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}
-DCADO_SPOOL_DIR=${CADO_SPOOL_DIR}
-P ${PROJECT_SOURCE_DIR}/PostInstall.cmake
)"
)
endif()