Secure collaboration server using 0MQ and Curve.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

50 lines
1.5 KiB

# Test for compiler and runtime library features.
# Copyright (C) 2019-2021 David Sugar <tychosoft@gmail.com>.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
include(CheckCXXSourceCompiles)
include(CheckIncludeFileCXX)
include(CheckFunctionExists)
include(FindPkgConfig)
pkg_check_modules(ZEROMQ libzmq REQUIRED)
pkg_check_modules(SODIUM libsodium REQUIRED)
pkg_check_modules(PSQL libpq>=11.0 REQUIRED)
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR} ${PSQL_INCLUDE_DIRS})
link_directories(${PSQL_LIBRARY_DIRS})
if(BUILD_SYSTEMD AND NOT BUILD_STATIC)
pkg_search_module(SYSTEMD libsystemd IMPORTED_TARGET)
endif()
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
CHECK_INCLUDE_FILE_CXX("format" HAVE_FORMAT)
if(NOT HAVE_FORMAT)
pkg_check_modules(FMT fmt>=6.1.2 REQUIRED)
include_directories(${FMT_INCLUDE_DIRECTORIES})
endif()
set(system_libs Threads::Threads)
if(BUILD_STATIC)
list(APPEND CMAKE_EXE_LINKER_FLAGS "-static")
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(BUILD_DEBUG true)
add_definitions(-DDEBUG)
else()
pkg_search_module(MALLOC jemalloc IMPORTED_TARGET)
endif()