2020-01-08 11:19:54 +01:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
project(cado
|
2023-06-24 08:51:20 +02:00
|
|
|
VERSION 0.9.6
|
2020-05-03 15:34:22 +02:00
|
|
|
DESCRIPTION "Capability Ambient DO. Provide users just the capabilities they need."
|
|
|
|
HOMEPAGE_URL "https://github.com/rd235/cado"
|
|
|
|
LANGUAGES C)
|
2020-01-08 11:19:54 +01:00
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
2020-01-09 19:50:58 +01:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2 -O2 -Wall -pedantic")
|
2020-01-08 11:19:54 +01:00
|
|
|
|
|
|
|
set(LIBS_REQUIRED cap execs mhash pam pam_misc)
|
|
|
|
|
2020-05-03 15:34:22 +02:00
|
|
|
option(CADO_RUN_POST_INSTALL "Run PostInstall.cmake" ON)
|
|
|
|
|
2020-01-08 11:19:54 +01:00
|
|
|
foreach(THISLIB IN LISTS LIBS_REQUIRED)
|
2020-05-03 15:34:22 +02:00
|
|
|
find_library(${THISLIB}_library ${THISLIB})
|
|
|
|
if(NOT ${THISLIB}_library)
|
|
|
|
message(FATAL_ERROR "library lib${THISLIB} not found")
|
|
|
|
endif()
|
2020-01-08 11:19:54 +01:00
|
|
|
endforeach(THISLIB)
|
|
|
|
|
|
|
|
if (WITHEDITOR)
|
2020-05-03 15:34:22 +02:00
|
|
|
set(EDITOR "${WITHEDITOR}")
|
2020-01-08 11:19:54 +01:00
|
|
|
else (WITHEDITOR)
|
2020-05-03 15:34:22 +02:00
|
|
|
set(EDITOR "/usr/bin/vi")
|
2020-01-08 11:19:54 +01:00
|
|
|
endif (WITHEDITOR)
|
|
|
|
|
2020-01-31 20:13:00 +01:00
|
|
|
# Spool dir for scado files
|
2020-05-03 15:34:22 +02:00
|
|
|
set(CADO_SPOOL_DIR
|
2020-05-03 15:50:32 +02:00
|
|
|
"${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/${CMAKE_PROJECT_NAME}")
|
2020-01-31 19:16:49 +01:00
|
|
|
|
2020-01-08 11:19:54 +01:00
|
|
|
configure_file(
|
2020-05-03 15:34:22 +02:00
|
|
|
"include/config.h.in"
|
|
|
|
"include/config.h"
|
2020-01-08 11:19:54 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
add_subdirectory(man)
|
|
|
|
add_subdirectory(src)
|
|
|
|
|
|
|
|
add_custom_target(uninstall
|
2020-01-31 19:08:24 +01:00
|
|
|
"${CMAKE_COMMAND}"
|
|
|
|
-DCADO_SPOOL_DIR=${CADO_SPOOL_DIR}
|
|
|
|
-P "${PROJECT_SOURCE_DIR}/Uninstall.cmake"
|
|
|
|
)
|