CMAKE_MINIMUM_REQUIRED(VERSION 2.6) ##### Configure project version when using ##### outdated tools like CMake v2 IF(POLICY CMP0048) CMAKE_POLICY(SET CMP0048 NEW) ENDIF() IF(POLICY CMP0069) CMAKE_POLICY(SET CMP0069 NEW) ENDIF() IF(CMAKE_VERSION VERSION_LESS 3.0) PROJECT(device-certificate-manager CXX C) SET(PROJECT_VERSION "2.0") ELSE() PROJECT(device-certificate-manager VERSION 2.0 LANGUAGES C CXX) ENDIF() INCLUDE(GNUInstallDirs) IF(NOT (CMAKE_VERSION VERSION_LESS 3.9)) INCLUDE(CheckIPOSupported) check_ipo_supported(RESULT IPO_ALLOWED) ELSE() SET(IPO_ALLOWED YES) ENDIF() find_package(Threads REQUIRED) INCLUDE(cmake/CheckFrameworks.cmake) INCLUDE(cmake/CStandard.cmake) ADD_DEFINITIONS("-Werror") ADD_DEFINITIONS("-Wall") ADD_DEFINITIONS("-Wextra") SET(CMAKE_POSITION_INDEPENDENT_CODE "True") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") option(ENABLE_SYSTEMD_SUPPORT "Enable support for systemd" ON) IF(ENABLE_SYSTEMD_SUPPORT AND NOT SYSTEMD_FOUND) message(FATAL_ERROR "systemd support required but systemd not found") ENDIF() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dcm_build_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/dcm_build_config.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(shared) SET(DCM_UNIX_SOCKET_PATH "/run/device-certificate-manager.socket") add_definitions(-DDCM_UNIX_SOCKET_PATH="${DCM_UNIX_SOCKET_PATH}") add_subdirectory(dcm-client) add_subdirectory(dcm-daemon) add_subdirectory(pkgconfig) add_subdirectory(rpm) add_subdirectory(systemd) add_subdirectory(tests) add_subdirectory(tools)