2018-04-10 17:03:59 +02:00
|
|
|
#
|
2019-07-26 09:43:53 +02:00
|
|
|
# Copyright(c) 2019 ADLINK Technology Limited and others
|
2018-04-10 17:03:59 +02:00
|
|
|
#
|
|
|
|
# This program and the accompanying materials are made available under the
|
|
|
|
# terms of the Eclipse Public License v. 2.0 which is available at
|
|
|
|
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
|
|
|
# v. 1.0 which is available at
|
|
|
|
# http://www.eclipse.org/org/documents/edl-v10.php.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
|
|
|
#
|
2019-02-14 17:01:09 +01:00
|
|
|
cmake_minimum_required(VERSION 3.7)
|
2018-04-10 17:03:59 +02:00
|
|
|
|
2019-07-26 09:43:53 +02:00
|
|
|
if(NOT ${PROJECT_NAME} STREQUAL "CycloneDDS")
|
|
|
|
get_filename_component(dir ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
|
|
|
|
message(FATAL_ERROR "Top-level CMakeLists.txt was moved to the top-level directory. Please run cmake on ${dir} instead of ${CMAKE_CURRENT_LIST_DIR}")
|
2018-08-05 08:20:53 +02:00
|
|
|
endif()
|
|
|
|
|
2020-03-25 10:39:44 +01:00
|
|
|
# Generate a header file listing compile-time options relevant to the API. Define to
|
|
|
|
# "1" if enabled so that the generated features.h ends up having either
|
|
|
|
#
|
|
|
|
# - #define DDS_HAS_SECURITY 1
|
|
|
|
# or
|
|
|
|
# - /* #undef DDS_HAS_SECURITY */
|
|
|
|
#
|
|
|
|
# which caters both for those who prefer #ifdef DDS_HAS_SECURITY and for those who prefer
|
|
|
|
# #if DDS_HAS_SECURITY.
|
2020-06-17 23:24:57 +02:00
|
|
|
option(ENABLE_SECURITY "Enable OMG DDS Security support" ON)
|
|
|
|
option(ENABLE_LIFESPAN "Enable Lifespan QoS support" ON)
|
|
|
|
option(ENABLE_DEADLINE_MISSED "Enable Deadline Missed QoS support" ON)
|
2020-03-25 10:39:44 +01:00
|
|
|
if(ENABLE_SECURITY)
|
|
|
|
set(DDS_HAS_SECURITY "1")
|
|
|
|
endif()
|
|
|
|
if(ENABLE_LIFESPAN)
|
|
|
|
set(DDS_HAS_LIFESPAN "1")
|
|
|
|
endif()
|
|
|
|
if(ENABLE_DEADLINE_MISSED)
|
|
|
|
set(DDS_HAS_DEADLINE_MISSED "1")
|
|
|
|
endif()
|
|
|
|
configure_file(features.h.in "${CMAKE_CURRENT_BINARY_DIR}/core/include/dds/features.h")
|
|
|
|
|
2020-02-26 10:17:01 +01:00
|
|
|
add_definitions(-DDDSI_INCLUDE_NETWORK_PARTITIONS -DDDSI_INCLUDE_SSM)
|
|
|
|
|
|
|
|
# OpenSSL is huge, raising the RSS by 1MB or so, and moreover find_package(OpenSSL) causes
|
|
|
|
# trouble on some older CMake versions that otherwise work fine, so provide an option to avoid
|
|
|
|
# all OpenSSL related things.
|
|
|
|
#
|
|
|
|
# Historically the option was DDSC_ENABLE_OPENSSL so make some allowance for those who are
|
|
|
|
# currently relying on it.
|
|
|
|
option(ENABLE_SSL "Enable openssl support" ON)
|
|
|
|
option(DDSC_ENABLE_OPENSSL "Deprecated: please use ENABLE_SSL instead" ON)
|
|
|
|
if(NOT DDSC_ENABLE_OPENSSL)
|
|
|
|
message(ERROR "DDSC_ENABLE_OPENSSL is deprecated, please use ENABLE_SSL instead")
|
|
|
|
set(ENABLE_SSL OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_SSL)
|
|
|
|
find_package(OpenSSL)
|
|
|
|
if(OPENSSL_FOUND)
|
|
|
|
add_definitions(-DDDSI_INCLUDE_SSL)
|
|
|
|
message(STATUS "Building with OpenSSL support")
|
|
|
|
else()
|
|
|
|
message(STATUS "Building without OpenSSL support")
|
|
|
|
endif()
|
|
|
|
endif()
|
2019-11-11 13:11:33 +01:00
|
|
|
|
|
|
|
# Support the OMG DDS Security within ddsc adds quite a bit of code.
|
|
|
|
if(NOT ENABLE_SECURITY)
|
|
|
|
message(STATUS "Building without OMG DDS Security support")
|
2020-02-26 10:17:01 +01:00
|
|
|
else()
|
|
|
|
add_definitions(-DDDSI_INCLUDE_SECURITY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_LIFESPAN)
|
|
|
|
add_definitions(-DDDSI_INCLUDE_LIFESPAN)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_DEADLINE_MISSED)
|
|
|
|
add_definitions(-DDDSI_INCLUDE_DEADLINE_MISSED)
|
2019-11-11 13:11:33 +01:00
|
|
|
endif()
|
|
|
|
|
2019-07-26 09:43:53 +02:00
|
|
|
add_subdirectory(ddsrt)
|
2018-12-19 16:54:01 +01:00
|
|
|
|
2019-07-26 09:43:53 +02:00
|
|
|
# some of the tests in the core rely on preprocessing IDL, so idlc has to
|
|
|
|
# come first
|
|
|
|
if(BUILD_IDLC)
|
|
|
|
add_subdirectory(idlc)
|
2019-04-30 01:09:40 +08:00
|
|
|
endif()
|
2019-10-30 11:41:00 +01:00
|
|
|
add_subdirectory(security)
|
2018-04-10 17:03:59 +02:00
|
|
|
add_subdirectory(core)
|
|
|
|
add_subdirectory(tools)
|
2019-07-26 09:43:53 +02:00
|
|
|
if(BUILD_TESTING AND HAVE_MULTI_PROCESS AND BUILD_IDLC)
|
2019-04-10 17:57:29 +02:00
|
|
|
add_subdirectory(mpt)
|
|
|
|
endif()
|