Bordeaux is a voice application server for modern IP telephony networks using modern C++ practices along with advances originally made in GNU Bayonne.
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.
 
 
 
 
 

72 lines
2.3 KiB

# Test for compiler and runtime library features.
# Copyright (C) 2020-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)
if(BUILD_STATIC OR BUILD_DRIVER)
if(EXISTS "vendor/")
set(BUILD_VENDOR true)
endif()
set(OPENSSL_USE_STATIC_LIBS true)
else()
# we do not use systemd for embedded or static builds...
pkg_search_module(SYSTEMD libsystemd IMPORTED_TARGET)
endif()
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
link_directories(${OPENSSL_LIBRARY_DIRS})
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(EXOSIP_LIBS eXosip2 osip2 osipparser2)
if(NOT EXISTS "vendor/" OR NOT BUILD_VENDOR)
pkg_check_modules(OSIP2 libosip2>=5.3.0)
endif()
if(OSIP2_FOUND)
include_directories(${OSIP2_INCLUDE_DIRECTORIES})
link_directories(${OSIP2_LIBRARY_DIRS})
elseif(EXISTS "vendor/")
include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/libosip2/include" "${CMAKE_CURRENT_SOURCE_DIR}/vendor/libeXosip2/include")
pkg_check_modules(CARES libcares>=1.13.0 REQUIRED)
include_directories(${CARES_INCLUDE_DIRECTORIES})
link_directories(${CARES_LIBRARY_DIRS})
list(APPEND EXOSIP_LIBS ${CARES_LIBRARIES})
else()
message(FATAL_ERROR "libosip2 and/or libeXosip2 not found")
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(BUILD_DEBUG true)
add_definitions(-DDEBUG)
else()
pkg_search_module(MALLOC jemalloc IMPORTED_TARGET)
endif()
if(BUILD_DRIVER OR BUILD_STATIC)
set(BUILD_STATIC true)
set(DRIVER_TYPE "STATIC")
list(APPEND CMAKE_EXE_LINKER_FLAGS "-static")
else()
set(DRIVER_TYPE "MODULE")
endif()