From a2746c9d6e0d6755e1b83f2df693d9e581667d0e Mon Sep 17 00:00:00 2001 From: Tyler Mayoff Date: Sat, 8 Oct 2022 11:28:54 -0400 Subject: [PATCH 001/140] Added test for optional --- dds/DCPS/ValueDispatcher.h | 91 +++++++++++++++++++++++ dds/Version.h | 2 +- tests/DCPS/Compiler/optional/.gitignore | 12 +++ tests/DCPS/Compiler/optional/main.cpp | 7 ++ tests/DCPS/Compiler/optional/optional.mpc | 13 ++++ tests/DCPS/Compiler/optional/test.idl | 6 ++ 6 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 dds/DCPS/ValueDispatcher.h create mode 100644 tests/DCPS/Compiler/optional/.gitignore create mode 100644 tests/DCPS/Compiler/optional/main.cpp create mode 100644 tests/DCPS/Compiler/optional/optional.mpc create mode 100644 tests/DCPS/Compiler/optional/test.idl diff --git a/dds/DCPS/ValueDispatcher.h b/dds/DCPS/ValueDispatcher.h new file mode 100644 index 00000000000..3a24345b13e --- /dev/null +++ b/dds/DCPS/ValueDispatcher.h @@ -0,0 +1,91 @@ +/* + * Distributed under the OpenDDS License. + * See: http://www.opendds.org/license.html + */ + +#ifndef OPENDDS_DCPS_VALUE_DISPATCHER_H +#define OPENDDS_DCPS_VALUE_DISPATCHER_H + +#include "TypeSupportImpl.h" +#include "ValueReader.h" +#include "ValueWriter.h" + +OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace OpenDDS { +namespace DCPS { + +struct OpenDDS_Dcps_Export ValueDispatcher { + virtual ~ValueDispatcher() {} + + virtual void* new_value() const = 0; + virtual void delete_value(void* data) const = 0; + + virtual bool read(ValueReader& value_reader, void* data) const = 0; + virtual void write(ValueWriter& value_writer, const void* data) const = 0; + + virtual DDS::InstanceHandle_t register_instance_helper(DDS::DataWriter* dw, const void* data) const = 0; + virtual DDS::ReturnCode_t write_helper(DDS::DataWriter* dw, const void* data, DDS::InstanceHandle_t inst) const = 0; + virtual DDS::ReturnCode_t unregister_instance_helper(DDS::DataWriter* dw, const void* data, DDS::InstanceHandle_t inst) const = 0; + virtual DDS::ReturnCode_t dispose_helper(DDS::DataWriter* dw, const void* data, DDS::InstanceHandle_t inst) const = 0; +}; + +template +struct ValueDispatcher_T : public virtual ValueDispatcher { + virtual ~ValueDispatcher_T() {} + + virtual void* new_value() const + { + return new T(); + } + + virtual void delete_value(void* data) const + { + T* tbd = static_cast(data); + delete tbd; + } + + virtual bool read(ValueReader& value_reader, void* data) const + { + return vread(value_reader, *static_cast(data)); + } + + virtual void write(ValueWriter& value_writer, const void* data) const + { + vwrite(value_writer, *static_cast(data)); + } + + typedef typename OpenDDS::DCPS::DDSTraits TraitsType; + typedef typename TraitsType::DataWriterType DataWriterType; + + virtual DDS::InstanceHandle_t register_instance_helper(DDS::DataWriter* dw, const void* data) const + { + DataWriterType* dw_t = dynamic_cast(dw); + return dw_t ? dw_t->register_instance(*static_cast(data)) : DDS::HANDLE_NIL; + } + + virtual DDS::ReturnCode_t write_helper(DDS::DataWriter* dw, const void* data, DDS::InstanceHandle_t inst) const + { + DataWriterType* dw_t = dynamic_cast(dw); + return dw_t ? dw_t->write(*static_cast(data), inst) : DDS::RETCODE_BAD_PARAMETER; + } + + virtual DDS::ReturnCode_t unregister_instance_helper(DDS::DataWriter* dw, const void* data, DDS::InstanceHandle_t inst) const + { + DataWriterType* dw_t = dynamic_cast(dw); + return dw_t ? dw_t->unregister_instance(*static_cast(data), inst) : DDS::RETCODE_BAD_PARAMETER; + } + + virtual DDS::ReturnCode_t dispose_helper(DDS::DataWriter* dw, const void* data, DDS::InstanceHandle_t inst) const + { + DataWriterType* dw_t = dynamic_cast(dw); + return dw_t ? dw_t->dispose(*static_cast(data), inst) : DDS::RETCODE_BAD_PARAMETER; + } +}; + +} // namespace DCPS +} // namespace OpenDDS + +OPENDDS_END_VERSIONED_NAMESPACE_DECL + +#endif /* OPENDDS_DCPS_VALUE_DISPATCHER_H */ diff --git a/dds/Version.h b/dds/Version.h index fc355cdd33a..09731e2a457 100644 --- a/dds/Version.h +++ b/dds/Version.h @@ -9,7 +9,7 @@ #define OPENDDS_VERSION_H #define OPENDDS_MAJOR_VERSION 3 -#define OPENDDS_MINOR_VERSION 22 +#define OPENDDS_MINOR_VERSION 23 #define OPENDDS_MICRO_VERSION 0 #define OPENDDS_VERSION_METADATA "dev" #define OPENDDS_IS_RELEASE 0 diff --git a/tests/DCPS/Compiler/optional/.gitignore b/tests/DCPS/Compiler/optional/.gitignore new file mode 100644 index 00000000000..5bef6a54c89 --- /dev/null +++ b/tests/DCPS/Compiler/optional/.gitignore @@ -0,0 +1,12 @@ +/optional +/testC.cpp +/testC.h +/testC.inl +/testS.h +/testTypeSupport.idl +/testTypeSupportC.cpp +/testTypeSupportC.h +/testTypeSupportC.inl +/testTypeSupportImpl.cpp +/testTypeSupportImpl.h +/testTypeSupportS.h \ No newline at end of file diff --git a/tests/DCPS/Compiler/optional/main.cpp b/tests/DCPS/Compiler/optional/main.cpp new file mode 100644 index 00000000000..a987da2084d --- /dev/null +++ b/tests/DCPS/Compiler/optional/main.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/DCPS/Compiler/optional/optional.mpc b/tests/DCPS/Compiler/optional/optional.mpc new file mode 100644 index 00000000000..1d0a023cea7 --- /dev/null +++ b/tests/DCPS/Compiler/optional/optional.mpc @@ -0,0 +1,13 @@ + +project: dcps_test, opendds_cxx11, googletest, msvc_bigobj { + exename = optional + includes += . + macros += CPP11_MAPPING=1 + Source_Files { + main.cpp + } + idlflags += -I. + TypeSupport_Files { + test.idl + } +} \ No newline at end of file diff --git a/tests/DCPS/Compiler/optional/test.idl b/tests/DCPS/Compiler/optional/test.idl new file mode 100644 index 00000000000..0c37b4c9b8b --- /dev/null +++ b/tests/DCPS/Compiler/optional/test.idl @@ -0,0 +1,6 @@ +@topic +struct Data { + string hello; + // @optional + // boolean opt_data; +}; \ No newline at end of file From 61d129db793f8e1c9a4ed5113e30bc8baee92f22 Mon Sep 17 00:00:00 2001 From: Tyler Mayoff Date: Sat, 8 Oct 2022 13:13:38 -0400 Subject: [PATCH 002/140] some debugging to see where annotations are --- dds/idl/dds_visitor.cpp | 4 ++++ tests/DCPS/Compiler/optional/main.cpp | 7 +++++++ tests/DCPS/Compiler/optional/test.idl | 8 +++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dds/idl/dds_visitor.cpp b/dds/idl/dds_visitor.cpp index 78989d97a3f..d7fe4b6e8ea 100644 --- a/dds/idl/dds_visitor.cpp +++ b/dds/idl/dds_visitor.cpp @@ -307,6 +307,10 @@ dds_visitor::visit_structure(AST_Structure* node) const Fields fields(node); const Fields::Iterator fields_end = fields.end(); for (Fields::Iterator i = fields.begin(); i != fields_end; ++i) { + ACE_DEBUG((LM_DEBUG, "%C", (*i)->name())); + for (auto a: (*i)->annotations()) { + ACE_DEBUG((LM_DEBUG, "Annotation: %s\n", a->original_name())); + } field_vec.push_back(*i); } diff --git a/tests/DCPS/Compiler/optional/main.cpp b/tests/DCPS/Compiler/optional/main.cpp index a987da2084d..3ffa3cf0874 100644 --- a/tests/DCPS/Compiler/optional/main.cpp +++ b/tests/DCPS/Compiler/optional/main.cpp @@ -1,5 +1,12 @@ #include +#include "testTypeSupportC.h" + +TEST(Optional, OptionalTest) { + Data d; + d.opt_data(true); +} + int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); diff --git a/tests/DCPS/Compiler/optional/test.idl b/tests/DCPS/Compiler/optional/test.idl index 0c37b4c9b8b..08705392f5a 100644 --- a/tests/DCPS/Compiler/optional/test.idl +++ b/tests/DCPS/Compiler/optional/test.idl @@ -1,6 +1,8 @@ @topic struct Data { - string hello; - // @optional - // boolean opt_data; + @optional + boolean opt_data; + + @appendable + boolean append; }; \ No newline at end of file From 742dbab72777585c062c8c8c46477ea8a73ee4c1 Mon Sep 17 00:00:00 2001 From: Tyler Mayoff Date: Sat, 8 Oct 2022 13:50:47 -0400 Subject: [PATCH 003/140] removed other type --- tests/DCPS/Compiler/optional/test.idl | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/DCPS/Compiler/optional/test.idl b/tests/DCPS/Compiler/optional/test.idl index 08705392f5a..2f560ab7863 100644 --- a/tests/DCPS/Compiler/optional/test.idl +++ b/tests/DCPS/Compiler/optional/test.idl @@ -2,7 +2,4 @@ struct Data { @optional boolean opt_data; - - @appendable - boolean append; }; \ No newline at end of file From 01f410eedeb7195f64c1d1e4a07b5d457fb15f2e Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Tue, 13 Jun 2023 16:14:38 -0500 Subject: [PATCH 004/140] Use CMake to Build OpenDDS Initial Work --- CMakeLists.txt | 461 ++++++++++++++++++ .../DCPS/Messenger/CMakeLists.txt | 11 +- DevGuideExamples/DCPS/Messenger/Publisher.cpp | 17 +- .../DCPS/Messenger/Subscriber.cpp | 18 +- bin/PerlDDS/Run_Test.pm | 12 +- cmake/configure_ace_tao.pl | 100 ++++ cmake/dds_idl_sources.cmake | 14 +- cmake/detect_ace.cpp | 26 + cmake/detect_ace.pl | 142 ++++++ cmake/import_common.cmake | 55 ++- cmake/init.cmake | 108 ++-- cmake/opendds_build_helpers.cmake | 67 +++ cmake/opendds_features.cmake | 65 +++ cmake/opendds_target_sources.cmake | 30 +- cmake/opendds_testing.cmake | 23 + cmake/scrap_gnuace.pl | 131 +++++ cmake/tao_idl_sources.cmake | 45 +- dds/DCPS/CMakeLists.txt | 24 + dds/DCPS/DataDurabilityCache.h | 28 +- dds/DCPS/DurabilityArray.h | 4 +- dds/DCPS/InfoRepoDiscovery/CMakeLists.txt | 25 + dds/DCPS/Marked_Default_Qos.h | 12 +- dds/DCPS/RTPS/CMakeLists.txt | 46 ++ dds/DCPS/RTPS/MessageParser.cpp | 6 +- dds/DCPS/RTPS/MessageUtils.cpp | 4 - dds/DCPS/TimeDuration.h | 1 + dds/DCPS/Time_Helper.h | 9 +- dds/DCPS/transport/multicast/CMakeLists.txt | 26 + .../transport/multicast/ReliableSession.cpp | 8 +- dds/DCPS/transport/rtps_udp/CMakeLists.txt | 27 + dds/DCPS/transport/shmem/CMakeLists.txt | 19 + dds/DCPS/transport/tcp/CMakeLists.txt | 25 + dds/DCPS/transport/udp/CMakeLists.txt | 19 + dds/InfoRepo/CMakeLists.txt | 61 +++ dds/InfoRepo/DCPSInfoRepo.mpc | 3 +- dds/InfoRepo/DCPSInfoRepoServ_Export.h | 62 +-- dds/InfoRepo/DCPSInfo_i.cpp | 11 +- dds/idl/CMakeLists.txt | 38 ++ dds/idl/be_produce.cpp | 14 + dds/idl/typeobject_generator.cpp | 28 +- .../Messenger/C++11_Messenger/CMakeLists.txt | 5 +- .../Messenger/Messenger_1/CMakeLists.txt | 5 +- .../Messenger/Messenger_2/CMakeLists.txt | 5 +- tests/cmake/Nested_IDL/CMakeLists.txt | 23 +- tests/cmake/Nested_IDL/ecu.idl | 12 +- .../engine/engine_stats/samename.idl | 8 + tests/cmake/Nested_IDL/engine/samename.idl | 8 + tests/cmake/Nested_IDL/samename.idl | 8 + tests/cmake/ace_tao_only/CMakeLists.txt | 6 +- 49 files changed, 1719 insertions(+), 186 deletions(-) create mode 100644 CMakeLists.txt create mode 100755 cmake/configure_ace_tao.pl create mode 100644 cmake/detect_ace.cpp create mode 100644 cmake/detect_ace.pl create mode 100644 cmake/opendds_build_helpers.cmake create mode 100644 cmake/opendds_features.cmake create mode 100644 cmake/opendds_testing.cmake create mode 100755 cmake/scrap_gnuace.pl create mode 100644 dds/DCPS/CMakeLists.txt create mode 100644 dds/DCPS/InfoRepoDiscovery/CMakeLists.txt create mode 100644 dds/DCPS/RTPS/CMakeLists.txt create mode 100644 dds/DCPS/transport/multicast/CMakeLists.txt create mode 100644 dds/DCPS/transport/rtps_udp/CMakeLists.txt create mode 100644 dds/DCPS/transport/shmem/CMakeLists.txt create mode 100644 dds/DCPS/transport/tcp/CMakeLists.txt create mode 100644 dds/DCPS/transport/udp/CMakeLists.txt create mode 100644 dds/InfoRepo/CMakeLists.txt create mode 100644 dds/idl/CMakeLists.txt create mode 100644 tests/cmake/Nested_IDL/engine/engine_stats/samename.idl create mode 100644 tests/cmake/Nested_IDL/engine/samename.idl create mode 100644 tests/cmake/Nested_IDL/samename.idl diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000000..a6fd5ca4c39 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,461 @@ +cmake_minimum_required(VERSION 3.22) + +project(opendds) +enable_testing() + +set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") +set(OPENDDS_CMAKE_V4 TRUE CACHE INTERNAL "") +# Need global GENERATED source file properties and need to override it for CMake tests +set(CMAKE_POLICY_DEFAULT_CMP0118 NEW CACHE INTERNAL "") +set(OPENDDS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") +set(OPENDDS_BIN_DIR "${OPENDDS_BUILD_DIR}/bin" CACHE INTERNAL "") +set(OPENDDS_LIB_DIR "${OPENDDS_BUILD_DIR}/lib" CACHE INTERNAL "") +set(OPENDDS_SOURCE_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "") +list(APPEND CMAKE_PREFIX_PATH "${OPENDDS_SOURCE_ROOT}") +set(_OPENDDS_CMAKE_DIR "${OPENDDS_SOURCE_ROOT}/cmake" CACHE INTERNAL "") +list(APPEND CMAKE_MODULE_PATH "${_OPENDDS_CMAKE_DIR}") + +include("${_OPENDDS_CMAKE_DIR}/opendds_features.cmake") + +if(NOT DEFINED OPENDDS_ACE) + # TODO: Move building ACE/TAO to its own file? + include(ExternalProject) + include(FetchContent) + + set(ACE_IS_BEING_BUILT MPC CACHE INTERNAL "") + set(TAO_IS_BEING_BUILT MPC CACHE INTERNAL "") + set(OPENDDS_ACE "${OPENDDS_BUILD_DIR}/ace_tao" CACHE INTERNAL "") + set(OPENDDS_MPC "${OPENDDS_ACE}/MPC" CACHE INTERNAL "") + set(OPENDDS_TAO "${OPENDDS_ACE}/TAO" CACHE INTERNAL "") + set(url_base "https://github.com/DOCGroup/ACE_TAO/releases/download/") + set(ace_ver "7.1.0") + set(configre_ace_tao_args) + if(WIN32) + # TODO + else() + set(ext "tar.bz2") + set(md5 "4696c2898de3bda28dd69abf0055b7eb") + set(mpc_type gnuace) + if(LINUX) + set(config_file "config-linux.h") + list(APPEND configure_ace_tao_args --platform-macros-file "platform_linux.GNU") + elseif(APPLE) + # TODO + endif() + endif() + if(NOT DEFINED config_file) + message(FATAL_ERROR "Not sure how to build ACE/TAO for this system") + endif() + + string(REPLACE "." "_" ace_ver_tag "${ace_ver}") + FetchContent_Declare(ace_tao_dl + PREFIX "${OPENDDS_BUILD_DIR}/ace_tao_tmp" + SOURCE_DIR "${OPENDDS_ACE}" + URL "${url_base}ACE+TAO-${ace_ver_tag}/ACE+TAO-src-${ace_ver}.${ext}" + URL_MD5 "${md5}" + ) + FetchContent_Populate(ace_tao_dl) + + find_package(Perl REQUIRED) + execute_process( + COMMAND + "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/configure_ace_tao.pl" + --mpc "${OPENDDS_MPC}" + --mpc-type "${mpc_type}" + --ace "${OPENDDS_ACE}" + --tao "${OPENDDS_TAO}" + ${configure_ace_tao_args} + --config-file "${config_file}" + ${_OPENDDS_MPC_FEATURES} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) + + execute_process( + COMMAND + "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/scrap_gnuace.pl" + --workspace "${OPENDDS_ACE}" + --loc-base "${OPENDDS_BUILD_DIR}" + --ace "${OPENDDS_ACE}" + --tao "${OPENDDS_TAO}" + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + OUTPUT_VARIABLE mpc_projects + ) + set(_OPENDDS_ACE_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") + set(_OPENDDS_ACE_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") + set(_OPENDDS_TAO_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") + set(_OPENDDS_TAO_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") + + string(JSON project_count LENGTH "${mpc_projects}") + if(project_count EQUAL 0) + message(FATAL_ERROR "MPC projects was empty!") + endif() + set(byproducts) + math(EXPR member_index_end "${project_count} - 1") + foreach(member_index RANGE ${member_index_end}) + string(JSON member_name MEMBER "${mpc_projects}" ${member_index}) + string(JSON mpc_project GET "${mpc_projects}" ${member_name}) + string(JSON file GET "${mpc_project}" loc) + list(APPEND byproducts "${file}") + endforeach() + + ExternalProject_Add(build_ace_tao + SOURCE_DIR "${OPENDDS_ACE}" + CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "Already configured" + BUILD_IN_SOURCE TRUE + BUILD_COMMAND + "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}" + make -j8 + BUILD_BYPRODUCTS ${byproducts} + USES_TERMINAL_BUILD TRUE # Needed for Ninja to show the ACE/TAO build + INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "No install step" + ) +endif() + +add_subdirectory(dds/DCPS) +add_subdirectory(dds/idl) + +# TODO: Move Dcps to dds/CMakeLists.txt? + +set(dcps_lib_deps + ACE::ACE + TAO::TAO + TAO::PortableServer + TAO::BiDirGIOP + TAO::Valuetype +) +find_package(OpenDDS REQUIRED NO_DEFAULTS TAO::tao_idl OpenDDS::opendds_idl ${dcps_lib_deps}) +include(opendds_build_helpers) + +add_library(OpenDDS_Dcps + dds/DCPS/BitPubListenerImpl.cpp + dds/DCPS/BuiltInTopicUtils.cpp + dds/DCPS/CoherentChangeControl.cpp + dds/DCPS/CoherentChangeControl.inl + dds/DCPS/ConditionImpl.cpp + dds/DCPS/ConfigStoreImpl.cpp + dds/DCPS/ConfigUtils.cpp + dds/DCPS/ConnectionRecords.cpp + dds/DCPS/ContentFilteredTopicImpl.cpp + dds/DCPS/DCPS_Utils.cpp + # dds/DCPS/DataCollector_T.cpp + dds/DCPS/DataCollector_T.inl + dds/DCPS/DataDurabilityCache.cpp + dds/DCPS/DataReaderImpl.cpp + dds/DCPS/DataReaderImpl.inl + dds/DCPS/DataSampleElement.cpp + dds/DCPS/DataSampleElement.inl + dds/DCPS/DataSampleHeader.cpp + dds/DCPS/DataSampleHeader.inl + dds/DCPS/DataWriterImpl.cpp + dds/DCPS/DcpsUpcalls.cpp + dds/DCPS/DdsDcps_pch.cpp + dds/DCPS/Discovery.cpp + dds/DCPS/DisjointSequence.cpp + dds/DCPS/DisjointSequence.inl + dds/DCPS/DispatchService.cpp + dds/DCPS/DomainParticipantFactoryImpl.cpp + dds/DCPS/DomainParticipantImpl.cpp + dds/DCPS/EntityImpl.cpp + dds/DCPS/EventDispatcher.cpp + dds/DCPS/FileSystemStorage.cpp + dds/DCPS/FilterEvaluator.cpp + dds/DCPS/GroupRakeData.cpp + dds/DCPS/GuardCondition.cpp + dds/DCPS/GuidBuilder.cpp + dds/DCPS/GuidBuilder.inl + dds/DCPS/GuidConverter.cpp + dds/DCPS/GuidUtils.cpp + dds/DCPS/Hash.cpp + dds/DCPS/InstanceDataSampleList.cpp + dds/DCPS/InstanceDataSampleList.inl + dds/DCPS/InstanceHandle.cpp + dds/DCPS/InstanceState.cpp + dds/DCPS/InstanceState.inl + dds/DCPS/JobQueue.cpp + dds/DCPS/LinuxNetworkConfigMonitor.cpp + dds/DCPS/LogAddr.cpp + dds/DCPS/Logging.cpp + dds/DCPS/Marked_Default_Qos.cpp + dds/DCPS/MemoryPool.cpp + dds/DCPS/MessageBlock.cpp + dds/DCPS/MessageTracker.cpp + dds/DCPS/MonitorFactory.cpp + dds/DCPS/MultiTopicDataReaderBase.cpp + # dds/DCPS/MultiTopicDataReader_T.cpp + dds/DCPS/MultiTopicImpl.cpp + dds/DCPS/MulticastManager.cpp + dds/DCPS/NetworkAddress.cpp + dds/DCPS/NetworkConfigModifier.cpp + dds/DCPS/NetworkConfigMonitor.cpp + dds/DCPS/NetworkResource.cpp + dds/DCPS/NetworkResource.inl + dds/DCPS/Observer.cpp + dds/DCPS/OwnershipManager.cpp + dds/DCPS/PeriodicEvent.cpp + dds/DCPS/PublisherImpl.cpp + dds/DCPS/Qos_Helper.cpp + dds/DCPS/Qos_Helper.inl + dds/DCPS/QueryConditionImpl.cpp + # dds/DCPS/RakeResults_T.cpp + dds/DCPS/RawDataSample.cpp + dds/DCPS/ReactorInterceptor.cpp + dds/DCPS/ReactorTask.cpp + dds/DCPS/ReactorTask.inl + dds/DCPS/ReadConditionImpl.cpp + dds/DCPS/ReceivedDataElementList.cpp + dds/DCPS/ReceivedDataElementList.inl + dds/DCPS/ReceivedDataStrategy.cpp + dds/DCPS/Recorder.cpp + dds/DCPS/RecorderImpl.cpp + dds/DCPS/Registered_Data_Types.cpp + dds/DCPS/Replayer.cpp + dds/DCPS/ReplayerImpl.cpp + dds/DCPS/RepoIdBuilder.cpp + dds/DCPS/RepoIdBuilder.inl + dds/DCPS/RepoIdConverter.cpp + dds/DCPS/RepoIdGenerator.cpp + dds/DCPS/SafetyProfilePool.cpp + dds/DCPS/SafetyProfileSequences.cpp + dds/DCPS/SafetyProfileStreams.cpp + dds/DCPS/SendStateDataSampleList.cpp + dds/DCPS/SendStateDataSampleList.inl + dds/DCPS/SequenceNumber.cpp + dds/DCPS/Serializer.cpp + dds/DCPS/Serializer.inl + dds/DCPS/ServiceEventDispatcher.cpp + dds/DCPS/Service_Participant.cpp + dds/DCPS/Service_Participant.inl + dds/DCPS/SporadicEvent.cpp + dds/DCPS/StaticDiscovery.cpp + dds/DCPS/StatusConditionImpl.cpp + dds/DCPS/SubscriberImpl.cpp + dds/DCPS/SubscriptionInstance.cpp + dds/DCPS/ThreadPool.cpp + dds/DCPS/ThreadStatusManager.cpp + dds/DCPS/TimeDuration.cpp + dds/DCPS/TimeDuration.inl + # dds/DCPS/TimePoint_T.cpp + dds/DCPS/TimePoint_T.inl + dds/DCPS/Time_Helper.cpp + dds/DCPS/Time_Helper.inl + dds/DCPS/TopicDescriptionImpl.cpp + dds/DCPS/TopicImpl.cpp + dds/DCPS/Transient_Kludge.cpp + dds/DCPS/Transient_Kludge.inl + dds/DCPS/TypeSupportImpl.cpp + dds/DCPS/ValueReader.cpp + dds/DCPS/ValueWriter.cpp + dds/DCPS/WaitSet.cpp + dds/DCPS/WriteDataContainer.cpp + dds/DCPS/WriterDataSampleList.cpp + dds/DCPS/WriterDataSampleList.inl + dds/DCPS/WriterInfo.cpp + dds/DCPS/XTypes/DynamicDataAdapter.cpp + dds/DCPS/XTypes/DynamicDataBase.cpp + dds/DCPS/XTypes/DynamicDataFactory.cpp + dds/DCPS/XTypes/DynamicDataImpl.cpp + dds/DCPS/XTypes/DynamicDataReaderImpl.cpp + dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp + dds/DCPS/XTypes/DynamicSample.cpp + dds/DCPS/XTypes/DynamicTypeImpl.cpp + dds/DCPS/XTypes/DynamicTypeMemberImpl.cpp + dds/DCPS/XTypes/DynamicTypeSupport.cpp + dds/DCPS/XTypes/MemberDescriptorImpl.cpp + dds/DCPS/XTypes/TypeAssignability.cpp + dds/DCPS/XTypes/TypeDescriptorImpl.cpp + dds/DCPS/XTypes/TypeLookupService.cpp + dds/DCPS/XTypes/TypeObject.cpp + dds/DCPS/XTypes/Utils.cpp + # dds/DCPS/ZeroCopyAllocator_T.cpp + dds/DCPS/ZeroCopyAllocator_T.inl + # dds/DCPS/ZeroCopySeq_T.cpp + dds/DCPS/ZeroCopySeq_T.inl + dds/DCPS/debug.cpp + dds/DCPS/transport/framework/BuildChainVisitor.cpp + dds/DCPS/transport/framework/BuildChainVisitor.inl + dds/DCPS/transport/framework/CopyChainVisitor.cpp + dds/DCPS/transport/framework/CopyChainVisitor.inl + dds/DCPS/transport/framework/DataLink.cpp + dds/DCPS/transport/framework/DataLink.inl + dds/DCPS/transport/framework/DataLinkCleanupTask.cpp + dds/DCPS/transport/framework/DataLinkSet.cpp + dds/DCPS/transport/framework/DataLinkSet.inl + dds/DCPS/transport/framework/DirectPriorityMapper.cpp + dds/DCPS/transport/framework/DirectPriorityMapper.inl + dds/DCPS/transport/framework/NullSynch.cpp + dds/DCPS/transport/framework/NullSynch.inl + dds/DCPS/transport/framework/NullSynchStrategy.cpp + dds/DCPS/transport/framework/PacketRemoveVisitor.cpp + dds/DCPS/transport/framework/PacketRemoveVisitor.inl + dds/DCPS/transport/framework/PerConnectionSynch.cpp + dds/DCPS/transport/framework/PerConnectionSynch.inl + dds/DCPS/transport/framework/PerConnectionSynchStrategy.cpp + dds/DCPS/transport/framework/PerConnectionSynchStrategy.inl + dds/DCPS/transport/framework/PoolSynch.cpp + dds/DCPS/transport/framework/PoolSynch.inl + dds/DCPS/transport/framework/PoolSynchStrategy.cpp + dds/DCPS/transport/framework/PoolSynchStrategy.inl + dds/DCPS/transport/framework/PriorityKey.cpp + dds/DCPS/transport/framework/PriorityKey.inl + dds/DCPS/transport/framework/PriorityMapper.cpp + dds/DCPS/transport/framework/PriorityMapper.inl + dds/DCPS/transport/framework/QueueRemoveVisitor.cpp + dds/DCPS/transport/framework/QueueRemoveVisitor.inl + dds/DCPS/transport/framework/ReactorSynch.cpp + dds/DCPS/transport/framework/ReactorSynch.inl + dds/DCPS/transport/framework/ReactorSynchStrategy.cpp + dds/DCPS/transport/framework/ReactorSynchStrategy.inl + dds/DCPS/transport/framework/ReceiveListenerSet.cpp + dds/DCPS/transport/framework/ReceiveListenerSet.inl + dds/DCPS/transport/framework/ReceiveListenerSetMap.cpp + dds/DCPS/transport/framework/ReceiveListenerSetMap.inl + dds/DCPS/transport/framework/ReceivedDataSample.cpp + dds/DCPS/transport/framework/RemoveAllVisitor.cpp + dds/DCPS/transport/framework/RemoveAllVisitor.inl + dds/DCPS/transport/framework/ScheduleOutputHandler.cpp + dds/DCPS/transport/framework/ScheduleOutputHandler.inl + dds/DCPS/transport/framework/SendResponseListener.cpp + dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.cpp + dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.inl + dds/DCPS/transport/framework/ThreadPerConnectionSendTask.cpp + dds/DCPS/transport/framework/ThreadSynch.cpp + dds/DCPS/transport/framework/ThreadSynch.inl + dds/DCPS/transport/framework/ThreadSynchResource.cpp + dds/DCPS/transport/framework/ThreadSynchResource.inl + dds/DCPS/transport/framework/ThreadSynchStrategy.cpp + dds/DCPS/transport/framework/ThreadSynchStrategy.inl + dds/DCPS/transport/framework/ThreadSynchWorker.cpp + dds/DCPS/transport/framework/ThreadSynchWorker.inl + dds/DCPS/transport/framework/TransportClient.cpp + dds/DCPS/transport/framework/TransportConfig.cpp + dds/DCPS/transport/framework/TransportControlElement.cpp + dds/DCPS/transport/framework/TransportControlElement.inl + dds/DCPS/transport/framework/TransportCustomizedElement.cpp + dds/DCPS/transport/framework/TransportCustomizedElement.inl + dds/DCPS/transport/framework/TransportDebug.cpp + dds/DCPS/transport/framework/TransportHeader.cpp + dds/DCPS/transport/framework/TransportHeader.inl + dds/DCPS/transport/framework/TransportImpl.cpp + dds/DCPS/transport/framework/TransportImpl.inl + dds/DCPS/transport/framework/TransportInst.cpp + dds/DCPS/transport/framework/TransportInst.inl + dds/DCPS/transport/framework/TransportQueueElement.cpp + dds/DCPS/transport/framework/TransportQueueElement.inl + dds/DCPS/transport/framework/TransportReassembly.cpp + dds/DCPS/transport/framework/TransportReceiveListener.cpp + dds/DCPS/transport/framework/TransportReceiveStrategy.cpp + # dds/DCPS/transport/framework/TransportReceiveStrategy_T.cpp + dds/DCPS/transport/framework/TransportReceiveStrategy_T.inl + dds/DCPS/transport/framework/TransportRegistry.cpp + dds/DCPS/transport/framework/TransportRegistry.inl + dds/DCPS/transport/framework/TransportReplacedElement.cpp + dds/DCPS/transport/framework/TransportReplacedElement.inl + dds/DCPS/transport/framework/TransportRetainedElement.cpp + dds/DCPS/transport/framework/TransportRetainedElement.inl + dds/DCPS/transport/framework/TransportSendBuffer.cpp + dds/DCPS/transport/framework/TransportSendBuffer.inl + dds/DCPS/transport/framework/TransportSendControlElement.cpp + dds/DCPS/transport/framework/TransportSendControlElement.inl + dds/DCPS/transport/framework/TransportSendElement.cpp + dds/DCPS/transport/framework/TransportSendElement.inl + dds/DCPS/transport/framework/TransportSendListener.cpp + dds/DCPS/transport/framework/TransportSendStrategy.cpp + dds/DCPS/transport/framework/TransportSendStrategy.inl + dds/DCPS/transport/framework/TransportStrategy.cpp + dds/DCPS/transport/framework/TransportType.cpp +) +_opendds_library(OpenDDS_Dcps) +target_include_directories(OpenDDS_Dcps + PUBLIC + "$" + "$" + PRIVATE + "${CMAKE_SOURCE_DIR}/dds" +) +target_link_libraries(OpenDDS_Dcps PUBLIC ${dcps_lib_deps}) + +set(opendds_target_sources_args + AUTO_LINK FALSE + USE_EXPORT "dds/DCPS/dcps_export.h" OpenDDS_Dcps_Export + INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" +) + +opendds_target_sources(OpenDDS_Dcps + PUBLIC + dds/CorbaSeq/BooleanSeq.idl + dds/CorbaSeq/CharSeq.idl + dds/CorbaSeq/DoubleSeq.idl + dds/CorbaSeq/FloatSeq.idl + dds/CorbaSeq/Int8Seq.idl + dds/CorbaSeq/LongDoubleSeq.idl + dds/CorbaSeq/LongLongSeq.idl + dds/CorbaSeq/LongSeq.idl + dds/CorbaSeq/OctetSeq.idl + dds/CorbaSeq/ShortSeq.idl + dds/CorbaSeq/StringSeq.idl + dds/CorbaSeq/UInt8Seq.idl + dds/CorbaSeq/ULongLongSeq.idl + dds/CorbaSeq/ULongSeq.idl + dds/CorbaSeq/UShortSeq.idl + dds/CorbaSeq/WCharSeq.idl + dds/CorbaSeq/WStringSeq.idl + SKIP_TAO_IDL + OPENDDS_IDL_OPTIONS -SI -Wb,tao_include_prefix=tao/ + ${opendds_target_sources_args} +) + +opendds_target_sources(OpenDDS_Dcps + PUBLIC + dds/DdsDcps.idl + dds/DdsDcpsConditionSeq.idl # TODO + dds/DdsDcpsCore.idl # TODO + dds/DdsDcpsDataReaderSeq.idl # TODO + dds/DdsDcpsDomain.idl + dds/DdsDcpsGuid.idl # TODO + dds/DdsDcpsInfoUtils.idl # TODO + dds/DdsDcpsInfrastructure.idl + dds/DdsDcpsPublication.idl + dds/DdsDcpsSubscription.idl + dds/DdsDcpsSubscriptionExt.idl + dds/DdsDcpsTopic.idl + dds/DdsDcpsTypeSupportExt.idl + dds/DdsSecurityCore.idl # TODO + dds/DdsSecurityParams.idl # TODO + dds/OpenddsDcpsExt.idl # TODO + ${opendds_target_sources_args} +) + +opendds_target_sources(OpenDDS_Dcps + PUBLIC + dds/DdsDynamicDataSeq.idl + ${opendds_target_sources_args} +) + +# valuetypes in DdsDynamicData.idl require -Scdr +# -Scdr requires -Sa whether or not the dds_suppress_anys feature is on +opendds_target_sources(OpenDDS_Dcps + PUBLIC + dds/DdsDynamicData.idl + dds/DdsDynamicTypeSupport.idl + TAO_IDL_OPTIONS -Scdr -Sa + ${opendds_target_sources_args} +) + +add_subdirectory(dds/DCPS/InfoRepoDiscovery) +add_subdirectory(dds/DCPS/RTPS) + +add_subdirectory(dds/DCPS/transport/multicast) +add_subdirectory(dds/DCPS/transport/rtps_udp) +add_subdirectory(dds/DCPS/transport/shmem) +add_subdirectory(dds/DCPS/transport/tcp) +add_subdirectory(dds/DCPS/transport/udp) + +add_subdirectory(dds/InfoRepo) + +add_subdirectory(DevGuideExamples/DCPS/Messenger) +add_subdirectory(tests/cmake/ace_tao_only) +add_subdirectory(tests/cmake/Messenger) +# add_subdirectory(tests/cmake/idl_compiler_tests) +add_subdirectory(tests/cmake/include_subdir) diff --git a/DevGuideExamples/DCPS/Messenger/CMakeLists.txt b/DevGuideExamples/DCPS/Messenger/CMakeLists.txt index 324a7534fd2..853cb2d906b 100644 --- a/DevGuideExamples/DCPS/Messenger/CMakeLists.txt +++ b/DevGuideExamples/DCPS/Messenger/CMakeLists.txt @@ -1,8 +1,9 @@ project(opendds_devguide_messenger CXX) -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.20) enable_testing() find_package(OpenDDS REQUIRED) +include(opendds_testing) # Make sure the MPC-generated headers are gone so the CMake build will use the # right ones. This is not needed in a real project. @@ -42,9 +43,5 @@ target_link_libraries(subscriber ${opendds_libs}) # Testing configure_file(run_test.pl . COPYONLY) configure_file(rtps.ini . COPYONLY) -add_test(NAME opendds_devguide_messenger_test_inforepo - COMMAND perl run_test.pl $<$>:-ExeSubDir> $ -) -add_test(NAME opendds_devguide_messenger_test_rtps - COMMAND perl run_test.pl $<$>:-ExeSubDir> $ --rtps -) +_opendds_add_test(NAME info_repo COMMAND perl run_test.pl) +_opendds_add_test(NAME rtps COMMAND perl run_test.pl --rtps) diff --git a/DevGuideExamples/DCPS/Messenger/Publisher.cpp b/DevGuideExamples/DCPS/Messenger/Publisher.cpp index d93fc72dca0..f7a2fec9124 100644 --- a/DevGuideExamples/DCPS/Messenger/Publisher.cpp +++ b/DevGuideExamples/DCPS/Messenger/Publisher.cpp @@ -1,29 +1,26 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ -#include - -#include -#include +#include "MessengerTypeSupportImpl.h" #include #include #include - +#include #include #ifdef ACE_AS_STATIC_LIBS # include # include #endif -#include "MessengerTypeSupportImpl.h" +#include +#include + +#include -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) { try { // Initialize DomainParticipantFactory diff --git a/DevGuideExamples/DCPS/Messenger/Subscriber.cpp b/DevGuideExamples/DCPS/Messenger/Subscriber.cpp index f61983b0bac..25757640fa5 100644 --- a/DevGuideExamples/DCPS/Messenger/Subscriber.cpp +++ b/DevGuideExamples/DCPS/Messenger/Subscriber.cpp @@ -1,31 +1,27 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ -#include - -#include -#include +#include "DataReaderListenerImpl.h" +#include "MessengerTypeSupportImpl.h" #include #include #include - +#include #include #ifdef ACE_AS_STATIC_LIBS # include # include #endif -#include "DataReaderListenerImpl.h" -#include "MessengerTypeSupportImpl.h" +#include +#include +#include -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) { try { // Initialize DomainParticipantFactory diff --git a/bin/PerlDDS/Run_Test.pm b/bin/PerlDDS/Run_Test.pm index ce35d58eeda..5c4b8eb4f65 100644 --- a/bin/PerlDDS/Run_Test.pm +++ b/bin/PerlDDS/Run_Test.pm @@ -34,11 +34,15 @@ sub get_executable { sub get_bin_executable { my $name = shift; - my $install_prefix_bin = ""; - if (defined($ENV{OPENDDS_INSTALL_PREFIX})) { - $install_prefix_bin = catdir($ENV{OPENDDS_INSTALL_PREFIX}, "bin"); + my $bin = catdir($ENV{DDS_ROOT}, "bin"); + if (defined($ENV{OPENDDS_BUILD_DIR})) { + $bin = catdir($ENV{OPENDDS_BUILD_DIR}, "bin"); } - return get_executable($name, catdir($ENV{DDS_ROOT}, "bin"), $install_prefix_bin); + elsif (defined($ENV{OPENDDS_INSTALL_PREFIX})) { + $bin = catdir($ENV{OPENDDS_INSTALL_PREFIX}, "bin"); + } + print("bin=$bin\n"); + return get_executable($name, $bin); } sub get_opendds_idl { diff --git a/cmake/configure_ace_tao.pl b/cmake/configure_ace_tao.pl new file mode 100755 index 00000000000..2a972013f8b --- /dev/null +++ b/cmake/configure_ace_tao.pl @@ -0,0 +1,100 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use File::Spec; +use File::Copy qw/copy/; +use Getopt::Long qw/GetOptions/; +use Config; + +use FindBin; +use lib "$FindBin::RealBin/../tools/scripts/modules"; +use command_utils; + +my @required_values = qw/ + mpc + mpc-type + ace + tao + config-file +/; +my @optional_values = qw/ + platform-macros-file +/; +my %is_value_required = map {$_ => 1} @required_values; +my %values = (); +my @opts = (); +for my $key (@required_values, @optional_values) { + $values{$key} = undef; + push(@opts, "$key=s"); +} +if (!GetOptions(\%values, @opts)) { + exit(1); +} + +my $status = 0; +for my $name (keys(%values)) { + if (defined($values{$name})) { + print("$name: $values{$name}\n"); + } + elsif ($is_value_required{$name}) { + print STDERR ("Required option --$name was not passed\n"); + $status = 1; + } +} +my $gnuace = $values{'mpc-type'} eq 'gnuace'; +if ($gnuace && !defined($values{'platform-macros-file'})) { + print STDERR ("--mpc-type gnuace requires --platform-macros-file\n"); + $status = 1; +} +exit($status) if ($status); + +sub run_command { + my $command = shift; + return command_utils::run_command( + $command, + script_name => 'configure_ace_tao', + verbose => 1, + autodie => 1, + @_, + ); +} + +my $features_path = "$values{ace}/bin/MakeProjectCreator/config/default.features"; +open(my $features_file, '>', $features_path) or die("Failed to open $features_path: $!"); +for my $feature (@ARGV) { + print("$feature\n"); + print $features_file ("$feature\n"); +} +close($features_file); + +my $config_path = "$values{ace}/ace/config.h"; +open(my $config_file, '>', $config_path) or die("Failed to open $config_path: $!"); +print $config_file ( + "#define ACE_DISABLE_MKTEMP\n" . + "#define ACE_LACKS_READDIR_R\n" . + "#include \"$values{'config-file'}\"\n"); +close($config_file); + +if ($gnuace) { + my $platform_macros_path = "$values{ace}/include/makeinclude/platform_macros.GNU"; + open(my $platform_macros_file, '>', $platform_macros_path) + or die("Failed to open $platform_macros_path: $!"); + print $platform_macros_file ( + "optimize = 0\n" . + "include \$(ACE_ROOT)/include/makeinclude/$values{'platform-macros-file'}\n"); + close($platform_macros_file); +} + +$ENV{MPC_ROOT} = File::Spec->rel2abs($values{mpc}); +$ENV{ACE_ROOT} = File::Spec->rel2abs($values{ace}); +$ENV{TAO_ROOT} = File::Spec->rel2abs($values{tao}); +my $mwc_name = 'ACE_TAO_for_OpenDDS.mwc'; +my $mwc_src = "$FindBin::RealBin/../$mwc_name"; +my $mwc = "$ENV{ACE_ROOT}/$mwc_name"; +copy($mwc_src, $mwc) or die("Failed to copy $mwc_src to $mwc: $!"); +run_command( + [$Config{perlpath}, 'bin/mwc.pl', $mwc, '-type', $values{'mpc-type'}], + chdir => $ENV{ACE_ROOT}, +); diff --git a/cmake/dds_idl_sources.cmake b/cmake/dds_idl_sources.cmake index eeaa65c30df..a46782fd9fe 100644 --- a/cmake/dds_idl_sources.cmake +++ b/cmake/dds_idl_sources.cmake @@ -116,6 +116,7 @@ function(_opendds_target_idl_sources target) SKIP_TAO_IDL SKIP_OPENDDS_IDL AUTO_INCLUDES + INCLUDE_BASE ) set(multi_value_args TAO_IDL_FLAGS DDS_IDL_FLAGS IDL_FILES) cmake_parse_arguments(arg "" "${one_value_args}" "${multi_value_args}" ${ARGN}) @@ -136,7 +137,8 @@ function(_opendds_target_idl_sources target) get_property(generated_dependencies SOURCE ${idl_file} PROPERTY OPENDDS_IDL_GENERATED_DEPENDENCIES SET) - if(generated_dependencies) + # TODO Fix this + if(generated_dependencies AND FALSE) # If an IDL-Generation command was already created this file can safely be # skipped; however, the dependencies still need to be added to the target. _opendds_target_generated_dependencies(${target} ${idl_file} ${arg_SCOPE}) @@ -245,7 +247,7 @@ function(_opendds_target_idl_sources target) set(h_files) set(cpp_files) set(run_tao_idl_on_input FALSE) - set(file_auto_includes) + set(file_auto_includes "${gen_out}") set(file_mappings) set(tao_idl_opts ${arg_TAO_IDL_FLAGS}) set(generated_files) @@ -258,8 +260,11 @@ function(_opendds_target_idl_sources target) endif() else() _opendds_get_generated_idl_output( - ${target} "${input}" "${opendds_idl_opt_-o}" output_prefix output_dir) - list(APPEND file_auto_includes "${output_dir}") + ${target} "${arg_INCLUDE_BASE}" "${input}" "${opendds_idl_opt_-o}" output_prefix output_dir) + _opendds_get_generated_output_dir(${target} file_auto_includes) + if(arg_INCLUDE_BASE) + list(APPEND file_auto_includes "${arg_INCLUDE_BASE}") + endif() if(NOT opendds_idl_opt_-SI) set(type_support_idl_file "${output_prefix}TypeSupport.idl") @@ -335,6 +340,7 @@ function(_opendds_target_idl_sources target) _opendds_tao_idl(${target} IDL_FLAGS ${tao_idl_opts} IDL_FILES ${idl_files} + INCLUDE_BASE "${include_base}" AUTO_INCLUDES tao_idl_auto_includes ) list(APPEND file_auto_includes "${tao_idl_auto_includes}") diff --git a/cmake/detect_ace.cpp b/cmake/detect_ace.cpp new file mode 100644 index 00000000000..d0e0406a665 --- /dev/null +++ b/cmake/detect_ace.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include + +int main(int argc, char**) +{ + // Output value to match to https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html + // As of writing these values aren't documented, see + // https://gitlab.kitware.com/cmake/cmake/-/issues/21489 + printf("CMAKE_SYSTEM_NAME=%s\n", +#if defined ACE_LINUX + "Linux" +#elif defined ACE_WIN32 + "Windows" +#elif defined ACE_HAS_MAC_OSX + "Darwin" +#else + "unknown" +#endif + ); + + printf("ACE_VERSION=%s\n", ACE_VERSION); + + return 0; +} diff --git a/cmake/detect_ace.pl b/cmake/detect_ace.pl new file mode 100644 index 00000000000..7c3b4b05562 --- /dev/null +++ b/cmake/detect_ace.pl @@ -0,0 +1,142 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my $ace_root = shift(); + +sub whack_to_slash { + my $s = shift; + $s =~ s|\\|/|g; + return $s; +} + +sub to_cmake_scalar { + my $val = shift; + return 'ON' if "$val" eq '1'; + return 'OFF' if "$val" eq '0'; + return '"' . whack_to_slash($val) . '"'; +} + +sub to_cmake_list { + my @list = @{$_[0]}; + return '"' . join(';', map {whack_to_slash($_)} @list) . '"'; +} + +sub to_cmake_value { + my $value = shift(); + + my $ref_type = ref($value); + if ($ref_type eq 'ARRAY') { + return to_cmake_list($value); + } + elsif ($ref_type eq '') { + return to_cmake_scalar($value); + } + else { + die "ERROR: to_cmake_value invalid value type, stopped"; + } +} + +my %features; +my $file = "$ace_root/bin/MakeProjectCreator/config/default.features"; +open(my $fh, '<', $file) or die "ERROR: Could not open $file: $!"; +while (my $row = <$fh>) { + chomp $row; + $row =~ s/\/\/.*//; + $row =~ s/^\s+//; + $row =~ s/\s+$//; + next if $row eq ''; + my ($key, $value) = split(/\s*=\s*/, $row); + $features{$key} = $value; +} + +for my $f (@ARGV) { + my ($key, $value) = split(/=/, $f); + $value = "1" unless defined $value; + $features{$key} = $value; +} + +my @configs = ( + { + name => 'CXX11', + feature => 'no_cxx11', + inverted => 1, + }, + { + name => 'WCHAR', + feature => 'uses_wchar', + }, + { + name => 'IPV6', + feature => 'ipv6', + }, + { + name => 'SAFETY_PROFILE', + feature => 'no_opendds_safety_profile', + inverted => 1, + }, + { + name => 'VERSIONED_NAMESPACE', + feature => 'versioned_namespace', + }, + { + name => 'SUPPRESS_ANYS', + feature => 'dds_suppress_anys', + default => 1, + }, + { + name => 'COVERAGE', + feature => 'dds_non_coverage', + inverted => 1, + }, + { + name => 'TAO_CORBA_E_COMPACT', + feature => 'corba_e_compact', + }, + { + name => 'TAO_CORBA_E_MICRO', + feature => 'corba_e_micro', + }, + { + name => 'TAO_MINIMUM_CORBA', + feature => 'minimum_corba', + }, + { + name => 'TAO_IIOP', + feature => 'tao_no_iiop', + inverted => 1, + default => 1, + }, + { + name => 'TAO_GEN_OSTREAM', + feature => 'gen_ostream', + }, + { + name => 'TAO_OPTIMIZE_COLLOCATED_INVOCATIONS', + feature => 'optimize_collocated_invocations', + default => 1, + }, + # { + # name => 'XERCES', + # feature => 'xerces3', + # }, +); + +my @cmake_values; +for my $config (@configs) { + my $name = $config->{name}; + $name = uc("OPENDDS_$name"); + $name =~ s/-/_/g; + my $inverted = $config->{inverted} // 0; + my $default = $config->{default} // 0; + my $enabled; + if (exists($features{$config->{feature}})) { + $enabled = $features{$config->{feature}} eq "1" ? !$inverted : $inverted; + } + else { + $enabled = $default; + } + push(@cmake_values, "$name=" . to_cmake_value($enabled) . "\n"); +} +print(join(';', @cmake_values), "\n"); diff --git a/cmake/import_common.cmake b/cmake/import_common.cmake index ec58673f2dd..5c2c13aeb72 100644 --- a/cmake/import_common.cmake +++ b/cmake/import_common.cmake @@ -96,6 +96,20 @@ function(_opendds_group_exe name) set("${prefix}_BIN_DIRS" "${bin_dirs}" PARENT_SCOPE) endfunction() +function(_opendds_find_in_mpc_projects found_var path_var mpc_projects mpc_name) + string(JSON mpc_project ERROR_VARIABLE err GET "${mpc_projects}" "${mpc_name}") + if(NOT mpc_project) + set(${found_var} FALSE CACHE INTERNAL "" FORCE) + if(debug) + message(STATUS "lib ${target} (${mpc_name}) not in MPC projects") + endif() + return() + endif() + string(JSON path GET "${mpc_project}" "loc") + set(${path_var} "${path}" CACHE FILEPATH "" FORCE) + set(${found_var} TRUE CACHE INTERNAL "" FORCE) +endfunction() + function(_opendds_get_lib_filename filename_var group_name short_name) if(short_name STREQUAL "${group_name}") set(filename "${short_name}") @@ -152,6 +166,20 @@ function(_opendds_find_our_libraries_for_config group libs config suffix) continue() endif() + set(mpc_projects_var "${group_prefix}_MPC_PROJECTS") + if(DEFINED "${mpc_projects_var}") + _opendds_find_in_mpc_projects( + "${found_var}" "${lib_var}" "${${mpc_projects_var}}" "${${lib_prefix}_MPC_NAME}") + if(${${found_var}}) + if(debug) + message(STATUS "${config} lib ${target} assumed: ${${lib_var}}") + elseif(OPENDDS_CMAKE_VERBOSE) + message(STATUS "${config} lib ${target} assumed") + endif() + endif() + continue() + endif() + find_library(${lib_var} "${lib_file_base}" HINTS "${lib_dir}") if(${lib_var}) set(${found_var} TRUE CACHE INTERNAL "" FORCE) @@ -210,7 +238,20 @@ function(_opendds_find_executables group exes) continue() endif() - find_program("${var}" NAMES "${exe}" HINTS ${${var}_BIN_DIRS}) + set(mpc_projects_var "${group_prefix}_MPC_PROJECTS") + if(DEFINED "${mpc_projects_var}") + _opendds_find_in_mpc_projects( + "${found_var}" "${var}" "${${mpc_projects_var}}" "${${var}_MPC_NAME}") + if(${${found_var}}) + if(debug) + message(STATUS "${config} exe ${target} assumed: ${${var}}") + elseif(OPENDDS_CMAKE_VERBOSE) + message(STATUS "${config} exe ${target} assumed") + endif() + endif() + else() + find_program("${var}" NAMES "${exe}" HINTS ${${var}_BIN_DIRS}) + endif() endforeach() endfunction() @@ -261,7 +302,8 @@ function(_opendds_import_group_targets group libs exes) macro(add_target_library_config target var_prefix config) set(lib_var "${var_prefix}_LIBRARY_${config}") set(lib_file "${${lib_var}}") - if(EXISTS "${lib_file}") + set(mpc_projects_var "${group_prefix}_MPC_PROJECTS") + if(EXISTS "${lib_file}" OR DEFINED "${mpc_projects_var}") set_property(TARGET ${target} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${config} @@ -312,6 +354,11 @@ function(_opendds_import_group_targets group libs exes) INTERFACE_COMPILE_OPTIONS "${${var_prefix}_COMPILE_OPTIONS}" ) + set(mpc_ext_proj_var "${group_prefix}_MPC_EXTERNAL_PROJECT") + if(DEFINED "${mpc_ext_proj_var}") + add_dependencies(${target} "${${mpc_ext_proj_var}}") + endif() + add_target_library_config(${target} ${var_prefix} "RELEASE") add_target_library_config(${target} ${var_prefix} "DEBUG") endif() @@ -346,6 +393,10 @@ function(_opendds_import_group_targets group libs exes) PROPERTIES IMPORTED_LOCATION "${path}" ) + set(mpc_ext_proj_var "${group_prefix}_MPC_EXTERNAL_PROJECT") + if(DEFINED "${mpc_ext_proj_var}") + add_dependencies(${target} "${${mpc_ext_proj_var}}") + endif() if(imports IN_LIST OPENDDS_CMAKE_VERBOSE) message(STATUS "exe ${target}: ${path}") elseif(OPENDDS_CMAKE_VERBOSE) diff --git a/cmake/init.cmake b/cmake/init.cmake index 1bd8cef1f13..abe97b02d04 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -15,36 +15,84 @@ endif() find_package(Perl) -include("${CMAKE_CURRENT_LIST_DIR}/config.cmake") - -set(_OPENDDS_ALL_FEATURES) -function(_opendds_feature name default_value) - string(TOLOWER "${name}" lowercase_name) - set(_OPENDDS_ALL_FEATURES ${_OPENDDS_ALL_FEATURES} "${lowercase_name}" PARENT_SCOPE) - set(name "OPENDDS_${name}") - if(NOT DEFINED "${name}") - set("${name}" "${default_value}" PARENT_SCOPE) +function(_opendds_detect_ace) + if(_OPENDDS_DETECTED_ACE) + return() + endif() + set(_OPENDDS_DETECTED_ACE TRUE CACHE INTERNAL "") + + try_run(run_result compile_result + SOURCES "${CMAKE_CURRENT_LIST_DIR}/detect_ace.cpp" + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${OPENDDS_ACE}" + RUN_OUTPUT_STDOUT_VARIABLE detect_ace_output) + if(OPENDDS_CMAKE_VERBOSE) + message(STATUS "detect_ace_output: ${detect_ace_output}") + endif() + + if(detect_ace_output MATCHES "CMAKE_SYSTEM_NAME=([^\n]+)\n") + set(ace_system_name "${CMAKE_MATCH_1}") + if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${ace_system_name}") + message(FATAL_ERROR + "ace_system_name is \"${ace_system_name}\" is not the same as " + "CMAKE_SYSTEM_NAME \"${CMAKE_SYSTEM_NAME}\"") + endif() + else() + message(FATAL_ERROR "Couldn't get OS name from detect_ace output: ${detect_ace_output}") endif() + + if(detect_ace_output MATCHES "ACE_VERSION=([^\n]+)\n") + message("ACE_VERSION: ${CMAKE_MATCH_1}") + else() + message(FATAL_ERROR "Couldn't get ACE version from detect_ace output: ${detect_ace_output}") + endif() + + execute_process( + COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/detect_ace.pl" "${OPENDDS_ACE}" + RESULT_VARIABLE run_result + OUTPUT_VARIABLE config_text + ) + foreach(name_value ${config_text}) + if(name_value MATCHES "([^=]+)=([^\n]+)") + set(name "${CMAKE_MATCH_1}") + set(value "${CMAKE_MATCH_2}") + if(NOT DEFINED "${name}") + message("${name}=${value}") + set("${name}" "${value}" CACHE INTERNAL "") + endif() + endif() + endforeach() endfunction() -_opendds_feature(DEBUG ON) -_opendds_feature(INLINE ON) -_opendds_feature(STATIC OFF) -_opendds_feature(TAO_IIOP ON) -_opendds_feature(TAO_OPTIMIZE_COLLOCATED_INVOCATIONS ON) -_opendds_feature(BUILT_IN_TOPICS ON) -_opendds_feature(OBJECT_MODEL_PROFILE ON) -_opendds_feature(PERSISTENCE_PROFILE ON) -_opendds_feature(OWNERSHIP_PROFILE ON) -_opendds_feature(OWNERSHIP_KIND_EXCLUSIVE ${OPENDDS_OWNERSHIP_PROFILE}) -_opendds_feature(CONTENT_SUBSCRIPTION ON) -_opendds_feature(CONTENT_FILTERED_TOPIC ${OPENDDS_CONTENT_SUBSCRIPTION}) -_opendds_feature(MULTI_TOPIC ${OPENDDS_CONTENT_SUBSCRIPTION}) -_opendds_feature(QUERY_CONDITION ${OPENDDS_CONTENT_SUBSCRIPTION}) -_opendds_feature(SUPPRESS_ANYS ON) -_opendds_feature(SECURITY OFF) -_opendds_feature(XERCES3 ${OPENDDS_SECURITY}) -_opendds_feature(SAFETY_PROFILE OFF) +include("${CMAKE_CURRENT_LIST_DIR}/config.cmake" OPTIONAL RESULT_VARIABLE OPENDDS_CONFIG_CMAKE) +if(NOT OPENDDS_CONFIG_CMAKE AND NOT ACE_IS_BEING_BUILT) + if(DEFINED OPENDDS_ACE) + if(NOT EXISTS "${OPENDDS_ACE}") + message(FATAL_ERROR "OPENDDS_ACE does not exist") + endif() + else() + message(FATAL_ERROR "OPENDDS_ACE must be defined") + endif() + get_filename_component(OPENDDS_ACE "${OPENDDS_ACE}" ABSOLUTE) + if(DEFINED OPENDDS_TAO) + if(NOT EXISTS "${OPENDDS_TAO}") + message(FATAL_ERROR "OPENDDS_TAO does not exist") + endif() + else() + if(EXISTS "${OPENDDS_ACE}/TAO") + set(OPENDDS_TAO "${OPENDDS_ACE}/TAO") + elseif(EXISTS "${OPENDDS_ACE}/../TAO") + set(OPENDDS_TAO "${OPENDDS_ACE}/../TAO") + else() + message(FATAL_ERROR + "OPENDDS_TAO not relative to OPENDDS_ACE, so OPENDDS_TAO must be defined") + endif() + endif() + get_filename_component(OPENDDS_TAO "${OPENDDS_TAO}" ABSOLUTE) + + _opendds_detect_ace() +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/opendds_features.cmake") # Make Sure CMake can use the Paths file(TO_CMAKE_PATH "${OPENDDS_ACE}" OPENDDS_ACE) @@ -124,8 +172,10 @@ if(NOT DEFINED DDS_ROOT) set(OPENDDS_INCLUDE_DIRS "${OPENDDS_ROOT}") endif() - set(OPENDDS_BIN_DIR "${OPENDDS_ROOT}/bin") - set(OPENDDS_LIB_DIR "${OPENDDS_ROOT}/${OPENDDS_INSTALL_LIB}") + if(NOT OPENDDS_IS_BEING_BUILT) + set(OPENDDS_BIN_DIR "${OPENDDS_ROOT}/bin") + set(OPENDDS_LIB_DIR "${OPENDDS_ROOT}/${OPENDDS_INSTALL_LIB}") + endif() endif() if(NOT DEFINED ACE_ROOT) diff --git a/cmake/opendds_build_helpers.cmake b/cmake/opendds_build_helpers.cmake new file mode 100644 index 00000000000..74203845188 --- /dev/null +++ b/cmake/opendds_build_helpers.cmake @@ -0,0 +1,67 @@ +function(_opendds_alias target) + # This is the name the target should be exported from CMake-build OpenDDS as + # or imported in the MPC-built OpenDDS CMake package. For consistency and + # convenience, alias it so we can use it within the OpenDDS CMake build. + string(REPLACE "OpenDDS_" "" user_name "${target}") + set(user_name "OpenDDS::${user_name}") + get_target_property(target_type ${target} TYPE) + if(target_type MATCHES "LIBRARY") + add_library("${user_name}" ALIAS "${target}") + else() + add_executable("${user_name}" ALIAS "${target}") + endif() +endfunction() + +function(_opendds_library target) + _opendds_alias(${target}) + + # Put library in BINARY_DIR/lib + set_target_properties(${target} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${OPENDDS_LIB_DIR}" + LIBRARY_OUTPUT_DIRECTORY "${OPENDDS_LIB_DIR}" + ARCHIVE_OUTPUT_DIRECTORY "${OPENDDS_LIB_DIR}" + ) + + get_target_property(target_type ${target} TYPE) + string(TOUPPER "${target}" uppercase_target) + if(target_type STREQUAL "SHARED_LIBRARY") + # Define macro for export header + target_compile_definitions(${target} PRIVATE "${uppercase_target}_BUILD_DLL") + elseif(target_type STREQUAL "STATIC_LIBRARY") + # Define macro for dds/DCPS/InitStaticLibs.h and other files + string(REPLACE "OPENDDS_" "" short_uppercase_target "${uppercase_target}") + target_compile_definitions(${target} PUBLIC "OPENDDS_${short_uppercase_target}_HAS_DLL=0") + else() + message(FATAL_ERROR "Target ${target} has unexpected type ${target_type}") + endif() + + set(exec_perms + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_WRITE GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + # TODO: Export Targets + install(TARGETS ${target} + LIBRARY + DESTINATION lib + PERMISSIONS ${exec_perms} + RUNTIME + DESTINATION lib + PERMISSIONS ${exec_perms} + ARCHIVE DESTINATION lib + ) +endfunction() + +function(_opendds_executable target) + _opendds_alias(${target}) + set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OPENDDS_BIN_DIR}") + + set(exec_perms + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_WRITE GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + install(TARGETS ${target} + RUNTIME + DESTINATION bin + PERMISSIONS ${exec_perms} + ) +endfunction() diff --git a/cmake/opendds_features.cmake b/cmake/opendds_features.cmake new file mode 100644 index 00000000000..76f5aa2b040 --- /dev/null +++ b/cmake/opendds_features.cmake @@ -0,0 +1,65 @@ +if(DEFINED _OPENDDS_ALL_FEATURES) + return() +endif() + +set(_OPENDDS_ALL_FEATURES) +set(_OPENDDS_MPC_FEATURES) +function(_opendds_feature name default_value) + set(no_value_options MPC MPC_INVERTED) + set(single_value_options MPC_NAME) + set(multi_value_options) + cmake_parse_arguments(arg + "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) + + string(TOLOWER "${name}" lowercase_name) + set(name "OPENDDS_${name}") + if(NOT DEFINED "${name}") + set("${name}" "${default_value}" CACHE INTERNAL "") + endif() + list(APPEND _OPENDDS_ALL_FEATURES "${lowercase_name}") + if(arg_MPC OR arg_MPC_INVERTED) + if(NOT DEFINED arg_MPC_NAME) + set(arg_MPC_NAME "${lowercase_name}") + endif() + if(arg_MPC_INVERTED) + set(mpc_true 0) + set(mpc_false 1) + else() + set(mpc_true 1) + set(mpc_false 0) + endif() + if(${${name}}) + set(mpc_feature "${arg_MPC_NAME}=${mpc_true}") + else() + set(mpc_feature "${arg_MPC_NAME}=${mpc_false}") + endif() + list(APPEND _OPENDDS_MPC_FEATURES "${mpc_feature}") + endif() + + set(_OPENDDS_ALL_FEATURES "${_OPENDDS_ALL_FEATURES}" CACHE INTERNAL "" FORCE) + set(_OPENDDS_MPC_FEATURES "${_OPENDDS_MPC_FEATURES}" CACHE INTERNAL "" FORCE) +endfunction() + +# OpenDDS Features +_opendds_feature(BUILT_IN_TOPICS ON) +_opendds_feature(OBJECT_MODEL_PROFILE ON) +_opendds_feature(PERSISTENCE_PROFILE ON) +_opendds_feature(OWNERSHIP_PROFILE ON) +_opendds_feature(OWNERSHIP_KIND_EXCLUSIVE ${OPENDDS_OWNERSHIP_PROFILE}) +_opendds_feature(CONTENT_SUBSCRIPTION ON) +_opendds_feature(CONTENT_FILTERED_TOPIC ${OPENDDS_CONTENT_SUBSCRIPTION}) +_opendds_feature(MULTI_TOPIC ${OPENDDS_CONTENT_SUBSCRIPTION}) +_opendds_feature(QUERY_CONDITION ${OPENDDS_CONTENT_SUBSCRIPTION}) +_opendds_feature(SUPPRESS_ANYS ON) +_opendds_feature(SECURITY OFF) +_opendds_feature(SAFETY_PROFILE OFF) + +# ACE Features +_opendds_feature(DEBUG ON MPC) +_opendds_feature(INLINE ON MPC) +_opendds_feature(STATIC OFF MPC) +_opendds_feature(XERCES3 ${OPENDDS_SECURITY} MPC) + +# TAO Features +_opendds_feature(TAO_IIOP ON MPC_INVERTED MPC_NAME tao_no_iiop) +_opendds_feature(TAO_OPTIMIZE_COLLOCATED_INVOCATIONS ON MPC) diff --git a/cmake/opendds_target_sources.cmake b/cmake/opendds_target_sources.cmake index daf651007cf..8fc33147a99 100644 --- a/cmake/opendds_target_sources.cmake +++ b/cmake/opendds_target_sources.cmake @@ -19,6 +19,7 @@ function(_opendds_get_sources_and_options always_generate_lib_export_header generate_server_skeletons auto_link + include_base skip_tao_idl skip_opendds_idl) set(no_value_options @@ -30,6 +31,7 @@ function(_opendds_get_sources_and_options ALWAYS_GENERATE_LIB_EXPORT_HEADER GENERATE_SERVER_SKELETONS AUTO_LINK + INCLUDE_BASE ) set(multi_value_options PUBLIC PRIVATE INTERFACE @@ -110,6 +112,27 @@ function(_opendds_get_sources_and_options set(${non_idl_prefix}_${scope} "${non_idl_sources_${scope}}" PARENT_SCOPE) endforeach() + if(OPENDDS_FILENAME_ONLY_INCLUDES) + message(DEPRECATION "OPENDDS_FILENAME_ONLY_INCLUDES is deprecated, use INCLUDE_BASE instead.") + else() + if(DEFINED arg_INCLUDE_BASE) + set("${include_base}" "${arg_INCLUDE_BASE}" PARENT_SCOPE) + else() + set(dirs) + foreach(idl_file ${all_idl_files}) + get_filename_component(idl_file "${idl_file}" REALPATH) + get_filename_component(dir "${idl_file}" DIRECTORY) + list(APPEND dirs "${dir}") + endforeach() + list(REMOVE_DUPLICATES dirs) + list(LENGTH dirs dirs_count) + if(dirs_count GREATER 1) + message(WARNING "Passing IDL files from different directories, " + "but isn't using INCLUDE_BASE.") + endif() + endif() + endif() + set(extra_tao_idl_options) set(extra_opendds_idl_options) if(OPENDDS_FILENAME_ONLY_INCLUDES) @@ -154,6 +177,7 @@ endfunction() function(opendds_export_header target) set(no_value_options) set(single_value_options + INCLUDE_BASE USE_EXPORT_VAR ) set(multi_value_options) @@ -170,7 +194,7 @@ function(opendds_export_header target) return() endif() - _opendds_get_generated_file_path(${target} "${target}_export.h" export_header) + _opendds_get_generated_file_path(${target} "${arg_INCLUDE_BASE}" "${target}_export.h" export_header) string(TOUPPER "${target}" uppercase_target) if(NOT EXISTS ${output_file}) @@ -214,6 +238,7 @@ function(opendds_target_sources target) always_generate_lib_export_header generate_server_skeletons auto_link + include_base skip_tao_idl skip_opendds_idl ${ARGN}) @@ -230,7 +255,7 @@ function(opendds_target_sources target) if(target_type STREQUAL "SHARED_LIBRARY" OR (always_generate_lib_export_header AND target_type MATCHES "LIBRARY")) if(NOT use_export) - opendds_export_header(${target} USE_EXPORT_VAR use_export) + opendds_export_header(${target} USE_EXPORT_VAR use_export INCLUDE_BASE "${include_base}") endif() list(GET use_export 0 export_header) list(GET use_export 1 export_macro) @@ -286,6 +311,7 @@ function(opendds_target_sources target) SKIP_OPENDDS_IDL ${skip_opendds_idl} IDL_FILES ${idl_sources_${scope}} SCOPE ${scope} + INCLUDE_BASE "${include_base}" AUTO_INCLUDES auto_includes) list(APPEND includes ${auto_includes}) endif() diff --git a/cmake/opendds_testing.cmake b/cmake/opendds_testing.cmake new file mode 100644 index 00000000000..f0f9742c643 --- /dev/null +++ b/cmake/opendds_testing.cmake @@ -0,0 +1,23 @@ +function(_opendds_add_test) + set(no_value_options) + set(single_value_options NAME) + set(multi_value_options) + cmake_parse_arguments(arg + "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) + + set(test_name "${PROJECT_NAME}_test") + if(arg_NAME) + set(test_name "${test_name}_${arg_NAME}") + endif() + add_test(NAME "${test_name}" ${arg_UNPARSED_ARGUMENTS}) + set(env "ACE_ROOT=${ACE_ROOT}" "TAO_ROOT=${TAO_ROOT}") + if(DEFINED OPENDDS_BUILD_DIR) + list(APPEND env "OPENDDS_BUILD_DIR=${OPENDDS_BUILD_DIR}") + endif() + if(DEFINED OPENDDS_SOURCE_ROOT) + list(APPEND env "PERL5LIB=${OPENDDS_SOURCE_ROOT}/bin:${ACE_ROOT}/bin") + endif() + if(env) + set_property(TEST "${test_name}" PROPERTY ENVIRONMENT "${env}") + endif() +endfunction() diff --git a/cmake/scrap_gnuace.pl b/cmake/scrap_gnuace.pl new file mode 100755 index 00000000000..fe99cef556c --- /dev/null +++ b/cmake/scrap_gnuace.pl @@ -0,0 +1,131 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use File::Spec; +use Cwd qw/realpath/; +use JSON::PP; +use Getopt::Long qw/GetOptions/; + +my @required_values = qw/ + workspace + loc-base + ace + tao +/; +my @optional_values = qw/ +/; +my %is_value_required = map {$_ => 1} @required_values; +my %values = (); +my @opts = (); +for my $key (@required_values, @optional_values) { + $values{$key} = undef; + push(@opts, "$key=s"); +} +if (!GetOptions(\%values, @opts)) { + exit(1); +} + +my $status = 0; +for my $name (keys(%values)) { + if (!defined($values{$name}) && $is_value_required{$name}) { + print STDERR ("Required option --$name was not passed\n"); + $status = 1; + } + $values{$name} = realpath($values{$name}); +} +exit($status) if ($status); + +my $make = 'make'; +my $gnumf = 'GNUmakefile'; + +sub get_projects { + my %projects; + open(my $fh, '-|', "$make -f $gnumf project_name_list") or die("get_projects make: $!"); + while (my $project = <$fh>) { + $project =~ s/\s//; + my $mf = "$gnumf.$project"; + $mf =~ s/-target$//; + # print("$project $mf\n"); + @projects{$project} = { + name => $project, + mf => $mf, + deps => undef, + dir => undef, + loc => undef, + }; + } + return \%projects; +} + +sub scrap_makefile { + my $mf = shift(); + my $projects = shift(); + my $project = shift(); + + my $is_workspace = !defined($project); + + open(my $fh, '-|', "$make -npRrq -f $mf : 2>/dev/null") or die("$!"); + while (my $line = <$fh>) { + $line =~ s/\s$//; + # print("$line\n"); + if ($is_workspace) { + # Looking for lines like: + # SmartProxies: ACE TAO_IDL_EXE TAO Codeset + # $(KEEP_GOING)@cd tao/SmartProxies && $(MAKE) -f GNUmakefile.SmartProxies all + # Or: + # TAO: TAO_Core_idl + # $(KEEP_GOING)@$(MAKE) -f GNUmakefile.TAO all + if ($line =~ /^([\w-]+):(?: (.+))?$/) { + die("Unexpected rule on line $.") if (defined($project)); + if (exists($projects->{$1})) { + $project = $projects->{$1}; + my @deps; + if (defined($2)) { + @deps = split(/ /, $2); + } + $project->{deps} = \@deps; + } + } + elsif (defined($project)) { + if ($line =~ /@(?:cd (.+) && )?\$\(MAKE\) -f $project->{mf}/) { + die("Unexpected makefile on line $.") if (defined($project->{dir})); + my $dir = $1 // '.'; + $project->{dir} = realpath($dir); + } + elsif (length($line) == 0) { + die("Unexpected blank line on line $.") if (!defined($project->{dir})); + $project = undef; + } + } + } + elsif ($line =~ /^build.local:(?: (.+))?$/) { + if (!defined($1)) { + # Remove without a build.local + delete($projects->{$project->{name}}); + return; + } + $project->{loc} = File::Spec->abs2rel("$project->{dir}/$1", $values{'loc-base'}); + } + } +} + +$ENV{ACE_ROOT} = $values{ace}; +$ENV{TAO_ROOT} = $values{tao}; + +chdir($values{workspace}); +my $projects = get_projects(); +scrap_makefile($gnumf, $projects); +for my $project (values(%{$projects})) { + die("$project->{name} is missing dir") if (!defined($project->{dir})); + chdir($project->{dir}) or die("Couldn't cd for $project->{name} to $project->{dir}: $!"); + scrap_makefile("$project->{mf}", $projects, $project); +} + +# Remove deps without a build.local removed above +for my $project (values(%{$projects})) { + my @deps = grep { exists($projects->{$_}) } @{$project->{deps}}; + $project->{deps} = \@deps; +} +print(JSON::PP->new->pretty(0)->utf8->encode($projects)); diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index 42ca61790ad..eb11398f672 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -25,7 +25,7 @@ function(_opendds_get_generated_output_dir target output_dir_var) set(${output_dir_var} "${CMAKE_CURRENT_BINARY_DIR}/opendds_generated" PARENT_SCOPE) endfunction() -function(_opendds_ensure_generated_output_dir target file o_arg output_dir_var) +function(_opendds_ensure_generated_output_dir target include_base file o_arg output_dir_var) get_filename_component(abs_file "${file}" ABSOLUTE) get_filename_component(abs_dir "${abs_file}" DIRECTORY) _opendds_get_generated_output_dir("${target}" output_dir) @@ -35,27 +35,49 @@ function(_opendds_ensure_generated_output_dir target file o_arg output_dir_var) else() set(output_dir "${output_dir}/${o_arg}") endif() + elseif(include_base AND NOT OPENDDS_FILENAME_ONLY_INCLUDES) + get_filename_component(output_dir "${output_dir}" REALPATH) + get_filename_component(real_abs_file "${abs_file}" REALPATH) + get_filename_component(real_include_base "${include_base}" REALPATH) + file(RELATIVE_PATH rel_to_output "${output_dir}" "${real_abs_file}") + if(rel_to_output MATCHES "^\\.\\.") + # This should be an IDL file that is relative to include_base. + file(RELATIVE_PATH rel_file "${real_include_base}" "${real_abs_file}") + else() + # This should be our own generated IDL file that is relative to + # opendds_generated. + file(RELATIVE_PATH rel_file "${output_dir}" "${real_abs_file}") + endif() + get_filename_component(rel_dir "${rel_file}" DIRECTORY) + if(rel_file MATCHES "^\\.\\.") + message(WARNING "THIS IS WRONG: ${rel_file}") + endif() + if(rel_dir) + set(output_dir "${output_dir}/${rel_dir}") + endif() endif() file(MAKE_DIRECTORY "${output_dir}") set(${output_dir_var} "${output_dir}" PARENT_SCOPE) endfunction() -function(_opendds_get_generated_file_path target file output_path_var) - _opendds_ensure_generated_output_dir(${target} ${file} "" output_dir) +function(_opendds_get_generated_file_path target include_base file output_path_var) + _opendds_ensure_generated_output_dir(${target} "${include_base}" "${file}" "" output_dir) get_filename_component(filename ${file} NAME) set(${output_path_var} "${output_dir}/${filename}" PARENT_SCOPE) endfunction() -function(_opendds_get_generated_idl_output target idl_file o_arg output_prefix_var output_dir_var) - _opendds_ensure_generated_output_dir(${target} ${idl_file} "${o_arg}" output_dir) +function(_opendds_get_generated_idl_output + target include_base idl_file o_arg output_prefix_var output_dir_var) + _opendds_ensure_generated_output_dir(${target} "${include_base}" "${idl_file}" "${o_arg}" output_dir) get_filename_component(idl_filename_no_ext ${idl_file} NAME_WE) set(${output_prefix_var} "${output_dir}/${idl_filename_no_ext}" PARENT_SCOPE) set(${output_dir_var} "${output_dir}" PARENT_SCOPE) endfunction() function(_opendds_tao_idl target) + set(one_value_args AUTO_INCLUDES INCLUDE_BASE) set(multi_value_args IDL_FLAGS IDL_FILES) - cmake_parse_arguments(arg "" "AUTO_INCLUDES" "${multi_value_args}" ${ARGN}) + cmake_parse_arguments(arg "" "${one_value_args}" "${multi_value_args}" ${ARGN}) if(NOT arg_IDL_FILES) message(FATAL_ERROR "called _opendds_tao_idl(${target}) without specifying IDL_FILES") @@ -103,15 +125,20 @@ function(_opendds_tao_idl target) list(APPEND feature_flags -Sp -Sd) endif() + if(arg_INCLUDE_BASE) + list(APPEND converted_flags "-I${arg_INCLUDE_BASE}") + list(APPEND auto_includes "${arg_INCLUDE_BASE}") + endif() + foreach(idl_file ${arg_IDL_FILES}) set(added_output_args) _opendds_get_generated_idl_output( - ${target} ${idl_file} "${idl_cmd_arg_-o}" output_prefix output_dir) + ${target} "${arg_INCLUDE_BASE}" "${idl_file}" "${idl_cmd_arg_-o}" output_prefix output_dir) list(APPEND auto_includes "${output_dir}") list(APPEND added_output_args "-o" "${output_dir}") if(idl_cmd_arg_-oS) _opendds_get_generated_idl_output( - ${target} ${idl_file} "${idl_cmd_arg_-oS}" skel_output_prefix skel_output_dir) + ${target} "${arg_INCLUDE_BASE}" ${idl_file} "${idl_cmd_arg_-oS}" skel_output_prefix skel_output_dir) list(APPEND auto_includes "${skel_output_dir}") list(APPEND added_output_args "-oS" "${skel_output_dir}") else() @@ -119,7 +146,7 @@ function(_opendds_tao_idl target) endif() if(idl_cmd_arg_-oA) _opendds_get_generated_idl_output( - ${target} ${idl_file} "${idl_cmd_arg_-oA}" anyop_output_prefix anyop_output_dir) + ${target} "${arg_INCLUDE_BASE}" "${idl_file}" "${idl_cmd_arg_-oA}" anyop_output_prefix anyop_output_dir) list(APPEND auto_includes "${anyop_output_dir}") list(APPEND added_output_args "-oA" "${anyop_output_dir}") else() diff --git a/dds/DCPS/CMakeLists.txt b/dds/DCPS/CMakeLists.txt new file mode 100644 index 00000000000..78c338a0af1 --- /dev/null +++ b/dds/DCPS/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.22) + +project(opendds_util CXX) + +set(deps ACE::ACE) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps}) +include(opendds_build_helpers) + +add_library(OpenDDS_Util STATIC + debug.cpp + Hash.cpp + SafetyProfileStreams.cpp + Serializer.cpp + XTypes/TypeObject.cpp +) +_opendds_library(OpenDDS_Util) +target_compile_definitions(OpenDDS_Util PUBLIC OPENDDS_UTIL_BUILD) +target_include_directories(OpenDDS_Util + PUBLIC ../.. + PRIVATE + .. # For pch + ${TAO_INCLUDE_DIRS} # Only for orbconf.h and idl_features.h in Definitions.h +) +target_link_libraries(OpenDDS_Util ${deps}) diff --git a/dds/DCPS/DataDurabilityCache.h b/dds/DCPS/DataDurabilityCache.h index 24f45964929..7d7d9a1b017 100644 --- a/dds/DCPS/DataDurabilityCache.h +++ b/dds/DCPS/DataDurabilityCache.h @@ -1,6 +1,4 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ @@ -10,11 +8,11 @@ #ifndef OPENDDS_NO_PERSISTENCE_PROFILE -#include "dds/DdsDcpsInfrastructureC.h" +#include -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ +#ifndef ACE_LACKS_PRAGMA_ONCE +# pragma once +#endif #include "DurabilityArray.h" #include "DurabilityQueue.h" @@ -22,16 +20,16 @@ #include "PoolAllocator.h" #include "unique_ptr.h" +#include -#include "ace/Hash_Map_With_Allocator_T.h" -#include "ace/Array_Base.h" -#include "ace/String_Base.h" -#include "ace/SStringfwd.h" -#include "ace/Thread_Mutex.h" -#include "ace/Null_Mutex.h" -#include "ace/Synch_Traits.h" -#include "ace/Functor_T.h" -#include "PoolAllocator.h" +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/dds/DCPS/DurabilityArray.h b/dds/DCPS/DurabilityArray.h index 31ebbb4afbf..217ef2cccee 100644 --- a/dds/DCPS/DurabilityArray.h +++ b/dds/DCPS/DurabilityArray.h @@ -1,6 +1,4 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ @@ -8,6 +6,8 @@ #ifndef OPENDDS_DCPS_DURABILITYARRAY_H #define OPENDDS_DCPS_DURABILITYARRAY_H +#include + #include #include diff --git a/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt new file mode 100644 index 00000000000..dbd13b1c32b --- /dev/null +++ b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt @@ -0,0 +1,25 @@ +project(opendds_info_repo_discovery CXX) + +set(lib_deps OpenDDS::Dcps TAO::TAO TAO::PI) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${lib_deps} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_InfoRepoDiscovery + DataReaderRemoteImpl.cpp + DataWriterRemoteImpl.cpp + FailoverListener.cpp + InfoRepoDiscovery.cpp +) +_opendds_library(OpenDDS_InfoRepoDiscovery) +target_link_libraries(OpenDDS_InfoRepoDiscovery PUBLIC ${lib_deps}) + +opendds_target_sources(OpenDDS_InfoRepoDiscovery + PUBLIC + Info.idl + DataReaderRemote.idl + DataWriterRemote.idl + INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + SKIP_OPENDDS_IDL + GENERATE_SERVER_SKELETONS TRUE + USE_EXPORT "dds/DCPS/InfoRepoDiscovery/InfoRepoDiscovery_Export.h" OpenDDS_InfoRepoDiscovery_Export +) diff --git a/dds/DCPS/Marked_Default_Qos.h b/dds/DCPS/Marked_Default_Qos.h index 47633992262..a97d53bf027 100644 --- a/dds/DCPS/Marked_Default_Qos.h +++ b/dds/DCPS/Marked_Default_Qos.h @@ -1,6 +1,4 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ @@ -8,11 +6,13 @@ #ifndef OPENDDS_DCPS_MARKED_DEFAULT_QOS_H #define OPENDDS_DCPS_MARKED_DEFAULT_QOS_H -#include "dds/DdsDcpsInfrastructureC.h" +#include "dcps_export.h" -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ +#include + +#ifndef ACE_LACKS_PRAGMA_ONCE +# pragma once +#endif OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/dds/DCPS/RTPS/CMakeLists.txt b/dds/DCPS/RTPS/CMakeLists.txt new file mode 100644 index 00000000000..9e2f266fa91 --- /dev/null +++ b/dds/DCPS/RTPS/CMakeLists.txt @@ -0,0 +1,46 @@ +project(opendds_rtps CXX) + +find_package(OpenDDS REQUIRED NO_DEFAULTS OpenDDS::Dcps OpenDDS::opendds_idl) +include(opendds_build_helpers) + +add_library(OpenDDS_Rtps + RtpsDiscoveryConfig.cpp + RtpsDiscovery.cpp + Sedp.cpp + Spdp.cpp + GuidGenerator.cpp + ParameterListConverter.cpp + MessageUtils.cpp + MessageParser.cpp + ICE/EndpointManager.cpp + ICE/Task.cpp + ICE/Stun.cpp + ICE/Ice.cpp + ICE/Checklist.cpp + ICE/AgentImpl.cpp +) +_opendds_library(OpenDDS_Rtps) +target_link_libraries(OpenDDS_Rtps PUBLIC OpenDDS::Dcps) + +set(ots_args + INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + USE_EXPORT "dds/DCPS/RTPS/rtps_export.h" OpenDDS_Rtps_Export +) +opendds_target_sources(OpenDDS_Rtps + PUBLIC + RtpsCore.idl + RtpsSecurity.idl + RtpsRpc.idl + TypeLookup.idl + ${ots_args} + SKIP_OPENDDS_IDL + TAO_IDL_OPTIONS -St -Scdr +) +opendds_target_sources(OpenDDS_Rtps + PUBLIC + RtpsCore.idl + RtpsRpc.idl + TypeLookup.idl + ${ots_args} + SKIP_TAO_IDL +) diff --git a/dds/DCPS/RTPS/MessageParser.cpp b/dds/DCPS/RTPS/MessageParser.cpp index e5e50eeebed..b3bcffe3fdd 100644 --- a/dds/DCPS/RTPS/MessageParser.cpp +++ b/dds/DCPS/RTPS/MessageParser.cpp @@ -13,12 +13,12 @@ namespace RTPS { using DCPS::Encoding; namespace { - const Encoding encoding_plain_native(Encoding::KIND_XCDR1); + const Encoding mp_encoding_plain_native(Encoding::KIND_XCDR1); } MessageParser::MessageParser(const ACE_Message_Block& in) : in_(in.duplicate()) - , ser_(in_.get(), encoding_plain_native) + , ser_(in_.get(), mp_encoding_plain_native) , header_() , sub_() , smContentStart_(0) @@ -26,7 +26,7 @@ MessageParser::MessageParser(const ACE_Message_Block& in) MessageParser::MessageParser(const DDS::OctetSeq& in) : fromSeq_(reinterpret_cast(in.get_buffer()), in.length()) - , ser_(&fromSeq_, encoding_plain_native) + , ser_(&fromSeq_, mp_encoding_plain_native) , header_() , sub_() , smContentStart_(0) diff --git a/dds/DCPS/RTPS/MessageUtils.cpp b/dds/DCPS/RTPS/MessageUtils.cpp index c7ce4d25e34..2a661333682 100644 --- a/dds/DCPS/RTPS/MessageUtils.cpp +++ b/dds/DCPS/RTPS/MessageUtils.cpp @@ -17,10 +17,6 @@ namespace RTPS { using DCPS::Encoding; -namespace { - const Encoding encoding_plain_native(Encoding::KIND_XCDR1); -} - const DCPS::Encoding& get_locators_encoding() { static const Encoding encoding(Encoding::KIND_XCDR1, DCPS::ENDIAN_BIG); diff --git a/dds/DCPS/TimeDuration.h b/dds/DCPS/TimeDuration.h index 3f20146643a..5959d88909c 100644 --- a/dds/DCPS/TimeDuration.h +++ b/dds/DCPS/TimeDuration.h @@ -3,6 +3,7 @@ #include "PoolAllocator.h" #include "SafeBool_T.h" +#include "dcps_export.h" #include diff --git a/dds/DCPS/Time_Helper.h b/dds/DCPS/Time_Helper.h index 7a1c4259075..eb914353f29 100644 --- a/dds/DCPS/Time_Helper.h +++ b/dds/DCPS/Time_Helper.h @@ -1,6 +1,4 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ @@ -9,15 +7,16 @@ #define OPENDDS_DCPS_TIME_HELPER_H #include "PoolAllocator.h" +#include "dcps_export.h" #include #include #include -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ +#ifndef ACE_LACKS_PRAGMA_ONCE +# pragma once +#endif OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/dds/DCPS/transport/multicast/CMakeLists.txt b/dds/DCPS/transport/multicast/CMakeLists.txt new file mode 100644 index 00000000000..e0fde894eab --- /dev/null +++ b/dds/DCPS/transport/multicast/CMakeLists.txt @@ -0,0 +1,26 @@ +project(opendds_multicast CXX) + +set(deps OpenDDS::Dcps) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_Multicast + BestEffortSession.cpp + BestEffortSessionFactory.cpp + Multicast.cpp + MulticastDataLink.cpp + MulticastInst.cpp + MulticastLoader.cpp + MulticastReceiveStrategy.cpp + MulticastSendStrategy.cpp + MulticastSession.cpp + MulticastSessionFactory.cpp + MulticastTransport.cpp + ReliableSession.cpp + ReliableSessionFactory.cpp + + MulticastDataLink.inl + MulticastSession.inl +) +_opendds_library(OpenDDS_Multicast) +target_link_libraries(OpenDDS_Multicast PUBLIC ${deps}) diff --git a/dds/DCPS/transport/multicast/ReliableSession.cpp b/dds/DCPS/transport/multicast/ReliableSession.cpp index 8bc6808f46c..6165eecb07f 100644 --- a/dds/DCPS/transport/multicast/ReliableSession.cpp +++ b/dds/DCPS/transport/multicast/ReliableSession.cpp @@ -26,8 +26,8 @@ namespace OpenDDS { namespace DCPS { namespace { - const Encoding::Kind encoding_kind = Encoding::KIND_UNALIGNED_CDR; - const Encoding encoding_unaligned_native(encoding_kind); + const Encoding::Kind reliable_session_encoding_kind = Encoding::KIND_UNALIGNED_CDR; + const Encoding encoding_unaligned_native(reliable_session_encoding_kind); } ReliableSession::ReliableSession(RcHandle interceptor, @@ -486,7 +486,7 @@ ReliableSession::nak_received(const Message_Block_Ptr& control) const TransportHeader& header = this->link_->receive_strategy()->received_header(); - Serializer serializer(control.get(), encoding_kind, header.swap_bytes()); + Serializer serializer(control.get(), reliable_session_encoding_kind, header.swap_bytes()); MulticastPeer local_peer; CORBA::ULong size = 0; @@ -594,7 +594,7 @@ ReliableSession::nakack_received(const Message_Block_Ptr& control) // Not from the remote peer for this session. if (this->remote_peer_ != header.source_) return; - Serializer serializer(control.get(), encoding_kind, header.swap_bytes()); + Serializer serializer(control.get(), reliable_session_encoding_kind, header.swap_bytes()); SequenceNumber low; serializer >> low; diff --git a/dds/DCPS/transport/rtps_udp/CMakeLists.txt b/dds/DCPS/transport/rtps_udp/CMakeLists.txt new file mode 100644 index 00000000000..05b01438629 --- /dev/null +++ b/dds/DCPS/transport/rtps_udp/CMakeLists.txt @@ -0,0 +1,27 @@ +project(opendds_rtps_udp CXX) + +set(deps OpenDDS::Dcps OpenDDS::Rtps) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_Rtps_Udp + MetaSubmessage.cpp + RtpsCustomizedElement.cpp + RtpsSampleHeader.cpp + RtpsTransportHeader.cpp + RtpsUdp.cpp + RtpsUdpDataLink.cpp + RtpsUdpInst.cpp + RtpsUdpLoader.cpp + RtpsUdpReceiveStrategy.cpp + RtpsUdpSendStrategy.cpp + RtpsUdpTransport.cpp + TransactionalRtpsSendQueue.cpp + + RtpsCustomizedElement.inl + RtpsSampleHeader.inl + RtpsTransportHeader.inl + RtpsUdpDataLink.inl +) +_opendds_library(OpenDDS_Rtps_Udp) +target_link_libraries(OpenDDS_Rtps_Udp PUBLIC ${deps}) diff --git a/dds/DCPS/transport/shmem/CMakeLists.txt b/dds/DCPS/transport/shmem/CMakeLists.txt new file mode 100644 index 00000000000..f91c25b1b20 --- /dev/null +++ b/dds/DCPS/transport/shmem/CMakeLists.txt @@ -0,0 +1,19 @@ +project(opendds_shmem CXX) + +set(deps OpenDDS::Dcps) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_Shmem + Shmem.cpp + ShmemDataLink.cpp + ShmemInst.cpp + ShmemLoader.cpp + ShmemReceiveStrategy.cpp + ShmemSendStrategy.cpp + ShmemTransport.cpp + + ShmemDataLink.inl +) +_opendds_library(OpenDDS_Shmem) +target_link_libraries(OpenDDS_Shmem PUBLIC ${deps}) diff --git a/dds/DCPS/transport/tcp/CMakeLists.txt b/dds/DCPS/transport/tcp/CMakeLists.txt new file mode 100644 index 00000000000..9223be1992b --- /dev/null +++ b/dds/DCPS/transport/tcp/CMakeLists.txt @@ -0,0 +1,25 @@ +project(opendds_tcp CXX) + +set(deps OpenDDS::Dcps) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_Tcp + TcpAcceptor.cpp + TcpConnection.cpp + Tcp.cpp + TcpDataLink.cpp + TcpInst.cpp + TcpLoader.cpp + TcpReceiveStrategy.cpp + TcpSendStrategy.cpp + TcpSynchResource.cpp + TcpTransport.cpp + + TcpConnection.inl + TcpDataLink.inl + TcpInst.inl + TcpReceiveStrategy.inl +) +_opendds_library(OpenDDS_Tcp) +target_link_libraries(OpenDDS_Tcp PUBLIC ${deps}) diff --git a/dds/DCPS/transport/udp/CMakeLists.txt b/dds/DCPS/transport/udp/CMakeLists.txt new file mode 100644 index 00000000000..8077594e181 --- /dev/null +++ b/dds/DCPS/transport/udp/CMakeLists.txt @@ -0,0 +1,19 @@ +project(opendds_udp CXX) + +set(deps OpenDDS::Dcps) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_Udp + Udp.cpp + UdpDataLink.cpp + UdpInst.cpp + UdpLoader.cpp + UdpReceiveStrategy.cpp + UdpSendStrategy.cpp + UdpTransport.cpp + + UdpDataLink.inl +) +_opendds_library(OpenDDS_Udp) +target_link_libraries(OpenDDS_Udp PUBLIC ${deps}) diff --git a/dds/InfoRepo/CMakeLists.txt b/dds/InfoRepo/CMakeLists.txt new file mode 100644 index 00000000000..faeb726ff0e --- /dev/null +++ b/dds/InfoRepo/CMakeLists.txt @@ -0,0 +1,61 @@ +project(opendds_info_repo CXX) + +set(lib_dep_libs + OpenDDS::Dcps + OpenDDS::InfoRepoDiscovery + OpenDDS::Tcp + TAO::IORTable + TAO::ImR_Client + TAO::Svc_Utils +) +set(exe_dep_libs + TAO::PI + TAO::BiDirGIOP +) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${lib_dep_libs} ${exe_dep_libs} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_InfoRepoLib + DCPSInfo_i.cpp + DcpsInfo_pch.cpp + DCPS_IR_Domain.cpp + DCPS_IR_Participant.cpp + DCPS_IR_Publication.cpp + DCPS_IR_Subscription.cpp + DCPS_IR_Topic.cpp + DCPS_IR_Topic_Description.cpp + DomainParticipantListener_i.cpp + FederationId.cpp + PersistenceUpdater.cpp + UpdateManager.cpp +) +_opendds_library(OpenDDS_InfoRepoLib) +target_link_libraries(OpenDDS_InfoRepoLib PUBLIC ${lib_dep_libs}) + +add_library(OpenDDS_Federator + FederatorConfig.cpp + FederatorManagerImpl.cpp + FederatorManagerImpl_updates.cpp + InfoRepoMulticastResponder.cpp + + FederatorConfig.inl + FederatorManagerImpl.inl +) +_opendds_library(OpenDDS_Federator) +target_link_libraries(OpenDDS_Federator PUBLIC OpenDDS::InfoRepoLib) +target_compile_definitions(OpenDDS_Federator PRIVATE OPENDDS_FEDERATOR_BUILD_DLL) +opendds_target_sources(OpenDDS_Federator + PUBLIC + Federator.idl + INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + GENERATE_SERVER_SKELETONS TRUE + USE_EXPORT "dds/InfoRepo/federator_export.h" OpenDDS_Federator_Export +) + +add_library(OpenDDS_InfoRepoServ DCPSInfoRepoServ.cpp) +_opendds_library(OpenDDS_InfoRepoServ) +target_link_libraries(OpenDDS_InfoRepoServ PUBLIC OpenDDS::Federator) + +add_executable(DCPSInfoRepo DCPSInfoRepo.cpp) +_opendds_executable(DCPSInfoRepo) +target_link_libraries(DCPSInfoRepo OpenDDS::InfoRepoServ ${exe_dep_libs}) diff --git a/dds/InfoRepo/DCPSInfoRepo.mpc b/dds/InfoRepo/DCPSInfoRepo.mpc index 7a7f069ef83..305fba1f343 100644 --- a/dds/InfoRepo/DCPSInfoRepo.mpc +++ b/dds/InfoRepo/DCPSInfoRepo.mpc @@ -37,7 +37,7 @@ project(*Lib): dcpslib, iortable, dcps_inforepodiscovery, DCPSInfoRepo_bits, imr project(*Serv): dcpslib, dcps_inforepodiscovery, iortable, bidir_giop, DCPSInfoRepo_bits, imr_client, svc_utils, install_lib { sharedname = OpenDDS_InfoRepoServ - dynamicflags = OPENDDS_DCPSINFOREPOSERV_BUILD_DLL + dynamicflags = OPENDDS_INFOREPOSERV_BUILD_DLL includes += $(DDS_ROOT) libs += OpenDDS_InfoRepoLib OpenDDS_Federator after += *Lib *Federator @@ -75,7 +75,6 @@ project(*Federator): dcpslib, dcps_inforepodiscovery, dcps_tcp, iortable, instal requires += no_opendds_safety_profile idlflags += -Wb,export_macro=OpenDDS_Federator_Export -Wb,export_include=federator_export.h -Wb,pch_include=DcpsInfo_pch.h - dynamicflags = OPENDDS_FEDERATOR_BUILD_DLL dcps_ts_flags += -Wb,export_macro=OpenDDS_Federator_Export -Wb,pch_include=DcpsInfo_pch.h \ -Wb,versioning_begin=OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL \ -Wb,versioning_end=OPENDDS_END_VERSIONED_NAMESPACE_DECL diff --git a/dds/InfoRepo/DCPSInfoRepoServ_Export.h b/dds/InfoRepo/DCPSInfoRepoServ_Export.h index f0ee055000e..c0d5ef00d67 100644 --- a/dds/InfoRepo/DCPSInfoRepoServ_Export.h +++ b/dds/InfoRepo/DCPSInfoRepoServ_Export.h @@ -1,55 +1,55 @@ // Definition for Win32 Export directives. // This file is generated automatically by generate_export_file.pl OpenDDS_DCPSInfoRepoServ // ------------------------------ -#ifndef OPENDDS_DCPSINFOREPOSERV_EXPORT_H -#define OPENDDS_DCPSINFOREPOSERV_EXPORT_H +#ifndef OPENDDS_INFOREPOSERV_EXPORT_H +#define OPENDDS_INFOREPOSERV_EXPORT_H #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (OPENDDS_DCPSINFOREPOSERV_HAS_DLL) -# define OPENDDS_DCPSINFOREPOSERV_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && OPENDDS_DCPSINFOREPOSERV_HAS_DLL */ +#if defined (ACE_AS_STATIC_LIBS) && !defined (OPENDDS_INFOREPOSERV_HAS_DLL) +# define OPENDDS_INFOREPOSERV_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && OPENDDS_INFOREPOSERV_HAS_DLL */ -#if !defined (OPENDDS_DCPSINFOREPOSERV_HAS_DLL) -# define OPENDDS_DCPSINFOREPOSERV_HAS_DLL 1 -#endif /* !OPENDDS_DCPSINFOREPOSERV_HAS_DLL */ +#if !defined (OPENDDS_INFOREPOSERV_HAS_DLL) +# define OPENDDS_INFOREPOSERV_HAS_DLL 1 +#endif /* !OPENDDS_INFOREPOSERV_HAS_DLL */ -#if defined (OPENDDS_DCPSINFOREPOSERV_HAS_DLL) && (OPENDDS_DCPSINFOREPOSERV_HAS_DLL == 1) -# if defined (OPENDDS_DCPSINFOREPOSERV_BUILD_DLL) +#if defined (OPENDDS_INFOREPOSERV_HAS_DLL) && (OPENDDS_INFOREPOSERV_HAS_DLL == 1) +# if defined (OPENDDS_INFOREPOSERV_BUILD_DLL) # define OpenDDS_DCPSInfoRepoServ_Export ACE_Proper_Export_Flag -# define OPENDDS_DCPSINFOREPOSERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define OPENDDS_DCPSINFOREPOSERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* OPENDDS_DCPSINFOREPOSERV_BUILD_DLL */ +# define OPENDDS_INFOREPOSERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define OPENDDS_INFOREPOSERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* OPENDDS_INFOREPOSERV_BUILD_DLL */ # define OpenDDS_DCPSInfoRepoServ_Export ACE_Proper_Import_Flag -# define OPENDDS_DCPSINFOREPOSERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define OPENDDS_DCPSINFOREPOSERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* OPENDDS_DCPSINFOREPOSERV_BUILD_DLL */ -#else /* OPENDDS_DCPSINFOREPOSERV_HAS_DLL == 1 */ +# define OPENDDS_INFOREPOSERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define OPENDDS_INFOREPOSERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* OPENDDS_INFOREPOSERV_BUILD_DLL */ +#else /* OPENDDS_INFOREPOSERV_HAS_DLL == 1 */ # define OpenDDS_DCPSInfoRepoServ_Export -# define OPENDDS_DCPSINFOREPOSERV_SINGLETON_DECLARATION(T) -# define OPENDDS_DCPSINFOREPOSERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* OPENDDS_DCPSINFOREPOSERV_HAS_DLL == 1 */ +# define OPENDDS_INFOREPOSERV_SINGLETON_DECLARATION(T) +# define OPENDDS_INFOREPOSERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* OPENDDS_INFOREPOSERV_HAS_DLL == 1 */ -// Set OPENDDS_DCPSINFOREPOSERV_NTRACE = 0 to turn on library specific tracing even if +// Set OPENDDS_INFOREPOSERV_NTRACE = 0 to turn on library specific tracing even if // tracing is turned off for ACE. -#if !defined (OPENDDS_DCPSINFOREPOSERV_NTRACE) +#if !defined (OPENDDS_INFOREPOSERV_NTRACE) # if (ACE_NTRACE == 1) -# define OPENDDS_DCPSINFOREPOSERV_NTRACE 1 +# define OPENDDS_INFOREPOSERV_NTRACE 1 # else /* (ACE_NTRACE == 1) */ -# define OPENDDS_DCPSINFOREPOSERV_NTRACE 0 +# define OPENDDS_INFOREPOSERV_NTRACE 0 # endif /* (ACE_NTRACE == 1) */ -#endif /* !OPENDDS_DCPSINFOREPOSERV_NTRACE */ +#endif /* !OPENDDS_INFOREPOSERV_NTRACE */ -#if (OPENDDS_DCPSINFOREPOSERV_NTRACE == 1) -# define OPENDDS_DCPSINFOREPOSERV_TRACE(X) -#else /* (OPENDDS_DCPSINFOREPOSERV_NTRACE == 1) */ +#if (OPENDDS_INFOREPOSERV_NTRACE == 1) +# define OPENDDS_INFOREPOSERV_TRACE(X) +#else /* (OPENDDS_INFOREPOSERV_NTRACE == 1) */ # if !defined (ACE_HAS_TRACE) # define ACE_HAS_TRACE # endif /* ACE_HAS_TRACE */ -# define OPENDDS_DCPSINFOREPOSERV_TRACE(X) ACE_TRACE_IMPL(X) +# define OPENDDS_INFOREPOSERV_TRACE(X) ACE_TRACE_IMPL(X) # include "ace/Trace.h" -#endif /* (OPENDDS_DCPSINFOREPOSERV_NTRACE == 1) */ +#endif /* (OPENDDS_INFOREPOSERV_NTRACE == 1) */ -#endif /* OPENDDS_DCPSINFOREPOSERV_EXPORT_H */ +#endif /* OPENDDS_INFOREPOSERV_EXPORT_H */ // End of auto generated file. diff --git a/dds/InfoRepo/DCPSInfo_i.cpp b/dds/InfoRepo/DCPSInfo_i.cpp index 26b922fb15c..e2d5e0e8845 100644 --- a/dds/InfoRepo/DCPSInfo_i.cpp +++ b/dds/InfoRepo/DCPSInfo_i.cpp @@ -2238,7 +2238,7 @@ int TAO_DDS_DCPSInfo_i::init_transport(int listen_address_given, #ifndef DDS_HAS_MINIMUM_BIT try { -#ifndef ACE_AS_STATIC_LIBS +# if OPENDDS_TCP_HAS_DLL if (ACE_Service_Config::current()->find(ACE_TEXT("OpenDDS_Tcp")) < 0 /* not found (-1) or suspended (-2) */) { static const ACE_TCHAR directive[] = @@ -2246,7 +2246,7 @@ int TAO_DDS_DCPSInfo_i::init_transport(int listen_address_given, ACE_TEXT("OpenDDS_Tcp:_make_TcpLoader()"); ACE_Service_Config::process_directive(directive); } -#endif +# endif const std::string config_name = OpenDDS::DCPS::TransportRegistry::DEFAULT_INST_PREFIX @@ -2260,6 +2260,13 @@ int TAO_DDS_DCPSInfo_i::init_transport(int listen_address_given, OpenDDS::DCPS::TransportInst_rch inst = OpenDDS::DCPS::TransportRegistry::instance()->create_inst(inst_name, "tcp"); + if(!inst) { + if (OpenDDS::DCPS::log_level >= OpenDDS::DCPS::LogLevel::Error) { + ACE_DEBUG((LM_DEBUG, "(%P|%t) TAO_DDS_DCPSInfo_i::init_transport: " + "couldn't create TCP transport instance for BITs\n")); + } + return -1; + } config->instances_.push_back(inst); OpenDDS::DCPS::TcpInst_rch tcp_inst = diff --git a/dds/idl/CMakeLists.txt b/dds/idl/CMakeLists.txt new file mode 100644 index 00000000000..eb63fe875e8 --- /dev/null +++ b/dds/idl/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.22) + +project(opendds_idl CXX) + +set(deps ACE::ACE TAO::IDL_FE) +find_package(OpenDDS REQUIRED COMPONENTS NO_DEFAULTS ${deps}) +include(opendds_build_helpers) + +add_executable(opendds_idl + annotations.cpp + be_global.cpp + be_init.cpp + be_produce.cpp + be_util.cpp + dds_generator.cpp + dds_visitor.cpp + drv_args.cpp + drv_preproc.cpp + dynamic_data_adapter_generator.cpp + field_info.cpp + itl_generator.cpp + keys_generator.cpp + langmap_generator.cpp + marshal_generator.cpp + metaclass_generator.cpp + opendds_idl.cpp + topic_keys.cpp + ts_generator.cpp + typeobject_generator.cpp + value_reader_generator.cpp + value_writer_generator.cpp +) +_opendds_executable(opendds_idl) +target_link_libraries(opendds_idl ${deps} OpenDDS_Util) +set_target_properties(opendds_idl PROPERTIES + # opendds_idl doesn't play nice with bundling the cpp files together + UNITY_BUILD FALSE +) diff --git a/dds/idl/be_produce.cpp b/dds/idl/be_produce.cpp index 163d0692ea7..2891fbcab74 100644 --- a/dds/idl/be_produce.cpp +++ b/dds/idl/be_produce.cpp @@ -226,6 +226,20 @@ void postprocess(const char* fn, ostringstream& content, } break; case BE_GlobalData::STREAM_CPP: { + // For Unity builds, names in anonymous namespace can clash, so this is used + // to make namespaces with names based on the file instead. + std::string prefix = to_macro(fn); + for (size_t i = 0; i < prefix.size(); ++i) { + prefix[i] = tolower(prefix[i]); + } + out << + "\n" + "#ifdef OPENDDS_IDL_FILE_SPECIFIC\n" + "# undef OPENDDS_IDL_FILE_SPECIFIC\n" + "#endif\n" + "#define OPENDDS_IDL_FILE_SPECIFIC(base, index) " << prefix << "##_##base##index\n" + "\n"; + ACE_CString pch = be_global->pch_include(); if (pch.length()) { out << "#include \"" << pch << "\"\n"; diff --git a/dds/idl/typeobject_generator.cpp b/dds/idl/typeobject_generator.cpp index 1706b46fcb8..5e5dfd2b925 100644 --- a/dds/idl/typeobject_generator.cpp +++ b/dds/idl/typeobject_generator.cpp @@ -554,10 +554,10 @@ typeobject_generator::declare_get_type_map() be_global->add_include("dds/DCPS/XTypes/TypeObject.h", BE_GlobalData::STREAM_H); - be_global->impl_ << "static const XTypes::TypeMap& get_minimal_type_map();\n"; + be_global->impl_ << "static const XTypes::TypeMap& OPENDDS_IDL_FILE_SPECIFIC(get_minimal_type_map, 0)();\n"; if (produce_xtypes_complete_) { - be_global->impl_ << "static const XTypes::TypeMap& get_complete_type_map();\n"; + be_global->impl_ << "static const XTypes::TypeMap& OPENDDS_IDL_FILE_SPECIFIC(get_complete_type_map, 0)();\n"; } } @@ -587,7 +587,7 @@ typeobject_generator::gen_epilogue() for (OpenDDS::XTypes::TypeMap::const_iterator pos = minimal_type_map_.begin(); pos != minimal_type_map_.end(); ++pos, ++idx) { be_global->impl_ << - "XTypes::TypeObject minimal_to" << idx << "()\n" + "XTypes::TypeObject OPENDDS_IDL_FILE_SPECIFIC(minimal_to, " << idx << ")()\n" "{\n" " const unsigned char to_bytes[] = { "; dump_bytes(pos->second); @@ -603,14 +603,14 @@ typeobject_generator::gen_epilogue() } be_global->impl_ << - "XTypes::TypeMap get_minimal_type_map_private()\n" + "XTypes::TypeMap OPENDDS_IDL_FILE_SPECIFIC(get_minimal_type_map_private, 0)()\n" "{\n" " XTypes::TypeMap tm;\n"; idx = 0; for (OpenDDS::XTypes::TypeMap::const_iterator pos = minimal_type_map_.begin(); pos != minimal_type_map_.end(); ++pos, ++idx) { - be_global->impl_ << " tm[" << pos->first << "] = minimal_to" << idx << "();\n"; + be_global->impl_ << " tm[" << pos->first << "] = OPENDDS_IDL_FILE_SPECIFIC(minimal_to, " << idx << ")();\n"; } be_global->impl_ << @@ -622,7 +622,7 @@ typeobject_generator::gen_epilogue() for (OpenDDS::XTypes::TypeMap::const_iterator pos = complete_type_map_.begin(); pos != complete_type_map_.end(); ++pos, ++idx) { be_global->impl_ << - "XTypes::TypeObject complete_to" << idx << "()\n" + "XTypes::TypeObject OPENDDS_IDL_FILE_SPECIFIC(complete_to, " << idx << ")()\n" "{\n" " const unsigned char to_bytes[] = {\n"; dump_bytes(pos->second); @@ -638,14 +638,14 @@ typeobject_generator::gen_epilogue() } be_global->impl_ << - "XTypes::TypeMap get_complete_type_map_private()\n" + "XTypes::TypeMap OPENDDS_IDL_FILE_SPECIFIC(get_complete_type_map_private, 0)()\n" "{\n" " XTypes::TypeMap tm;\n"; idx = 0; for (OpenDDS::XTypes::TypeMap::const_iterator pos = complete_type_map_.begin(); pos != complete_type_map_.end(); ++pos, ++idx) { - be_global->impl_ << " tm[" << pos->first << "] = complete_to" << idx << "();\n"; + be_global->impl_ << " tm[" << pos->first << "] = OPENDDS_IDL_FILE_SPECIFIC(complete_to, " << idx << ")();\n"; } be_global->impl_ << @@ -660,16 +660,16 @@ typeobject_generator::gen_epilogue() " if (tm.empty()) {\n"; be_global->impl_ << - "const XTypes::TypeMap& get_minimal_type_map()\n" << common << - " tm = get_minimal_type_map_private();\n" + "const XTypes::TypeMap& OPENDDS_IDL_FILE_SPECIFIC(get_minimal_type_map, 0)()\n" << common << + " tm = OPENDDS_IDL_FILE_SPECIFIC(get_minimal_type_map_private, 0)();\n" " }\n" " return tm;\n" "}\n\n"; if (produce_xtypes_complete_) { be_global->impl_ << - "const XTypes::TypeMap& get_complete_type_map()\n" << common << - " tm = get_complete_type_map_private();\n" + "const XTypes::TypeMap& OPENDDS_IDL_FILE_SPECIFIC(get_complete_type_map, 0)()\n" << common << + " tm = OPENDDS_IDL_FILE_SPECIFIC(get_complete_type_map_private, 0)();\n" " }\n" " return tm;\n" "}\n"; @@ -1736,7 +1736,7 @@ typeobject_generator::generate(AST_Type* node, UTL_ScopedName* name) Function gti(decl.c_str(), "const XTypes::TypeMap&", ""); gti.endArgs(); be_global->impl_ << - " return get_minimal_type_map();\n"; + " return OPENDDS_IDL_FILE_SPECIFIC(get_minimal_type_map, 0)();\n"; } if (produce_xtypes_complete_) { @@ -1763,7 +1763,7 @@ typeobject_generator::generate(AST_Type* node, UTL_ScopedName* name) Function gti(decl.c_str(), "const XTypes::TypeMap&", ""); gti.endArgs(); be_global->impl_ << - " return get_complete_type_map();\n"; + " return OPENDDS_IDL_FILE_SPECIFIC(get_complete_type_map, 0)();\n"; } } diff --git a/tests/cmake/Messenger/C++11_Messenger/CMakeLists.txt b/tests/cmake/Messenger/C++11_Messenger/CMakeLists.txt index 0eb1593a425..5a0e9b49c5e 100644 --- a/tests/cmake/Messenger/C++11_Messenger/CMakeLists.txt +++ b/tests/cmake/Messenger/C++11_Messenger/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.8.2) enable_testing() find_package(OpenDDS REQUIRED) +include(opendds_testing) if(NOT OPENDDS_OWNERSHIP_PROFILE) message(FATAL_ERROR "This test requires OpenDDS to be built with Ownership Profile enabled") @@ -59,6 +60,4 @@ target_link_libraries(${subscriber} ${opendds_libs} ${idl}) # run_test.pl configure_file("${src}/run_test.pl" "." COPYONLY) -add_test(NAME "${target_prefix}test" - COMMAND perl run_test.pl $<$>:-ExeSubDir> $ -) +_opendds_add_test(COMMAND perl run_test.pl) diff --git a/tests/cmake/Messenger/Messenger_1/CMakeLists.txt b/tests/cmake/Messenger/Messenger_1/CMakeLists.txt index 3d6627b0f54..ea43e1a4eba 100644 --- a/tests/cmake/Messenger/Messenger_1/CMakeLists.txt +++ b/tests/cmake/Messenger/Messenger_1/CMakeLists.txt @@ -9,6 +9,7 @@ cmake_minimum_required(VERSION 3.8.2) enable_testing() find_package(OpenDDS REQUIRED) +include(opendds_testing) if(NOT OPENDDS_OWNERSHIP_PROFILE) message(FATAL_ERROR "This test requires OpenDDS to be built with Ownership Profile enabled") @@ -64,6 +65,4 @@ endforeach() # Testing configure_file("${src}/run_test.pl" . COPYONLY) -add_test(NAME "${target_prefix}test" - COMMAND perl run_test.pl $<$>:-ExeSubDir> $ -) +_opendds_add_test(COMMAND perl run_test.pl) diff --git a/tests/cmake/Messenger/Messenger_2/CMakeLists.txt b/tests/cmake/Messenger/Messenger_2/CMakeLists.txt index 0f4df841f02..7887b40d83c 100644 --- a/tests/cmake/Messenger/Messenger_2/CMakeLists.txt +++ b/tests/cmake/Messenger/Messenger_2/CMakeLists.txt @@ -9,6 +9,7 @@ cmake_minimum_required(VERSION 3.8.2) enable_testing() find_package(OpenDDS REQUIRED) +include(opendds_testing) if(NOT OPENDDS_OWNERSHIP_PROFILE) message(FATAL_ERROR "This test requires OpenDDS to be built with Ownership Profile enabled") @@ -60,6 +61,4 @@ target_link_libraries(${subscriber} ${messenger} OpenDDS::OpenDDS) # Testing configure_file("${src}/run_test.pl" . COPYONLY) -add_test(NAME "${target_prefix}test" - COMMAND perl run_test.pl $<$>:-ExeSubDir> $ -) +_opendds_add_test(COMMAND perl run_test.pl) diff --git a/tests/cmake/Nested_IDL/CMakeLists.txt b/tests/cmake/Nested_IDL/CMakeLists.txt index 31a7f211c5e..050c343b5f1 100644 --- a/tests/cmake/Nested_IDL/CMakeLists.txt +++ b/tests/cmake/Nested_IDL/CMakeLists.txt @@ -16,12 +16,27 @@ add_library(${ecu_lib}) set_target_properties(${ecu_lib} PROPERTIES OUTPUT_NAME ecu_lib ) +if(OPENDDS_FILENAME_ONLY_INCLUDES) + set(ots_args + TAO_IDL_OPTIONS -DOPENDDS_FILENAME_ONLY_INCLUDES + OPENDDS_IDL_OPTIONS -DOPENDDS_FILENAME_ONLY_INCLUDES + ) +else() + set(ots_args + samename.idl + engine/samename.idl + engine/engine_stats/samename.idl + ) +endif() opendds_target_sources(${ecu_lib} PUBLIC - ecu.idl ./engine/engine_specs.idl - ./engine/engine_stats/fuel_stats.idl - ./transmission/transmission_specs.idl - ./transmission/transmission_states.idl) + ecu.idl + engine/engine_specs.idl + engine/engine_stats/fuel_stats.idl + transmission/transmission_specs.idl + transmission/transmission_states.idl + ${ots_args} +) target_link_libraries(${ecu_lib} PUBLIC OpenDDS::Dcps) set(ecu_exe "${target_prefix}exe") diff --git a/tests/cmake/Nested_IDL/ecu.idl b/tests/cmake/Nested_IDL/ecu.idl index 48bfdc29ba6..dd229182ce8 100644 --- a/tests/cmake/Nested_IDL/ecu.idl +++ b/tests/cmake/Nested_IDL/ecu.idl @@ -1,9 +1,15 @@ #ifndef ECU_IDL #define ECU_IDL -#include "engine_specs.idl" -#include "transmission_specs.idl" -#include "fuel_stats.idl" +#ifdef OPENDDS_FILENAME_ONLY_INCLUDES +# include "engine_specs.idl" +# include "transmission_specs.idl" +# include "fuel_stats.idl" +#else +# include "engine/engine_specs.idl" +# include "engine/engine_stats/fuel_stats.idl" +# include "transmission/transmission_specs.idl" +#endif @topic struct EcuInfo { diff --git a/tests/cmake/Nested_IDL/engine/engine_stats/samename.idl b/tests/cmake/Nested_IDL/engine/engine_stats/samename.idl new file mode 100644 index 00000000000..e191a7dae6c --- /dev/null +++ b/tests/cmake/Nested_IDL/engine/engine_stats/samename.idl @@ -0,0 +1,8 @@ +#ifndef SAMENAME_3_IDL +#define SAMENAME_3_IDL + +struct SameName3 { + long value; +}; + +#endif diff --git a/tests/cmake/Nested_IDL/engine/samename.idl b/tests/cmake/Nested_IDL/engine/samename.idl new file mode 100644 index 00000000000..821569f2e78 --- /dev/null +++ b/tests/cmake/Nested_IDL/engine/samename.idl @@ -0,0 +1,8 @@ +#ifndef SAMENAME_2_IDL +#define SAMENAME_2_IDL + +struct SameName2 { + long value; +}; + +#endif diff --git a/tests/cmake/Nested_IDL/samename.idl b/tests/cmake/Nested_IDL/samename.idl new file mode 100644 index 00000000000..01ff26bd068 --- /dev/null +++ b/tests/cmake/Nested_IDL/samename.idl @@ -0,0 +1,8 @@ +#ifndef SAMENAME_1_IDL +#define SAMENAME_1_IDL + +struct SameName1 { + long value; +}; + +#endif diff --git a/tests/cmake/ace_tao_only/CMakeLists.txt b/tests/cmake/ace_tao_only/CMakeLists.txt index 903a35eba40..62529b66e52 100644 --- a/tests/cmake/ace_tao_only/CMakeLists.txt +++ b/tests/cmake/ace_tao_only/CMakeLists.txt @@ -3,6 +3,7 @@ project(opendds_ace_tao_only CXX) enable_testing() find_package(OpenDDS REQUIRED COMPONENTS NO_DEFAULTS TAO::tao_idl TAO::PortableServer) +include(opendds_testing) _opendds_save_cache(OPENDDS_AUTO_LINK_DCPS BOOL TRUE) @@ -54,9 +55,6 @@ add_executable(${client} ${client_files}) set_target_properties(${client} PROPERTIES OUTPUT_NAME MessengerClient) target_link_libraries(${client} ${idl}) -# Testing -add_test(NAME "${target_prefix}test" - COMMAND perl run_test.pl $<$>:-ExeSubDir> $ -) +_opendds_add_test(COMMAND perl run_test.pl) _opendds_restore_cache() From 6d9f9bf12079b23fa3ff1be002c73e0799410061 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Tue, 13 Jun 2023 16:32:07 -0500 Subject: [PATCH 005/140] Temp Workarounds for Windows --- cmake/init.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/init.cmake b/cmake/init.cmake index abe97b02d04..41d35a09ff4 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -89,7 +89,10 @@ if(NOT OPENDDS_CONFIG_CMAKE AND NOT ACE_IS_BEING_BUILT) endif() get_filename_component(OPENDDS_TAO "${OPENDDS_TAO}" ABSOLUTE) + # TODO + if(NOT WIN32) _opendds_detect_ace() + endif() endif() include("${CMAKE_CURRENT_LIST_DIR}/opendds_features.cmake") From f058c170b6858408a3aba9b69eb38721e5c567a9 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 14 Jun 2023 03:21:52 -0500 Subject: [PATCH 006/140] Windows Workaround For OpenDDS_Utils --- CMakeLists.txt | 3 +-- cmake/opendds_build_helpers.cmake | 25 +++++++++++++++++-------- dds/DCPS/CMakeLists.txt | 10 ++++++++-- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6fd5ca4c39..864c235eda7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,6 @@ project(opendds) enable_testing() set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") -set(OPENDDS_CMAKE_V4 TRUE CACHE INTERNAL "") # Need global GENERATED source file properties and need to override it for CMake tests set(CMAKE_POLICY_DEFAULT_CMP0118 NEW CACHE INTERNAL "") set(OPENDDS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") @@ -372,7 +371,7 @@ target_include_directories(OpenDDS_Dcps "$" "$" PRIVATE - "${CMAKE_SOURCE_DIR}/dds" + "${CMAKE_CURRENT_SOURCE_DIR}/dds" ) target_link_libraries(OpenDDS_Dcps PUBLIC ${dcps_lib_deps}) diff --git a/cmake/opendds_build_helpers.cmake b/cmake/opendds_build_helpers.cmake index 74203845188..ca4ff8548b4 100644 --- a/cmake/opendds_build_helpers.cmake +++ b/cmake/opendds_build_helpers.cmake @@ -2,17 +2,23 @@ function(_opendds_alias target) # This is the name the target should be exported from CMake-build OpenDDS as # or imported in the MPC-built OpenDDS CMake package. For consistency and # convenience, alias it so we can use it within the OpenDDS CMake build. - string(REPLACE "OpenDDS_" "" user_name "${target}") - set(user_name "OpenDDS::${user_name}") + string(REPLACE "OpenDDS_" "" name "${target}") + set(name "OpenDDS::${name}") get_target_property(target_type ${target} TYPE) if(target_type MATCHES "LIBRARY") - add_library("${user_name}" ALIAS "${target}") + add_library("${name}" ALIAS "${target}") else() - add_executable("${user_name}" ALIAS "${target}") + add_executable("${name}" ALIAS "${target}") endif() endfunction() function(_opendds_library target) + set(no_value_options) + set(single_value_options EXPORT_SYMBOLS_NAME) + set(multi_value_options) + cmake_parse_arguments(arg + "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) + _opendds_alias(${target}) # Put library in BINARY_DIR/lib @@ -23,14 +29,17 @@ function(_opendds_library target) ) get_target_property(target_type ${target} TYPE) - string(TOUPPER "${target}" uppercase_target) + if(NOT DEFINED arg_EXPORT_SYMBOLS_NAME) + set(arg_EXPORT_SYMBOLS_NAME "${target}") + endif() + string(TOUPPER "${arg_EXPORT_NAME}" export_symbols_name) if(target_type STREQUAL "SHARED_LIBRARY") # Define macro for export header - target_compile_definitions(${target} PRIVATE "${uppercase_target}_BUILD_DLL") + target_compile_definitions(${target} PRIVATE "${export_symbols_name}_BUILD_DLL") elseif(target_type STREQUAL "STATIC_LIBRARY") # Define macro for dds/DCPS/InitStaticLibs.h and other files - string(REPLACE "OPENDDS_" "" short_uppercase_target "${uppercase_target}") - target_compile_definitions(${target} PUBLIC "OPENDDS_${short_uppercase_target}_HAS_DLL=0") + string(REPLACE "OPENDDS_" "" short_export_symbols_name "${export_symbols_name}") + target_compile_definitions(${target} PUBLIC "OPENDDS_${short_export_symbols_name}_HAS_DLL=0") else() message(FATAL_ERROR "Target ${target} has unexpected type ${target_type}") endif() diff --git a/dds/DCPS/CMakeLists.txt b/dds/DCPS/CMakeLists.txt index 78c338a0af1..043b5ddef9f 100644 --- a/dds/DCPS/CMakeLists.txt +++ b/dds/DCPS/CMakeLists.txt @@ -6,14 +6,20 @@ set(deps ACE::ACE) find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps}) include(opendds_build_helpers) -add_library(OpenDDS_Util STATIC +if(WIN32) + set(opendds_library_args EXPORT_SYMBOLS_NAME OpenDDS_Dcps) +else() + set(opendds_util_type STATIC) + set(opendds_library_args NO_INSTALL) +endif() +add_library(OpenDDS_Util ${opendds_util_type} debug.cpp Hash.cpp SafetyProfileStreams.cpp Serializer.cpp XTypes/TypeObject.cpp ) -_opendds_library(OpenDDS_Util) +_opendds_library(OpenDDS_Util ${opendds_library_args}) target_compile_definitions(OpenDDS_Util PUBLIC OPENDDS_UTIL_BUILD) target_include_directories(OpenDDS_Util PUBLIC ../.. From f42ff591d50b36324115d1494a946ead8061305d Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 14 Jun 2023 14:28:04 -0500 Subject: [PATCH 007/140] Fix PATH and EXPORT_SYMBOLS_NAME for Visual Studio --- cmake/opendds_build_helpers.cmake | 2 +- cmake/tao_idl_sources.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/opendds_build_helpers.cmake b/cmake/opendds_build_helpers.cmake index ca4ff8548b4..3f3936244e5 100644 --- a/cmake/opendds_build_helpers.cmake +++ b/cmake/opendds_build_helpers.cmake @@ -32,7 +32,7 @@ function(_opendds_library target) if(NOT DEFINED arg_EXPORT_SYMBOLS_NAME) set(arg_EXPORT_SYMBOLS_NAME "${target}") endif() - string(TOUPPER "${arg_EXPORT_NAME}" export_symbols_name) + string(TOUPPER "${arg_EXPORT_SYMBOLS_NAME}" export_symbols_name) if(target_type STREQUAL "SHARED_LIBRARY") # Define macro for export header target_compile_definitions(${target} PRIVATE "${export_symbols_name}_BUILD_DLL") diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index eb11398f672..4cd48e20e76 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -7,7 +7,7 @@ function(_opendds_tao_append_runtime_lib_dir_to_path dst) if(DEFINED ENV{PATH}) set(val "${val}$ENV{PATH};") endif() - set(val "${val}${TAO_BIN_DIR}") + set(val "${val}${TAO_LIB_DIR}") else() set(val "LD_LIBRARY_PATH=") if(DEFINED ENV{LD_LIBRARY_PATH}) From dfdb85e091f9698d925716ef851b90248439fc93 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 14 Jun 2023 15:33:20 -0500 Subject: [PATCH 008/140] Some Fixes for bigobj and min/max on Windows --- CMakeLists.txt | 2 +- cmake/opendds_build_helpers.cmake | 6 +++++- dds/DCPS/DisjointSequence.cpp | 7 +++---- dds/DCPS/MemoryPool.cpp | 12 ++++++------ dds/DCPS/WriterDataSampleList.cpp | 8 ++++---- dds/DCPS/WriterDataSampleList.inl | 8 ++++---- dds/DCPS/transport/rtps_udp/CMakeLists.txt | 2 +- dds/InfoRepo/CMakeLists.txt | 2 +- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 864c235eda7..e391af0031e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -365,7 +365,7 @@ add_library(OpenDDS_Dcps dds/DCPS/transport/framework/TransportStrategy.cpp dds/DCPS/transport/framework/TransportType.cpp ) -_opendds_library(OpenDDS_Dcps) +_opendds_library(OpenDDS_Dcps MSVC_BIGOBJ) target_include_directories(OpenDDS_Dcps PUBLIC "$" diff --git a/cmake/opendds_build_helpers.cmake b/cmake/opendds_build_helpers.cmake index 3f3936244e5..65596b9da20 100644 --- a/cmake/opendds_build_helpers.cmake +++ b/cmake/opendds_build_helpers.cmake @@ -13,7 +13,7 @@ function(_opendds_alias target) endfunction() function(_opendds_library target) - set(no_value_options) + set(no_value_options MSVC_BIGOBJ) set(single_value_options EXPORT_SYMBOLS_NAME) set(multi_value_options) cmake_parse_arguments(arg @@ -44,6 +44,10 @@ function(_opendds_library target) message(FATAL_ERROR "Target ${target} has unexpected type ${target_type}") endif() + if(MSVC AND arg_MSVC_BIGOBJ) + target_compile_options(${target} PRIVATE /bigobj) + endif() + set(exec_perms OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE diff --git a/dds/DCPS/DisjointSequence.cpp b/dds/DCPS/DisjointSequence.cpp index 470d9c88e45..4ffe27783be 100644 --- a/dds/DCPS/DisjointSequence.cpp +++ b/dds/DCPS/DisjointSequence.cpp @@ -70,8 +70,7 @@ DisjointSequence::insert_i(const SequenceRange& range, SequenceNumber last_gap = gap_iter++->second; for (; gap_iter != range_above; ++gap_iter) { const SequenceNumber in_range = - std::min(gap_iter->first.previous().getValue(), - range.second.getValue()); + (std::min)(gap_iter->first.previous().getValue(), range.second.getValue()); gaps->push_back(SequenceRange(++last_gap, in_range)); last_gap = gap_iter->second; } @@ -193,7 +192,7 @@ DisjointSequence::insert_bitmap_range(RangeSet::Container::iterator& iter, ++right; } - const SequenceNumber low = std::min(iter->first, range.first); + const SequenceNumber low = (std::min)(iter->first, range.first); sequences_.ranges_.erase(iter, right); iter = sequences_.ranges_.insert(SequenceRange(low, high)).first; @@ -330,7 +329,7 @@ DisjointSequence::dump() const ACE_CDR::ULong DisjointSequence::bitmap_num_longs(const SequenceNumber& low, const SequenceNumber& high) { - return high < low ? 0u : std::min(8u, unsigned((high.getValue() - low.getValue() + 32) / 32)); + return high < low ? 0u : (std::min)(8u, unsigned((high.getValue() - low.getValue() + 32) / 32)); } void diff --git a/dds/DCPS/MemoryPool.cpp b/dds/DCPS/MemoryPool.cpp index 473392e9e0e..96c32bd6723 100644 --- a/dds/DCPS/MemoryPool.cpp +++ b/dds/DCPS/MemoryPool.cpp @@ -108,7 +108,7 @@ FreeHeader* FreeHeader::smaller_free(unsigned char* pool_base) const { FreeHeader* result = NULL; - if (offset_smaller_free_ != std::numeric_limits::max()) { + if (offset_smaller_free_ != (std::numeric_limits::max)()) { result = reinterpret_cast(pool_base + offset_smaller_free_); } return result; @@ -118,7 +118,7 @@ FreeHeader* FreeHeader::larger_free(unsigned char* pool_base) const { FreeHeader* result = NULL; - if (offset_larger_free_ != std::numeric_limits::max()) { + if (offset_larger_free_ != (std::numeric_limits::max)()) { result = reinterpret_cast(pool_base + offset_larger_free_); } return result; @@ -130,7 +130,7 @@ FreeHeader::set_smaller_free(FreeHeader* next, unsigned char* pool_base) if (next) { offset_smaller_free_ = reinterpret_cast(next) - pool_base; } else { - offset_smaller_free_ = std::numeric_limits::max(); + offset_smaller_free_ = (std::numeric_limits::max)(); } } @@ -140,7 +140,7 @@ FreeHeader::set_larger_free(FreeHeader* prev, unsigned char* pool_base) if (prev) { offset_larger_free_ = reinterpret_cast(prev) - pool_base; } else { - offset_larger_free_ = std::numeric_limits::max(); + offset_larger_free_ = (std::numeric_limits::max)(); } } @@ -197,9 +197,9 @@ FreeIndex::remove(FreeHeader* free_block, FreeHeader* larger) void FreeIndex::init(FreeHeader* init_free_block) { - size_t max = std::numeric_limits::max(); + const size_t max_size = (std::numeric_limits::max)(); for (size_t size = min_index; size <= max_index; size *= 2) { - nodes_[size_].set_sizes(size, (size == max_index) ? max : size*2); + nodes_[size_].set_sizes(size, (size == max_index) ? max_size : size * 2); ++size_; } add(init_free_block); diff --git a/dds/DCPS/WriterDataSampleList.cpp b/dds/DCPS/WriterDataSampleList.cpp index df59efedc92..4ae22b87aad 100644 --- a/dds/DCPS/WriterDataSampleList.cpp +++ b/dds/DCPS/WriterDataSampleList.cpp @@ -44,23 +44,23 @@ WriterDataSampleList::dequeue(const DataSampleElement* stale) if (found) { // Adjust list size. - -- size_ ; + --size_; // // Remove from the previous element. // - stale->previous_writer_sample_->next_writer_sample_ = stale->next_writer_sample_ ; + stale->previous_writer_sample_->next_writer_sample_ = stale->next_writer_sample_; // // Remove from the next element. // if (stale->next_writer_sample_ != 0) { // Remove the inside of the list. - stale->next_writer_sample_->previous_writer_sample_ = stale->previous_writer_sample_ ; + stale->next_writer_sample_->previous_writer_sample_ = stale->previous_writer_sample_; } else { // Remove from the tail of the list. - tail_ = stale->previous_writer_sample_ ; + tail_ = stale->previous_writer_sample_; } stale->next_writer_sample_ = 0; diff --git a/dds/DCPS/WriterDataSampleList.inl b/dds/DCPS/WriterDataSampleList.inl index 6c99079c07b..e29f1c6934e 100644 --- a/dds/DCPS/WriterDataSampleList.inl +++ b/dds/DCPS/WriterDataSampleList.inl @@ -61,16 +61,16 @@ WriterDataSampleList::enqueue_tail(const DataSampleElement* sample) mSample->next_writer_sample_ = 0; - ++size_ ; + ++size_; if (head_ == 0) { // First sample in the list. - head_ = tail_ = mSample ; + head_ = tail_ = mSample; mSample->previous_writer_sample_ = 0; } else { // Add to existing list. - tail_->next_writer_sample_ = mSample ; + tail_->next_writer_sample_ = mSample; mSample->previous_writer_sample_ = tail_; tail_ = mSample; } @@ -89,7 +89,7 @@ WriterDataSampleList::dequeue_head(DataSampleElement*& stale) return false; } else { - --size_ ; + --size_; head_ = head_->next_writer_sample_; if (head_ == 0) { diff --git a/dds/DCPS/transport/rtps_udp/CMakeLists.txt b/dds/DCPS/transport/rtps_udp/CMakeLists.txt index 05b01438629..f0c327be09e 100644 --- a/dds/DCPS/transport/rtps_udp/CMakeLists.txt +++ b/dds/DCPS/transport/rtps_udp/CMakeLists.txt @@ -23,5 +23,5 @@ add_library(OpenDDS_Rtps_Udp RtpsTransportHeader.inl RtpsUdpDataLink.inl ) -_opendds_library(OpenDDS_Rtps_Udp) +_opendds_library(OpenDDS_Rtps_Udp MSVC_BIGOBJ) target_link_libraries(OpenDDS_Rtps_Udp PUBLIC ${deps}) diff --git a/dds/InfoRepo/CMakeLists.txt b/dds/InfoRepo/CMakeLists.txt index faeb726ff0e..e63d29dcd56 100644 --- a/dds/InfoRepo/CMakeLists.txt +++ b/dds/InfoRepo/CMakeLists.txt @@ -41,7 +41,7 @@ add_library(OpenDDS_Federator FederatorConfig.inl FederatorManagerImpl.inl ) -_opendds_library(OpenDDS_Federator) +_opendds_library(OpenDDS_Federator MSVC_BIGOBJ) target_link_libraries(OpenDDS_Federator PUBLIC OpenDDS::InfoRepoLib) target_compile_definitions(OpenDDS_Federator PRIVATE OPENDDS_FEDERATOR_BUILD_DLL) opendds_target_sources(OpenDDS_Federator From 5002c66a4726bea83237b821a40995cea40956b3 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 14 Jun 2023 15:53:03 -0500 Subject: [PATCH 009/140] Add Missing Include and OPENDDS_BIN_DIR to PATH --- cmake/tao_idl_sources.cmake | 4 ++-- dds/DCPS/WriterDataSampleList.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index 4cd48e20e76..1b5792b2611 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -7,14 +7,14 @@ function(_opendds_tao_append_runtime_lib_dir_to_path dst) if(DEFINED ENV{PATH}) set(val "${val}$ENV{PATH};") endif() - set(val "${val}${TAO_LIB_DIR}") + set(val "${val}${TAO_LIB_DIR};${OPENDDS_LIB_DIR}") else() set(val "LD_LIBRARY_PATH=") if(DEFINED ENV{LD_LIBRARY_PATH}) string(REPLACE "\\" "/" tmp "$ENV{LD_LIBRARY_PATH}") set(val "${val}${tmp}:") endif() - string(REPLACE "\\" "/" tmp ${TAO_LIB_DIR}) + string(REPLACE "\\" "/" tmp "${TAO_LIB_DIR}:${OPENDDS_LIB_DIR}") set(val "\"${val}${tmp}\"") endif() set(${dst} "${val}" PARENT_SCOPE) diff --git a/dds/DCPS/WriterDataSampleList.h b/dds/DCPS/WriterDataSampleList.h index 549396d0e39..91a3e6aa231 100644 --- a/dds/DCPS/WriterDataSampleList.h +++ b/dds/DCPS/WriterDataSampleList.h @@ -1,6 +1,4 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ @@ -10,6 +8,8 @@ #include "dcps_export.h" +#include // For ssize_t + #include OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL From f361be3e7834c8299aec5293e31da62b8f14a275 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 14 Jun 2023 16:35:14 -0500 Subject: [PATCH 010/140] Use TARGET_FILE_DIR for opendds_idl PATH --- cmake/tao_idl_sources.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index 1b5792b2611..a0ba6b32ecc 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -7,7 +7,7 @@ function(_opendds_tao_append_runtime_lib_dir_to_path dst) if(DEFINED ENV{PATH}) set(val "${val}$ENV{PATH};") endif() - set(val "${val}${TAO_LIB_DIR};${OPENDDS_LIB_DIR}") + set(val "${val}${TAO_LIB_DIR};$") else() set(val "LD_LIBRARY_PATH=") if(DEFINED ENV{LD_LIBRARY_PATH}) From 03174161350d37f665d588753e288ac5d9450c35 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 14 Jun 2023 17:49:01 -0500 Subject: [PATCH 011/140] Fix `GENERATED` Issue with opendds_target_sources `opendds_target_sources` has had a problem with the `GENERATED` property for while going back to https://github.com/objectcomputing/OpenDDS/pull/2495. This is because we were unnecessarily using `target_sources(PUBLIC)` on generated header and IDL files that could get inherited by other targets. If this target was in another directory, then it cause CMake to fail because of an issue in CMake that's fixed by https://cmake.org/cmake/help/latest/policy/CMP0118.html. If we just use `target_sources(PRIVATE)` on C++ files this fixes the `GENERATED` issue and a new issue when building OpenDDS with CMake with Visual Studio where it thinks IDL files passed to `target_sources` are MIDL files. --- CMakeLists.txt | 3 +-- cmake/dds_idl_sources.cmake | 4 +++- tests/cmake/generated_global/README.md | 6 ++++++ tests/cmake/generated_global/idl/CMakeLists.txt | 4 +--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e391af0031e..5e65940359a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,6 @@ project(opendds) enable_testing() set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") -# Need global GENERATED source file properties and need to override it for CMake tests -set(CMAKE_POLICY_DEFAULT_CMP0118 NEW CACHE INTERNAL "") set(OPENDDS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") set(OPENDDS_BIN_DIR "${OPENDDS_BUILD_DIR}/bin" CACHE INTERNAL "") set(OPENDDS_LIB_DIR "${OPENDDS_BUILD_DIR}/lib" CACHE INTERNAL "") @@ -458,3 +456,4 @@ add_subdirectory(tests/cmake/ace_tao_only) add_subdirectory(tests/cmake/Messenger) # add_subdirectory(tests/cmake/idl_compiler_tests) add_subdirectory(tests/cmake/include_subdir) +add_subdirectory(tests/cmake/generated_global) diff --git a/cmake/dds_idl_sources.cmake b/cmake/dds_idl_sources.cmake index a46782fd9fe..a4c9475dfbf 100644 --- a/cmake/dds_idl_sources.cmake +++ b/cmake/dds_idl_sources.cmake @@ -27,7 +27,9 @@ function(_opendds_add_idl_or_header_files target scope is_generated files) "_opendds_add_idl_or_header_files(${target} ${scope} ${gen_kind} ${files})") endif() get_filename_component(file ${file} REALPATH) - target_sources(${target} ${scope} $) + if(NOT file MATCHES "\\.idl$") + target_sources(${target} PRIVATE $) + endif() if(NOT ${scope} STREQUAL "PRIVATE") if(file MATCHES "\\.idl$") diff --git a/tests/cmake/generated_global/README.md b/tests/cmake/generated_global/README.md index 20b72a67cf5..272b7a44a84 100644 --- a/tests/cmake/generated_global/README.md +++ b/tests/cmake/generated_global/README.md @@ -11,3 +11,9 @@ These changes should not force the user to have to do anything, as they should b The issue corresponding to this problem is here: https://gitlab.kitware.com/cmake/cmake/-/issues/18399 As of 3/17/2021 it is unresolved. + +# Update + +[CMake Policy CMP0018](https://cmake.org/cmake/help/latest/policy/CMP0118.html#policy:CMP0118) fixed this issue in CMake. +The general issue for us is not the CMake issue, but that `target_sources(PUBLIC)` and `target_sources(INTERFACE)` gives other targets sources with the `GENERATED` property when they don't need to. +This test should stay as a regression test. diff --git a/tests/cmake/generated_global/idl/CMakeLists.txt b/tests/cmake/generated_global/idl/CMakeLists.txt index 9bab12c50b1..15c3e62c6b2 100644 --- a/tests/cmake/generated_global/idl/CMakeLists.txt +++ b/tests/cmake/generated_global/idl/CMakeLists.txt @@ -32,7 +32,5 @@ add_library(${messenger} SHARED) set_target_properties(${messenger} PROPERTIES OUTPUT_NAME messenger ) -# TODO: This should be PUBLIC, but this is broken because of the unrecognized -# GENERATED property on IDL compiler-generated files for this test. -opendds_target_sources(${messenger} "${dst}/Messenger.idl") +opendds_target_sources(${messenger} PUBLIC "${dst}/Messenger.idl") target_link_libraries(${messenger} OpenDDS::Dcps) From 7eb4db5a57fc777d25ad817649461db5bf225ab9 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Thu, 15 Jun 2023 02:20:20 -0500 Subject: [PATCH 012/140] Support Separate Host Tools/Cross Compiling Also correct spelling of `scrap_gnuace.pl` and remove mostly unused `detect_ace.cpp`. --- CMakeLists.txt | 112 ++++---------------- cmake/ace_group.cmake | 1 + cmake/build_ace_tao.cmake | 101 ++++++++++++++++++ cmake/detect_ace.cpp | 26 ----- cmake/import_common.cmake | 15 ++- cmake/init.cmake | 25 ----- cmake/opendds_group.cmake | 3 +- cmake/{scrap_gnuace.pl => scrape_gnuace.pl} | 0 cmake/tao_group.cmake | 1 + 9 files changed, 135 insertions(+), 149 deletions(-) create mode 100644 cmake/build_ace_tao.cmake delete mode 100644 cmake/detect_ace.cpp rename cmake/{scrap_gnuace.pl => scrape_gnuace.pl} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e65940359a..fe0b6d6e6ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.22) -project(opendds) +project(opendds CXX) enable_testing() set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") @@ -9,110 +9,32 @@ set(OPENDDS_BIN_DIR "${OPENDDS_BUILD_DIR}/bin" CACHE INTERNAL "") set(OPENDDS_LIB_DIR "${OPENDDS_BUILD_DIR}/lib" CACHE INTERNAL "") set(OPENDDS_SOURCE_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "") list(APPEND CMAKE_PREFIX_PATH "${OPENDDS_SOURCE_ROOT}") +list(APPEND CMAKE_FIND_ROOT_PATH "${OPENDDS_SOURCE_ROOT}") set(_OPENDDS_CMAKE_DIR "${OPENDDS_SOURCE_ROOT}/cmake" CACHE INTERNAL "") list(APPEND CMAKE_MODULE_PATH "${_OPENDDS_CMAKE_DIR}") include("${_OPENDDS_CMAKE_DIR}/opendds_features.cmake") if(NOT DEFINED OPENDDS_ACE) - # TODO: Move building ACE/TAO to its own file? - include(ExternalProject) - include(FetchContent) - - set(ACE_IS_BEING_BUILT MPC CACHE INTERNAL "") - set(TAO_IS_BEING_BUILT MPC CACHE INTERNAL "") - set(OPENDDS_ACE "${OPENDDS_BUILD_DIR}/ace_tao" CACHE INTERNAL "") - set(OPENDDS_MPC "${OPENDDS_ACE}/MPC" CACHE INTERNAL "") - set(OPENDDS_TAO "${OPENDDS_ACE}/TAO" CACHE INTERNAL "") - set(url_base "https://github.com/DOCGroup/ACE_TAO/releases/download/") - set(ace_ver "7.1.0") - set(configre_ace_tao_args) - if(WIN32) - # TODO - else() - set(ext "tar.bz2") - set(md5 "4696c2898de3bda28dd69abf0055b7eb") - set(mpc_type gnuace) - if(LINUX) - set(config_file "config-linux.h") - list(APPEND configure_ace_tao_args --platform-macros-file "platform_linux.GNU") - elseif(APPLE) - # TODO - endif() - endif() - if(NOT DEFINED config_file) - message(FATAL_ERROR "Not sure how to build ACE/TAO for this system") - endif() - - string(REPLACE "." "_" ace_ver_tag "${ace_ver}") - FetchContent_Declare(ace_tao_dl - PREFIX "${OPENDDS_BUILD_DIR}/ace_tao_tmp" - SOURCE_DIR "${OPENDDS_ACE}" - URL "${url_base}ACE+TAO-${ace_ver_tag}/ACE+TAO-src-${ace_ver}.${ext}" - URL_MD5 "${md5}" - ) - FetchContent_Populate(ace_tao_dl) - - find_package(Perl REQUIRED) - execute_process( - COMMAND - "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/configure_ace_tao.pl" - --mpc "${OPENDDS_MPC}" - --mpc-type "${mpc_type}" - --ace "${OPENDDS_ACE}" - --tao "${OPENDDS_TAO}" - ${configure_ace_tao_args} - --config-file "${config_file}" - ${_OPENDDS_MPC_FEATURES} - COMMAND_ECHO STDOUT - COMMAND_ERROR_IS_FATAL ANY - ) + include("${_OPENDDS_CMAKE_DIR}/build_ace_tao.cmake") +endif() - execute_process( - COMMAND - "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/scrap_gnuace.pl" - --workspace "${OPENDDS_ACE}" - --loc-base "${OPENDDS_BUILD_DIR}" - --ace "${OPENDDS_ACE}" - --tao "${OPENDDS_TAO}" - COMMAND_ECHO STDOUT - COMMAND_ERROR_IS_FATAL ANY - OUTPUT_VARIABLE mpc_projects - ) - set(_OPENDDS_ACE_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") - set(_OPENDDS_ACE_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") - set(_OPENDDS_TAO_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") - set(_OPENDDS_TAO_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") +if(DEFINED OPENDDS_ACE_TAO_HOST_TOOLS) + set(_OPENDDS_ACE_HOST_TOOLS "${OPENDDS_ACE_TAO_HOST_TOOLS}/bin" CACHE INTERNAL "") + set(_OPENDDS_TAO_HOST_TOOLS "${OPENDDS_ACE_TAO_HOST_TOOLS}/bin" CACHE INTERNAL "") +endif() +if(DEFINED OPENDDS_HOST_TOOLS) + set(_OPENDDS_OPENDDS_HOST_TOOLS "${OPENDDS_HOST_TOOLS}/bin" CACHE INTERNAL "") +endif() - string(JSON project_count LENGTH "${mpc_projects}") - if(project_count EQUAL 0) - message(FATAL_ERROR "MPC projects was empty!") +if(NOT CMAKE_CROSSCOMPILING) + add_subdirectory(dds/DCPS) + add_subdirectory(dds/idl) + if(BUILD_OPENDDS_HOST_TOOLS) + return() endif() - set(byproducts) - math(EXPR member_index_end "${project_count} - 1") - foreach(member_index RANGE ${member_index_end}) - string(JSON member_name MEMBER "${mpc_projects}" ${member_index}) - string(JSON mpc_project GET "${mpc_projects}" ${member_name}) - string(JSON file GET "${mpc_project}" loc) - list(APPEND byproducts "${file}") - endforeach() - - ExternalProject_Add(build_ace_tao - SOURCE_DIR "${OPENDDS_ACE}" - CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "Already configured" - BUILD_IN_SOURCE TRUE - BUILD_COMMAND - "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}" - make -j8 - BUILD_BYPRODUCTS ${byproducts} - USES_TERMINAL_BUILD TRUE # Needed for Ninja to show the ACE/TAO build - INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "No install step" - ) endif() -add_subdirectory(dds/DCPS) -add_subdirectory(dds/idl) - # TODO: Move Dcps to dds/CMakeLists.txt? set(dcps_lib_deps @@ -281,6 +203,7 @@ add_library(OpenDDS_Dcps dds/DCPS/transport/framework/DataLinkSet.inl dds/DCPS/transport/framework/DirectPriorityMapper.cpp dds/DCPS/transport/framework/DirectPriorityMapper.inl + dds/DCPS/transport/framework/MessageDropper.cpp dds/DCPS/transport/framework/NullSynch.cpp dds/DCPS/transport/framework/NullSynch.inl dds/DCPS/transport/framework/NullSynchStrategy.cpp @@ -360,6 +283,7 @@ add_library(OpenDDS_Dcps dds/DCPS/transport/framework/TransportSendListener.cpp dds/DCPS/transport/framework/TransportSendStrategy.cpp dds/DCPS/transport/framework/TransportSendStrategy.inl + dds/DCPS/transport/framework/TransportStatistics.cpp dds/DCPS/transport/framework/TransportStrategy.cpp dds/DCPS/transport/framework/TransportType.cpp ) diff --git a/cmake/ace_group.cmake b/cmake/ace_group.cmake index 8b74d0a9763..882f3d2edaa 100644 --- a/cmake/ace_group.cmake +++ b/cmake/ace_group.cmake @@ -21,6 +21,7 @@ _opendds_group_lib(XML_Utils _opendds_group_exe(ace_gperf MPC_NAME gperf DEPENDS ACE::ACE + HOST_TOOL # Adding ${TAO_BIN_DIR} to the ace bin hints allows users of # VxWorks layer builds to set TAO_BIN_DIR to the location of # the partner host tools directory, but keep ACE_BIN_DIR the diff --git a/cmake/build_ace_tao.cmake b/cmake/build_ace_tao.cmake new file mode 100644 index 00000000000..a058356f767 --- /dev/null +++ b/cmake/build_ace_tao.cmake @@ -0,0 +1,101 @@ +include(ExternalProject) +include(FetchContent) + +set(ACE_IS_BEING_BUILT MPC CACHE INTERNAL "") +set(TAO_IS_BEING_BUILT MPC CACHE INTERNAL "") +set(OPENDDS_ACE "${OPENDDS_BUILD_DIR}/ace_tao" CACHE INTERNAL "") +set(OPENDDS_MPC "${OPENDDS_ACE}/MPC" CACHE INTERNAL "") +set(OPENDDS_TAO "${OPENDDS_ACE}/TAO" CACHE INTERNAL "") +set(url_base "https://github.com/DOCGroup/ACE_TAO/releases/download/") +set(ace_ver "7.1.0") +set(configre_ace_tao_args) +if(WIN32) + set(ext "zip") + set(md5 "46f1ca435aa6f22cbafb80f8ac78d8cb") + set(mpc_type vs2017) + set(config_file "config-win32.h") + # TODO: Invoke msbuild +else() + set(ext "tar.bz2") + set(md5 "4696c2898de3bda28dd69abf0055b7eb") + set(mpc_type gnuace) + if(LINUX) + set(config_file "config-linux.h") + list(APPEND configure_ace_tao_args --platform-macros-file "platform_linux.GNU") + elseif(APPLE) + set(config_file "config-macosx.h") + list(APPEND configure_ace_tao_args --platform-macros-file "platform_macosx.GNU") + endif() +endif() +if(NOT DEFINED mpc_type OR NOT DEFINED config_file) + message(FATAL_ERROR "Not sure how to configure ACE/TAO for this system") +endif() + +string(REPLACE "." "_" ace_ver_tag "${ace_ver}") +FetchContent_Declare(ace_tao_dl + PREFIX "${OPENDDS_BUILD_DIR}/ace_tao_tmp" + SOURCE_DIR "${OPENDDS_ACE}" + URL "${url_base}ACE+TAO-${ace_ver_tag}/ACE+TAO-src-${ace_ver}.${ext}" + URL_MD5 "${md5}" +) +FetchContent_Populate(ace_tao_dl) + +find_package(Perl REQUIRED) +execute_process( + COMMAND + "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/configure_ace_tao.pl" + --mpc "${OPENDDS_MPC}" + --mpc-type "${mpc_type}" + --ace "${OPENDDS_ACE}" + --tao "${OPENDDS_TAO}" + ${configure_ace_tao_args} + --config-file "${config_file}" + ${_OPENDDS_MPC_FEATURES} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY +) + +if(mpc_type STREQUAL gnuace) + execute_process( + COMMAND + "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/scrape_gnuace.pl" + --workspace "${OPENDDS_ACE}" + --loc-base "${OPENDDS_BUILD_DIR}" + --ace "${OPENDDS_ACE}" + --tao "${OPENDDS_TAO}" + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + OUTPUT_VARIABLE mpc_projects + ) + set(_OPENDDS_ACE_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") + set(_OPENDDS_ACE_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") + set(_OPENDDS_TAO_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") + set(_OPENDDS_TAO_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") + + string(JSON project_count LENGTH "${mpc_projects}") + if(project_count EQUAL 0) + message(FATAL_ERROR "MPC projects was empty!") + endif() + set(byproducts) + math(EXPR member_index_end "${project_count} - 1") + foreach(member_index RANGE ${member_index_end}) + string(JSON member_name MEMBER "${mpc_projects}" ${member_index}) + string(JSON mpc_project GET "${mpc_projects}" ${member_name}) + string(JSON file GET "${mpc_project}" loc) + list(APPEND byproducts "${file}") + endforeach() + + ExternalProject_Add(build_ace_tao + SOURCE_DIR "${OPENDDS_ACE}" + CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "Already configured" + BUILD_IN_SOURCE TRUE + BUILD_COMMAND + "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}" + make -j8 + BUILD_BYPRODUCTS ${byproducts} + USES_TERMINAL_BUILD TRUE # Needed for Ninja to show the ACE/TAO build + INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "No install step" + ) +else() + message(FATAL_ERROR "Not sure how to build ACE/TAO for this system") +endif() diff --git a/cmake/detect_ace.cpp b/cmake/detect_ace.cpp deleted file mode 100644 index d0e0406a665..00000000000 --- a/cmake/detect_ace.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -#include - -int main(int argc, char**) -{ - // Output value to match to https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html - // As of writing these values aren't documented, see - // https://gitlab.kitware.com/cmake/cmake/-/issues/21489 - printf("CMAKE_SYSTEM_NAME=%s\n", -#if defined ACE_LINUX - "Linux" -#elif defined ACE_WIN32 - "Windows" -#elif defined ACE_HAS_MAC_OSX - "Darwin" -#else - "unknown" -#endif - ); - - printf("ACE_VERSION=%s\n", ACE_VERSION); - - return 0; -} diff --git a/cmake/import_common.cmake b/cmake/import_common.cmake index 5c2c13aeb72..83367817639 100644 --- a/cmake/import_common.cmake +++ b/cmake/import_common.cmake @@ -67,7 +67,7 @@ function(_opendds_group_lib name) endfunction() function(_opendds_group_exe name) - set(no_value_options) + set(no_value_options HOST_TOOL) set(single_value_options MPC_NAME) set(multi_value_options DEPENDS EXTRA_BIN_DIRS) cmake_parse_arguments(arg @@ -92,6 +92,11 @@ function(_opendds_group_exe name) if(arg_EXTRA_BIN_DIRS) list(APPEND bin_dirs ${arg_EXTRA_BIN_DIRS}) endif() + set(host_tool_var "${_opendds_group_prefix}_HOST_TOOLS") + if(arg_HOST_TOOL AND DEFINED ${host_tool_var}) + set("${prefix}_HOST_TOOL" TRUE PARENT_SCOPE) + set(bin_dirs "${${host_tool_var}}") + endif() list(REMOVE_DUPLICATES bin_dirs) set("${prefix}_BIN_DIRS" "${bin_dirs}" PARENT_SCOPE) endfunction() @@ -180,7 +185,7 @@ function(_opendds_find_our_libraries_for_config group libs config suffix) continue() endif() - find_library(${lib_var} "${lib_file_base}" HINTS "${lib_dir}") + find_library(${lib_var} "${lib_file_base}" HINTS "${lib_dir}" NO_CMAKE_FIND_ROOT_PATH) if(${lib_var}) set(${found_var} TRUE CACHE INTERNAL "" FORCE) @@ -250,7 +255,11 @@ function(_opendds_find_executables group exes) endif() endif() else() - find_program("${var}" NAMES "${exe}" HINTS ${${var}_BIN_DIRS}) + set(extra_args) + if(${var}_HOST_TOOL) + list(APPEND extra_args NO_CMAKE_FIND_ROOT_PATH) + endif() + find_program("${var}" NAMES "${exe}" HINTS ${${var}_BIN_DIRS} ${extra_args}) endif() endforeach() endfunction() diff --git a/cmake/init.cmake b/cmake/init.cmake index 41d35a09ff4..35ab785966e 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -21,31 +21,6 @@ function(_opendds_detect_ace) endif() set(_OPENDDS_DETECTED_ACE TRUE CACHE INTERNAL "") - try_run(run_result compile_result - SOURCES "${CMAKE_CURRENT_LIST_DIR}/detect_ace.cpp" - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${OPENDDS_ACE}" - RUN_OUTPUT_STDOUT_VARIABLE detect_ace_output) - if(OPENDDS_CMAKE_VERBOSE) - message(STATUS "detect_ace_output: ${detect_ace_output}") - endif() - - if(detect_ace_output MATCHES "CMAKE_SYSTEM_NAME=([^\n]+)\n") - set(ace_system_name "${CMAKE_MATCH_1}") - if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${ace_system_name}") - message(FATAL_ERROR - "ace_system_name is \"${ace_system_name}\" is not the same as " - "CMAKE_SYSTEM_NAME \"${CMAKE_SYSTEM_NAME}\"") - endif() - else() - message(FATAL_ERROR "Couldn't get OS name from detect_ace output: ${detect_ace_output}") - endif() - - if(detect_ace_output MATCHES "ACE_VERSION=([^\n]+)\n") - message("ACE_VERSION: ${CMAKE_MATCH_1}") - else() - message(FATAL_ERROR "Couldn't get ACE version from detect_ace output: ${detect_ace_output}") - endif() - execute_process( COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/detect_ace.pl" "${OPENDDS_ACE}" RESULT_VARIABLE run_result diff --git a/cmake/opendds_group.cmake b/cmake/opendds_group.cmake index 2715d8cdff8..4a35ce60720 100644 --- a/cmake/opendds_group.cmake +++ b/cmake/opendds_group.cmake @@ -61,7 +61,8 @@ _opendds_group_lib(Udp DEPENDS OpenDDS::Dcps) _opendds_group_lib(QOS_XML_XSC_Handler DEPENDS OpenDDS::Dcps ACE::XML_Utils) _opendds_group_lib(RtpsRelayLib DEPENDS OpenDDS::Dcps) -foreach(_exe DCPSInfoRepo RtpsRelay dcpsinfo_dump inspect opendds_idl repoctl) +_opendds_group_exe(opendds_idl HOST_TOOL) +foreach(_exe DCPSInfoRepo RtpsRelay dcpsinfo_dump inspect repoctl) _opendds_group_exe("${_exe}") endforeach() diff --git a/cmake/scrap_gnuace.pl b/cmake/scrape_gnuace.pl similarity index 100% rename from cmake/scrap_gnuace.pl rename to cmake/scrape_gnuace.pl diff --git a/cmake/tao_group.cmake b/cmake/tao_group.cmake index 42479f14212..a0a1fba93d6 100644 --- a/cmake/tao_group.cmake +++ b/cmake/tao_group.cmake @@ -46,6 +46,7 @@ _opendds_group_lib(Valuetype DEPENDS TAO::TAO TAO::AnyTypeCode) _opendds_group_exe(tao_idl MPC_NAME TAO_IDL_EXE DEPENDS ACE::ace_gperf + HOST_TOOL ) if(OPENDDS_STATIC) From 0a54c0dda53014811e2e5bfb16c20961e007d073 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Thu, 15 Jun 2023 23:19:05 -0500 Subject: [PATCH 013/140] Fixes for Windows, Other Minor Fixes --- CMakeLists.txt | 5 ++- DevGuideExamples/DCPS/Messenger/Publisher.cpp | 1 - .../DCPS/Messenger/Subscriber.cpp | 1 - bin/PerlDDS/Run_Test.pm | 1 - cmake/init.cmake | 18 ++++++++++ cmake/opendds_target_sources.cmake | 8 ++--- cmake/opendds_testing.cmake | 10 +++++- cmake/scrape_gnuace.pl | 6 ++-- cmake/tao_idl_sources.cmake | 24 +++++-------- dds/DCPS/InfoRepoDiscovery/CMakeLists.txt | 2 +- .../transport/framework/TransportRegistry.cpp | 35 +++++++++++-------- 11 files changed, 66 insertions(+), 45 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe0b6d6e6ee..0ec0701efec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,13 +364,12 @@ opendds_target_sources(OpenDDS_Dcps ${opendds_target_sources_args} ) -add_subdirectory(dds/DCPS/InfoRepoDiscovery) -add_subdirectory(dds/DCPS/RTPS) - add_subdirectory(dds/DCPS/transport/multicast) +add_subdirectory(dds/DCPS/RTPS) add_subdirectory(dds/DCPS/transport/rtps_udp) add_subdirectory(dds/DCPS/transport/shmem) add_subdirectory(dds/DCPS/transport/tcp) +add_subdirectory(dds/DCPS/InfoRepoDiscovery) add_subdirectory(dds/DCPS/transport/udp) add_subdirectory(dds/InfoRepo) diff --git a/DevGuideExamples/DCPS/Messenger/Publisher.cpp b/DevGuideExamples/DCPS/Messenger/Publisher.cpp index f7a2fec9124..1db19ab3c6c 100644 --- a/DevGuideExamples/DCPS/Messenger/Publisher.cpp +++ b/DevGuideExamples/DCPS/Messenger/Publisher.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #ifdef ACE_AS_STATIC_LIBS # include diff --git a/DevGuideExamples/DCPS/Messenger/Subscriber.cpp b/DevGuideExamples/DCPS/Messenger/Subscriber.cpp index 25757640fa5..fe0bde61b9f 100644 --- a/DevGuideExamples/DCPS/Messenger/Subscriber.cpp +++ b/DevGuideExamples/DCPS/Messenger/Subscriber.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #ifdef ACE_AS_STATIC_LIBS # include diff --git a/bin/PerlDDS/Run_Test.pm b/bin/PerlDDS/Run_Test.pm index 5c4b8eb4f65..361315d0416 100644 --- a/bin/PerlDDS/Run_Test.pm +++ b/bin/PerlDDS/Run_Test.pm @@ -41,7 +41,6 @@ sub get_bin_executable { elsif (defined($ENV{OPENDDS_INSTALL_PREFIX})) { $bin = catdir($ENV{OPENDDS_INSTALL_PREFIX}, "bin"); } - print("bin=$bin\n"); return get_executable($name, $bin); } diff --git a/cmake/init.cmake b/cmake/init.cmake index 35ab785966e..2a2bc0579a9 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -129,6 +129,24 @@ function(_opendds_pop_list list_var) endif() endfunction() +function(_opendds_path_list path_list_var) + set(path_list) + if(WIN32) + set(delimiter ";") + else() + set(delimiter ":") + endif() + + foreach(path ${ARGN}) + if(path_list AND NOT path_list MATCHES "${delimiter}$") + set(path_list "${path_list}${delimiter}") + endif() + set(path_list "${path_list}${path}") + endforeach() + + set("${path_list_var}" "${path_list}" PARENT_SCOPE) +endfunction() + if(NOT DEFINED OPENDDS_INSTALL_LIB) set(OPENDDS_INSTALL_LIB "lib") endif() diff --git a/cmake/opendds_target_sources.cmake b/cmake/opendds_target_sources.cmake index 8fc33147a99..43e090a2185 100644 --- a/cmake/opendds_target_sources.cmake +++ b/cmake/opendds_target_sources.cmake @@ -259,11 +259,11 @@ function(opendds_target_sources target) endif() list(GET use_export 0 export_header) list(GET use_export 1 export_macro) - if(NOT "${tao_options}" MATCHES "-Wb,stub_export_include") - list(APPEND tao_options "-Wb,stub_export_include=${export_header}") + if(NOT "${tao_options}" MATCHES "-Wb,export_include") + list(APPEND tao_options "-Wb,export_include=${export_header}") endif() - if(NOT "${tao_options}" MATCHES "-Wb,stub_export_macro") - list(APPEND tao_options "-Wb,stub_export_macro=${export_macro}") + if(NOT "${tao_options}" MATCHES "-Wb,export_macro") + list(APPEND tao_options "-Wb,export_macro=${export_macro}") endif() if(NOT "${opendds_options}" MATCHES "-Wb,export_include") list(APPEND opendds_options "-Wb,export_include=${export_header}") diff --git a/cmake/opendds_testing.cmake b/cmake/opendds_testing.cmake index f0f9742c643..e73d88f6f50 100644 --- a/cmake/opendds_testing.cmake +++ b/cmake/opendds_testing.cmake @@ -11,11 +11,19 @@ function(_opendds_add_test) endif() add_test(NAME "${test_name}" ${arg_UNPARSED_ARGUMENTS}) set(env "ACE_ROOT=${ACE_ROOT}" "TAO_ROOT=${TAO_ROOT}") + if(MSVC) + set(env_var_name PATH) + else() + set(env_var_name LD_LIBRARY_PATH) + endif() + _opendds_path_list(lib_dir_list "$ENV{${env_var_name}}" "${TAO_LIB_DIR}" "${OPENDDS_LIB_DIR}") + list(APPEND env "${env_var_name}=${lib_dir_list}") if(DEFINED OPENDDS_BUILD_DIR) list(APPEND env "OPENDDS_BUILD_DIR=${OPENDDS_BUILD_DIR}") endif() if(DEFINED OPENDDS_SOURCE_ROOT) - list(APPEND env "PERL5LIB=${OPENDDS_SOURCE_ROOT}/bin:${ACE_ROOT}/bin") + _opendds_path_list(perl5lib "${OPENDDS_SOURCE_ROOT}/bin" "${ACE_ROOT}/bin") + list(APPEND env "PERL5LIB=${perl5lib}") endif() if(env) set_property(TEST "${test_name}" PROPERTY ENVIRONMENT "${env}") diff --git a/cmake/scrape_gnuace.pl b/cmake/scrape_gnuace.pl index fe99cef556c..c5905e6e0e5 100755 --- a/cmake/scrape_gnuace.pl +++ b/cmake/scrape_gnuace.pl @@ -59,7 +59,7 @@ sub get_projects { return \%projects; } -sub scrap_makefile { +sub scrape_makefile { my $mf = shift(); my $projects = shift(); my $project = shift(); @@ -116,11 +116,11 @@ sub scrap_makefile { chdir($values{workspace}); my $projects = get_projects(); -scrap_makefile($gnumf, $projects); +scrape_makefile($gnumf, $projects); for my $project (values(%{$projects})) { die("$project->{name} is missing dir") if (!defined($project->{dir})); chdir($project->{dir}) or die("Couldn't cd for $project->{name} to $project->{dir}: $!"); - scrap_makefile("$project->{mf}", $projects, $project); + scrape_makefile("$project->{mf}", $projects, $project); } # Remove deps without a build.local removed above diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index a0ba6b32ecc..42131106816 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -3,21 +3,15 @@ function(_opendds_tao_append_runtime_lib_dir_to_path dst) if(MSVC) - set(val "PATH=") - if(DEFINED ENV{PATH}) - set(val "${val}$ENV{PATH};") - endif() - set(val "${val}${TAO_LIB_DIR};$") + set(env_var_name PATH) else() - set(val "LD_LIBRARY_PATH=") - if(DEFINED ENV{LD_LIBRARY_PATH}) - string(REPLACE "\\" "/" tmp "$ENV{LD_LIBRARY_PATH}") - set(val "${val}${tmp}:") - endif() - string(REPLACE "\\" "/" tmp "${TAO_LIB_DIR}:${OPENDDS_LIB_DIR}") - set(val "\"${val}${tmp}\"") + set(env_var_name LD_LIBRARY_PATH) + endif() + _opendds_path_list(path_list "$ENV{${env_var_name}}" "${TAO_LIB_DIR}" "$") + if(NOT MSVC) + string(REPLACE "\\" "/" path_list "${path_list}") endif() - set(${dst} "${val}" PARENT_SCOPE) + set(${dst} "${env_var_name}=${path_list}" PARENT_SCOPE) endfunction() function(_opendds_get_generated_output_dir target output_dir_var) @@ -188,11 +182,11 @@ function(_opendds_tao_idl target) "${skel_output_prefix}S_T.cpp") endif() - if(idl_cmd_arg_-Gxhst) + if(idl_cmd_arg_-Gxhst AND DEFINED idl_cmd_arg-wb-stub_export_file) list(APPEND stub_header_files "${CMAKE_CURRENT_BINARY_DIR}/${idl_cmd_arg-wb-stub_export_file}") endif() - if(idl_cmd_arg_-Gxhsk) + if(idl_cmd_arg_-Gxhsk AND DEFINED idl_cmd_arg-wb-skel_export_file) list(APPEND skel_header_files "${CMAKE_CURRENT_BINARY_DIR}/${idl_cmd_arg-wb-skel_export_file}") endif() diff --git a/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt index dbd13b1c32b..76b2bd6ccc8 100644 --- a/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt +++ b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt @@ -1,6 +1,6 @@ project(opendds_info_repo_discovery CXX) -set(lib_deps OpenDDS::Dcps TAO::TAO TAO::PI) +set(lib_deps OpenDDS::Dcps OpenDDS::Tcp TAO::TAO TAO::PI) find_package(OpenDDS REQUIRED NO_DEFAULTS ${lib_deps} safety_profile=FALSE) include(opendds_build_helpers) diff --git a/dds/DCPS/transport/framework/TransportRegistry.cpp b/dds/DCPS/transport/framework/TransportRegistry.cpp index f2ee8b3ed0f..3d5ff2b4154 100644 --- a/dds/DCPS/transport/framework/TransportRegistry.cpp +++ b/dds/DCPS/transport/framework/TransportRegistry.cpp @@ -1,32 +1,32 @@ /* - * - * * Distributed under the OpenDDS License. * See: http://www.opendds.org/license.html */ -#include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/ +#include //Only the _pch include should start with DCPS/ + #include "TransportRegistry.h" #include "TransportDebug.h" #include "TransportInst.h" #include "TransportExceptions.h" #include "TransportType.h" -#include "dds/DCPS/GuidConverter.h" -#include "dds/DCPS/Util.h" -#include "dds/DCPS/Service_Participant.h" -#include "dds/DCPS/EntityImpl.h" -#include "dds/DCPS/SafetyProfileStreams.h" -#include +#include +#include +#include +#include +#include +#include -#include "ace/Singleton.h" -#include "ace/OS_NS_strings.h" -#include "ace/Service_Config.h" +#include -#if !defined (__ACE_INLINE__) -#include "TransportRegistry.inl" -#endif /* __ACE_INLINE__ */ +#include +#include +#include +#ifndef __ACE_INLINE__ +# include "TransportRegistry.inl" +#endif namespace { /// Used for sorting @@ -515,6 +515,11 @@ TransportRegistry::load_transport_lib_i(const OPENDDS_STRING& transport_type) { ACE_Guard > guard(rev_lock); if (0 != ACE_Service_Config::process_directive(directive.c_str())) { + if (log_level >= LogLevel::Error) { + ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TransportRegistry::load_transport_lib_i: " + "process_directive failed for transport_type=%C\n", + transport_type.c_str())); + } return TransportType_rch(); } } From 935f430624a092971910b537044b7caa2092c7e8 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Fri, 16 Jun 2023 00:43:09 -0500 Subject: [PATCH 014/140] Fix Running ctest on Windows --- bin/PerlDDS/Run_Test.pm | 9 +++++++++ cmake/opendds_testing.cmake | 12 +++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/PerlDDS/Run_Test.pm b/bin/PerlDDS/Run_Test.pm index 361315d0416..42a43625e52 100644 --- a/bin/PerlDDS/Run_Test.pm +++ b/bin/PerlDDS/Run_Test.pm @@ -37,6 +37,12 @@ sub get_bin_executable { my $bin = catdir($ENV{DDS_ROOT}, "bin"); if (defined($ENV{OPENDDS_BUILD_DIR})) { $bin = catdir($ENV{OPENDDS_BUILD_DIR}, "bin"); + if (defined($ENV{CMAKE_CONFIG_TYPE})) { + my $subdir_bin = catdir($bin, $ENV{CMAKE_CONFIG_TYPE}); + if (-d $subdir_bin) { + $bin = $subdir_bin; + } + } } elsif (defined($ENV{OPENDDS_INSTALL_PREFIX})) { $bin = catdir($ENV{OPENDDS_INSTALL_PREFIX}, "bin"); @@ -664,6 +670,9 @@ sub process { } my $subdir = $PerlACE::Process::ExeSubDir; + if (defined($ENV{CMAKE_CONFIG_TYPE})) { + $subdir = $ENV{CMAKE_CONFIG_TYPE}; + } my $basename = File::Basename::basename($executable); my $dirname = File::Basename::dirname($executable); if (!defined(PerlDDS::get_executable($basename, $dirname, catdir($dirname, $subdir)))) { diff --git a/cmake/opendds_testing.cmake b/cmake/opendds_testing.cmake index e73d88f6f50..6e6f5c0e667 100644 --- a/cmake/opendds_testing.cmake +++ b/cmake/opendds_testing.cmake @@ -1,7 +1,7 @@ function(_opendds_add_test) set(no_value_options) set(single_value_options NAME) - set(multi_value_options) + set(multi_value_options COMMAND) cmake_parse_arguments(arg "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) @@ -9,14 +9,20 @@ function(_opendds_add_test) if(arg_NAME) set(test_name "${test_name}_${arg_NAME}") endif() - add_test(NAME "${test_name}" ${arg_UNPARSED_ARGUMENTS}) + add_test(NAME "${test_name}" ${arg_UNPARSED_ARGUMENTS} + COMMAND ${arg_COMMAND} $<$>:-ExeSubDir> $) set(env "ACE_ROOT=${ACE_ROOT}" "TAO_ROOT=${TAO_ROOT}") if(MSVC) set(env_var_name PATH) else() set(env_var_name LD_LIBRARY_PATH) endif() - _opendds_path_list(lib_dir_list "$ENV{${env_var_name}}" "${TAO_LIB_DIR}" "${OPENDDS_LIB_DIR}") + _opendds_path_list(lib_dir_list + "$ENV{${env_var_name}}" "${TAO_LIB_DIR}" "${OPENDDS_LIB_DIR}$<$>:/$>") + if(WIN32) + string(REPLACE "/" "\\" lib_dir_list "${lib_dir_list}") + string(REPLACE ";" "\;" lib_dir_list "${lib_dir_list}") + endif() list(APPEND env "${env_var_name}=${lib_dir_list}") if(DEFINED OPENDDS_BUILD_DIR) list(APPEND env "OPENDDS_BUILD_DIR=${OPENDDS_BUILD_DIR}") From 8688bd4f5cd1c47435ccd59d7448191b43a7a4ae Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Tue, 20 Jun 2023 20:40:25 -0500 Subject: [PATCH 015/140] Add Security, Expand Testing --- CMakeLists.txt | 17 +++--- cmake/opendds_testing.cmake | 29 ++++++++-- cmake/tao_idl_sources.cmake | 6 +- dds/DCPS/Service_Participant.cpp | 9 +++ dds/DCPS/security/CMakeLists.txt | 37 ++++++++++++ .../rtps_udp/RtpsUdpSendStrategy.cpp | 10 ++-- tests/DCPS/Messenger/publisher.cpp | 56 ++++++++----------- tests/DCPS/Messenger/subscriber.cpp | 55 ++++++++---------- .../Messenger/Messenger_2/CMakeLists.txt | 22 +++++++- tests/cmake/ace_tao_only/CMakeLists.txt | 4 +- 10 files changed, 160 insertions(+), 85 deletions(-) create mode 100644 dds/DCPS/security/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ec0701efec..c5771a7701c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,6 @@ add_library(OpenDDS_Dcps dds/DCPS/ConnectionRecords.cpp dds/DCPS/ContentFilteredTopicImpl.cpp dds/DCPS/DCPS_Utils.cpp - # dds/DCPS/DataCollector_T.cpp dds/DCPS/DataCollector_T.inl dds/DCPS/DataDurabilityCache.cpp dds/DCPS/DataReaderImpl.cpp @@ -102,7 +101,6 @@ add_library(OpenDDS_Dcps dds/DCPS/MessageTracker.cpp dds/DCPS/MonitorFactory.cpp dds/DCPS/MultiTopicDataReaderBase.cpp - # dds/DCPS/MultiTopicDataReader_T.cpp dds/DCPS/MultiTopicImpl.cpp dds/DCPS/MulticastManager.cpp dds/DCPS/NetworkAddress.cpp @@ -117,7 +115,6 @@ add_library(OpenDDS_Dcps dds/DCPS/Qos_Helper.cpp dds/DCPS/Qos_Helper.inl dds/DCPS/QueryConditionImpl.cpp - # dds/DCPS/RakeResults_T.cpp dds/DCPS/RawDataSample.cpp dds/DCPS/ReactorInterceptor.cpp dds/DCPS/ReactorTask.cpp @@ -155,7 +152,6 @@ add_library(OpenDDS_Dcps dds/DCPS/ThreadStatusManager.cpp dds/DCPS/TimeDuration.cpp dds/DCPS/TimeDuration.inl - # dds/DCPS/TimePoint_T.cpp dds/DCPS/TimePoint_T.inl dds/DCPS/Time_Helper.cpp dds/DCPS/Time_Helper.inl @@ -187,11 +183,13 @@ add_library(OpenDDS_Dcps dds/DCPS/XTypes/TypeLookupService.cpp dds/DCPS/XTypes/TypeObject.cpp dds/DCPS/XTypes/Utils.cpp - # dds/DCPS/ZeroCopyAllocator_T.cpp dds/DCPS/ZeroCopyAllocator_T.inl - # dds/DCPS/ZeroCopySeq_T.cpp dds/DCPS/ZeroCopySeq_T.inl dds/DCPS/debug.cpp + dds/DCPS/security/framework/HandleRegistry.cpp + dds/DCPS/security/framework/SecurityConfig.cpp + dds/DCPS/security/framework/SecurityPluginInst.cpp + dds/DCPS/security/framework/SecurityRegistry.cpp dds/DCPS/transport/framework/BuildChainVisitor.cpp dds/DCPS/transport/framework/BuildChainVisitor.inl dds/DCPS/transport/framework/CopyChainVisitor.cpp @@ -266,7 +264,6 @@ add_library(OpenDDS_Dcps dds/DCPS/transport/framework/TransportReassembly.cpp dds/DCPS/transport/framework/TransportReceiveListener.cpp dds/DCPS/transport/framework/TransportReceiveStrategy.cpp - # dds/DCPS/transport/framework/TransportReceiveStrategy_T.cpp dds/DCPS/transport/framework/TransportReceiveStrategy_T.inl dds/DCPS/transport/framework/TransportRegistry.cpp dds/DCPS/transport/framework/TransportRegistry.inl @@ -287,6 +284,9 @@ add_library(OpenDDS_Dcps dds/DCPS/transport/framework/TransportStrategy.cpp dds/DCPS/transport/framework/TransportType.cpp ) +if(OPENDDS_SECURITY) + target_compile_definitions(OpenDDS_Dcps PUBLIC OPENDDS_SECURITY=1) +endif() _opendds_library(OpenDDS_Dcps MSVC_BIGOBJ) target_include_directories(OpenDDS_Dcps PUBLIC @@ -373,6 +373,9 @@ add_subdirectory(dds/DCPS/InfoRepoDiscovery) add_subdirectory(dds/DCPS/transport/udp) add_subdirectory(dds/InfoRepo) +if(OPENDDS_SECURITY) + add_subdirectory(dds/DCPS/security) +endif() add_subdirectory(DevGuideExamples/DCPS/Messenger) add_subdirectory(tests/cmake/ace_tao_only) diff --git a/cmake/opendds_testing.cmake b/cmake/opendds_testing.cmake index 6e6f5c0e667..1df5808e455 100644 --- a/cmake/opendds_testing.cmake +++ b/cmake/opendds_testing.cmake @@ -1,7 +1,7 @@ function(_opendds_add_test) set(no_value_options) set(single_value_options NAME) - set(multi_value_options COMMAND) + set(multi_value_options COMMAND ARGS) cmake_parse_arguments(arg "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) @@ -9,28 +9,47 @@ function(_opendds_add_test) if(arg_NAME) set(test_name "${test_name}_${arg_NAME}") endif() - add_test(NAME "${test_name}" ${arg_UNPARSED_ARGUMENTS} - COMMAND ${arg_COMMAND} $<$>:-ExeSubDir> $) + if(NOT arg_COMMAND) + set(arg_COMMAND ${PERL_EXECUTABLE} run_test.pl) + if(CMAKE_CONFIGURATION_TYPES) + list(APPEND arg_COMMAND $<$>:-ExeSubDir> $) + endif() + endif() + list(APPEND arg_COMMAND ${arg_ARGS}) + add_test(NAME "${test_name}" ${arg_UNPARSED_ARGUMENTS} COMMAND ${arg_COMMAND}) + set(env "ACE_ROOT=${ACE_ROOT}" "TAO_ROOT=${TAO_ROOT}") + if(MSVC) set(env_var_name PATH) else() set(env_var_name LD_LIBRARY_PATH) endif() - _opendds_path_list(lib_dir_list - "$ENV{${env_var_name}}" "${TAO_LIB_DIR}" "${OPENDDS_LIB_DIR}$<$>:/$>") + set(opendds_lib_dir "${OPENDDS_LIB_DIR}") + if(CMAKE_CONFIGURATION_TYPES) + set(opendds_lib_dir "${opendds_lib_dir}$<$>:/$>") + endif() + _opendds_path_list(lib_dir_list "$ENV{${env_var_name}}" "${TAO_LIB_DIR}" "${opendds_lib_dir}") if(WIN32) string(REPLACE "/" "\\" lib_dir_list "${lib_dir_list}") string(REPLACE ";" "\;" lib_dir_list "${lib_dir_list}") endif() list(APPEND env "${env_var_name}=${lib_dir_list}") + if(DEFINED OPENDDS_BUILD_DIR) list(APPEND env "OPENDDS_BUILD_DIR=${OPENDDS_BUILD_DIR}") endif() + + if(DEFINED OPENDDS_TEST_CONFIG_DIR) + list(APPEND env "OPENDDS_TEST_CONFIG_DIR=${OPENDDS_TEST_CONFIG_DIR}") + endif() + if(DEFINED OPENDDS_SOURCE_ROOT) _opendds_path_list(perl5lib "${OPENDDS_SOURCE_ROOT}/bin" "${ACE_ROOT}/bin") list(APPEND env "PERL5LIB=${perl5lib}") + list(APPEND env "OPENDDS_SOURCE_ROOT=${OPENDDS_SOURCE_ROOT}") endif() + if(env) set_property(TEST "${test_name}" PROPERTY ENVIRONMENT "${env}") endif() diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index 42131106816..1f172a5fabc 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -7,7 +7,11 @@ function(_opendds_tao_append_runtime_lib_dir_to_path dst) else() set(env_var_name LD_LIBRARY_PATH) endif() - _opendds_path_list(path_list "$ENV{${env_var_name}}" "${TAO_LIB_DIR}" "$") + set(path_list "$ENV{${env_var_name}}" "${TAO_LIB_DIR}") + if(TARGET OpenDDS::Util) + list(APPEND path_list "$") + endif() + _opendds_path_list(path_list ${path_list}) if(NOT MSVC) string(REPLACE "\\" "/" path_list "${path_list}") endif() diff --git a/dds/DCPS/Service_Participant.cpp b/dds/DCPS/Service_Participant.cpp index efa743b6917..cbc850752f6 100644 --- a/dds/DCPS/Service_Participant.cpp +++ b/dds/DCPS/Service_Participant.cpp @@ -502,6 +502,15 @@ Service_Participant::get_domain_participant_factory(int &argc, } } else { + // Convenient way to run tests in a different place from ini files. + const char* const config_dir = ACE_OS::getenv("OPENDDS_TEST_CONFIG_DIR"); + if (config_dir && config_dir[0]) { + String new_path = config_dir; + new_path += ACE_DIRECTORY_SEPARATOR_CHAR_A; + new_path += config_fname; + config_fname = new_path; + } + // Load configuration only if the configuration // file exists. FILE* in = ACE_OS::fopen(config_fname.c_str(), diff --git a/dds/DCPS/security/CMakeLists.txt b/dds/DCPS/security/CMakeLists.txt new file mode 100644 index 00000000000..9e75cf38421 --- /dev/null +++ b/dds/DCPS/security/CMakeLists.txt @@ -0,0 +1,37 @@ +project(opendds_security CXX) + +set(deps OpenDDS::Rtps ACE::XML_Utils) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps} security=TRUE) +include(opendds_build_helpers) + +add_library(OpenDDS_Security + AccessControl/Governance.cpp + AccessControl/LocalAccessCredentialData.cpp + AccessControl/Permissions.cpp + AccessControl/XmlUtils.cpp + AccessControlBuiltInImpl.cpp + Authentication/LocalAuthCredentialData.cpp + AuthenticationBuiltInImpl.cpp + BuiltInPluginLoader.cpp + BuiltInPlugins.cpp + BuiltInSecurityPluginInst.cpp + CommonUtilities.cpp + CryptoBuiltInImpl.cpp + SSL/Certificate.cpp + SSL/DiffieHellman.cpp + SSL/PrivateKey.cpp + SSL/SignedDocument.cpp + SSL/SubjectName.cpp + SSL/Utils.cpp + TokenReader.cpp + TokenWriter.cpp + UtilityImpl.cpp +) +_opendds_library(OpenDDS_Security) +target_link_libraries(OpenDDS_Security PUBLIC ${deps} PRIVATE OpenSSL::Crypto) +opendds_target_sources(OpenDDS_Security + PUBLIC + CryptoBuiltIn.idl + INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + USE_EXPORT "dds/DCPS/security/OpenDDS_Security_Export.h" OpenDDS_Security_Export +) diff --git a/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp b/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp index a6c31dfa6d2..6ad85247422 100644 --- a/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp +++ b/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp @@ -57,7 +57,7 @@ RtpsUdpSendStrategy::RtpsUdpSendStrategy(RtpsUdpDataLink* link, } namespace { - bool shouldWarn(int code) { + bool ss_shouldWarn(int code) { return code == EPERM || code == EACCES || code == EINTR || code == ENOBUFS || code == ENOMEM || code == EADDRNOTAVAIL || code == ENETUNREACH; } @@ -68,7 +68,7 @@ RtpsUdpSendStrategy::send_bytes_i(const iovec iov[], int n) { ssize_t result = send_bytes_i_helper(iov, n); - if (result == -1 && shouldWarn(errno)) { + if (result == -1 && ss_shouldWarn(errno)) { // Make the framework think this was a successful send to avoid // putting the send strategy in suspended mode. If reliability // is enabled, the data may be resent later. @@ -191,7 +191,7 @@ RtpsUdpSendStrategy::send_rtps_control(RTPS::Message& message, const int num_blocks = mb_to_iov(use_mb, iov); const ssize_t result = send_single_i(iov, num_blocks, addr); if (result < 0 && !network_is_unreachable_) { - const ACE_Log_Priority prio = shouldWarn(errno) ? LM_WARNING : LM_ERROR; + const ACE_Log_Priority prio = ss_shouldWarn(errno) ? LM_WARNING : LM_ERROR; ACE_ERROR((prio, "(%P|%t) RtpsUdpSendStrategy::send_rtps_control() - " "failed to send RTPS control message\n")); } @@ -231,7 +231,7 @@ RtpsUdpSendStrategy::send_rtps_control(RTPS::Message& message, const int num_blocks = mb_to_iov(use_mb, iov); const ssize_t result = send_multi_i(iov, num_blocks, addrs); if (result < 0 && !network_is_unreachable_) { - const ACE_Log_Priority prio = shouldWarn(errno) ? LM_WARNING : LM_ERROR; + const ACE_Log_Priority prio = ss_shouldWarn(errno) ? LM_WARNING : LM_ERROR; ACE_ERROR((prio, "(%P|%t) RtpsUdpSendStrategy::send_rtps_control() - " "failed to send RTPS control message\n")); } @@ -326,7 +326,7 @@ RtpsUdpSendStrategy::send_single_i(const iovec iov[], int n, const int err = errno; if (err != ENETUNREACH || !network_is_unreachable_) { errno = err; - const ACE_Log_Priority prio = shouldWarn(errno) ? LM_WARNING : LM_ERROR; + const ACE_Log_Priority prio = ss_shouldWarn(errno) ? LM_WARNING : LM_ERROR; ACE_ERROR((prio, "(%P|%t) RtpsUdpSendStrategy::send_single_i() - " "destination %C failed send: %m\n", DCPS::LogAddr(addr).c_str())); if (errno == EMSGSIZE) { diff --git a/tests/DCPS/Messenger/publisher.cpp b/tests/DCPS/Messenger/publisher.cpp index 01a2ec50e5a..256c1ea434e 100644 --- a/tests/DCPS/Messenger/publisher.cpp +++ b/tests/DCPS/Messenger/publisher.cpp @@ -36,15 +36,6 @@ #include -#ifdef OPENDDS_SECURITY -const char auth_ca_file_from_tests[] = "security/certs/identity/identity_ca_cert.pem"; -const char perm_ca_file_from_tests[] = "security/certs/permissions/permissions_ca_cert.pem"; -const char id_cert_file_from_tests[] = "security/certs/identity/test_participant_01_cert.pem"; -const char id_key_file_from_tests[] = "security/certs/identity/test_participant_01_private_key.pem"; -const char governance_file[] = "file:./governance_signed.p7s"; -const char permissions_file[] = "file:./permissions_1_signed.p7s"; -#endif - bool dw_reliable() { OpenDDS::DCPS::TransportConfig_rch gc = TheTransportRegistry->global_config(); @@ -52,9 +43,11 @@ bool dw_reliable() !(gc->instances_[0]->transport_type_ == "multicast" && !gc->instances_[0]->is_reliable()); } -void append(DDS::PropertySeq& props, const char* name, const char* value, bool propagate = false) +using OpenDDS::DCPS::String; + +void append(DDS::PropertySeq& props, const String& name, const String& value, bool propagate = false) { - const DDS::Property_t prop = {name, value, propagate}; + const DDS::Property_t prop = {name.c_str(), value.c_str(), propagate}; const unsigned int len = props.length(); props.length(len + 1); props[len] = prop; @@ -85,29 +78,28 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) append(props, "OpenDDS.RtpsRelay.Groups", "Messenger", true); #ifdef OPENDDS_SECURITY - using OpenDDS::DCPS::String; - // Determine the path to the keys - String path_to_tests; - const char* dds_root = ACE_OS::getenv("DDS_ROOT"); - if (dds_root && dds_root[0]) { - // Use DDS_ROOT in case we are one of the CMake tests - path_to_tests = String("file:") + dds_root + "/tests/"; - } else { - // Else if DDS_ROOT isn't defined try to do it relative to the traditional location - path_to_tests = "file:../../"; - } - const String auth_ca_file = path_to_tests + auth_ca_file_from_tests; - const String perm_ca_file = path_to_tests + perm_ca_file_from_tests; - const String id_cert_file = path_to_tests + id_cert_file_from_tests; - const String id_key_file = path_to_tests + id_key_file_from_tests; if (TheServiceParticipant->get_security()) { + // Determine the path to the keys + String path_to_tests; + const char* const source_root = ACE_OS::getenv("OPENDDS_SOURCE_ROOT"); + if (source_root && source_root[0]) { + // Use OPENDDS_SOURCE_ROOT in case we are one of the CMake tests + path_to_tests = String("file:") + source_root + "/tests/"; + } else { + // Else try to do it relative to the traditional location + path_to_tests = "file:../../"; + } + + const String certs = path_to_tests + "security/certs/"; + const String identity = certs + "identity/"; + const String messenger = path_to_tests + "DCPS/Messenger/"; using namespace DDS::Security::Properties; - append(props, AuthIdentityCA, auth_ca_file.c_str()); - append(props, AuthIdentityCertificate, id_cert_file.c_str()); - append(props, AuthPrivateKey, id_key_file.c_str()); - append(props, AccessPermissionsCA, perm_ca_file.c_str()); - append(props, AccessGovernance, governance_file); - append(props, AccessPermissions, permissions_file); + append(props, AuthIdentityCA, identity + "identity_ca_cert.pem"); + append(props, AuthIdentityCertificate, identity + "test_participant_01_cert.pem"); + append(props, AuthPrivateKey, identity + "test_participant_01_private_key.pem"); + append(props, AccessPermissionsCA, certs + "permissions/permissions_ca_cert.pem"); + append(props, AccessGovernance, messenger + "governance_signed.p7s"); + append(props, AccessPermissions, messenger + "permissions_1_signed.p7s"); } #endif diff --git a/tests/DCPS/Messenger/subscriber.cpp b/tests/DCPS/Messenger/subscriber.cpp index 56867d29769..7a6e5317fcc 100644 --- a/tests/DCPS/Messenger/subscriber.cpp +++ b/tests/DCPS/Messenger/subscriber.cpp @@ -30,18 +30,12 @@ #endif #include -#ifdef OPENDDS_SECURITY -const char auth_ca_file_from_tests[] = "security/certs/identity/identity_ca_cert.pem"; -const char perm_ca_file_from_tests[] = "security/certs/permissions/permissions_ca_cert.pem"; -const char id_cert_file_from_tests[] = "security/certs/identity/test_participant_02_cert.pem"; -const char id_key_file_from_tests[] = "security/certs/identity/test_participant_02_private_key.pem"; -const char governance_file[] = "file:./governance_signed.p7s"; -const char permissions_file[] = "file:./permissions_2_signed.p7s"; -#endif -void append(DDS::PropertySeq& props, const char* name, const char* value, bool propagate = false) +using OpenDDS::DCPS::String; + +void append(DDS::PropertySeq& props, const String& name, const String& value, bool propagate = false) { - const DDS::Property_t prop = {name, value, propagate}; + const DDS::Property_t prop = {name.c_str(), value.c_str(), propagate}; const unsigned int len = props.length(); props.length(len + 1); props[len] = prop; @@ -67,29 +61,28 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) append(props, "OpenDDS.RtpsRelay.Groups", "Messenger", true); #ifdef OPENDDS_SECURITY - using OpenDDS::DCPS::String; - // Determine the path to the keys - String path_to_tests; - const char* dds_root = ACE_OS::getenv("DDS_ROOT"); - if (dds_root && dds_root[0]) { - // Use DDS_ROOT in case we are one of the CMake tests - path_to_tests = String("file:") + dds_root + "/tests/"; - } else { - // Else if DDS_ROOT isn't defined try to do it relative to the traditional location - path_to_tests = "file:../../"; - } - const String auth_ca_file = path_to_tests + auth_ca_file_from_tests; - const String perm_ca_file = path_to_tests + perm_ca_file_from_tests; - const String id_cert_file = path_to_tests + id_cert_file_from_tests; - const String id_key_file = path_to_tests + id_key_file_from_tests; if (TheServiceParticipant->get_security()) { + // Determine the path to the keys + String path_to_tests; + const char* const source_root = ACE_OS::getenv("OPENDDS_SOURCE_ROOT"); + if (source_root && source_root[0]) { + // Use OPENDDS_SOURCE_ROOT in case we are one of the CMake tests + path_to_tests = String("file:") + source_root + "/tests/"; + } else { + // Else try to do it relative to the traditional location + path_to_tests = "file:../../"; + } + + const String certs = path_to_tests + "security/certs/"; + const String identity = certs + "identity/"; + const String messenger = path_to_tests + "DCPS/Messenger/"; using namespace DDS::Security::Properties; - append(props, AuthIdentityCA, auth_ca_file.c_str()); - append(props, AuthIdentityCertificate, id_cert_file.c_str()); - append(props, AuthPrivateKey, id_key_file.c_str()); - append(props, AccessPermissionsCA, perm_ca_file.c_str()); - append(props, AccessGovernance, governance_file); - append(props, AccessPermissions, permissions_file); + append(props, AuthIdentityCA, identity + "identity_ca_cert.pem"); + append(props, AuthIdentityCertificate, identity + "test_participant_02_cert.pem"); + append(props, AuthPrivateKey, identity + "test_participant_02_private_key.pem"); + append(props, AccessPermissionsCA, certs + "permissions/permissions_ca_cert.pem"); + append(props, AccessGovernance, messenger + "governance_signed.p7s"); + append(props, AccessPermissions, messenger + "permissions_2_signed.p7s"); } #endif diff --git a/tests/cmake/Messenger/Messenger_2/CMakeLists.txt b/tests/cmake/Messenger/Messenger_2/CMakeLists.txt index 7887b40d83c..993076f1ea4 100644 --- a/tests/cmake/Messenger/Messenger_2/CMakeLists.txt +++ b/tests/cmake/Messenger/Messenger_2/CMakeLists.txt @@ -25,8 +25,8 @@ set(dst ${CMAKE_CURRENT_BINARY_DIR}) set(all_targets ${publisher} ${subscriber} ${messenger}) foreach(file - Messenger.idl subscriber.cpp publisher.cpp Args.h - DataReaderListener.cpp DataReaderListener.h pub.ini sub.ini) + Messenger.idl subscriber.cpp publisher.cpp Args.h + DataReaderListener.cpp DataReaderListener.h) configure_file(${src}/${file} ${dst}/${file} COPYONLY) endforeach() @@ -61,4 +61,20 @@ target_link_libraries(${subscriber} ${messenger} OpenDDS::OpenDDS) # Testing configure_file("${src}/run_test.pl" . COPYONLY) -_opendds_add_test(COMMAND perl run_test.pl) +set(OPENDDS_TEST_CONFIG_DIR "${src}") +_opendds_add_test(NAME tcp) +_opendds_add_test(NAME default_tcp ARGS default_tcp) +_opendds_add_test(NAME thread_per ARGS thread_per) +_opendds_add_test(NAME shmem ARGS shmem) +_opendds_add_test(NAME nobits ARGS nobits) +# _opendds_add_test(NAME stack ARGS stack) +# _opendds_add_test(NAME ipv6 ARGS ipv6) +_opendds_add_test(NAME rtps ARGS rtps) +_opendds_add_test(NAME rtps_unicast ARGS rtps_unicast) +_opendds_add_test(NAME rtps_disc ARGS rtps_disc) +_opendds_add_test(NAME rtps_disc_tcp ARGS rtps_disc_tcp) +_opendds_add_test(NAME rtps_disc_tcp_thread_per ARGS rtps_disc_tcp thread_per) +_opendds_add_test(NAME rtps_disc_tcp_udp ARGS rtps_disc_tcp_udp) +_opendds_add_test(NAME rtps_disc_half_sec_pub ARGS rtps_disc_half_sec_pub) +_opendds_add_test(NAME rtps_disc_half_sec_sub ARGS rtps_disc_half_sec_sub) +_opendds_add_test(NAME rtps_disc_sec ARGS rtps_disc_sec) diff --git a/tests/cmake/ace_tao_only/CMakeLists.txt b/tests/cmake/ace_tao_only/CMakeLists.txt index 62529b66e52..beabfed9bfb 100644 --- a/tests/cmake/ace_tao_only/CMakeLists.txt +++ b/tests/cmake/ace_tao_only/CMakeLists.txt @@ -44,12 +44,14 @@ endforeach() add_library(${idl}) opendds_target_sources(${idl} PUBLIC "${dst}/${idl_file}" + SKIP_OPENDDS_IDL GENERATE_SERVER_SKELETONS TRUE ) +target_link_libraries(${idl} PUBLIC TAO::PortableServer) add_executable(${server} ${server_files}) set_target_properties(${server} PROPERTIES OUTPUT_NAME MessengerServer) -target_link_libraries(${server} ${idl} TAO::PortableServer) +target_link_libraries(${server} ${idl}) add_executable(${client} ${client_files}) set_target_properties(${client} PROPERTIES OUTPUT_NAME MessengerClient) From 0d323ad580e0450fcdbfc2390a359f2544edbd56 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Thu, 22 Jun 2023 15:23:10 -0500 Subject: [PATCH 016/140] Auto Initialize Static Plugins This uses macros set in CMake to include library init headers in StaticIncludes.h as necessary. For right now this only works in CMake and only when __has_include and a config.h is present to tell OpenDDS it's doing this. --- CMakeLists.txt | 3 ++ DevGuideExamples/DCPS/Messenger/Publisher.cpp | 2 +- .../DCPS/Messenger/Subscriber.cpp | 2 +- cmake/config.h.in | 8 ++++ cmake/opendds_build_helpers.cmake | 1 + dds/DCPS/Definitions.h | 14 +++++++ dds/DCPS/StaticIncludes.h | 40 ++++++++++++++++++- .../security/framework/SecurityRegistry.cpp | 9 +---- tests/DCPS/Messenger/publisher.cpp | 2 +- tests/DCPS/Messenger/subscriber.cpp | 2 +- 10 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 cmake/config.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index c5771a7701c..0b73fee3351 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,6 +364,9 @@ opendds_target_sources(OpenDDS_Dcps ${opendds_target_sources_args} ) +get_target_property(gendir OpenDDS_Dcps OPENDDS_GENERATED_DIRECTORY) +configure_file("${_OPENDDS_CMAKE_DIR}/config.h.in" "${gendir}/dds/DCPS/config.h") + add_subdirectory(dds/DCPS/transport/multicast) add_subdirectory(dds/DCPS/RTPS) add_subdirectory(dds/DCPS/transport/rtps_udp) diff --git a/DevGuideExamples/DCPS/Messenger/Publisher.cpp b/DevGuideExamples/DCPS/Messenger/Publisher.cpp index 1db19ab3c6c..f417697fe2f 100644 --- a/DevGuideExamples/DCPS/Messenger/Publisher.cpp +++ b/DevGuideExamples/DCPS/Messenger/Publisher.cpp @@ -9,7 +9,7 @@ #include #include #include -#ifdef ACE_AS_STATIC_LIBS +#if OPENDDS_DO_MANNUAL_STATIC_INCLUDES # include # include #endif diff --git a/DevGuideExamples/DCPS/Messenger/Subscriber.cpp b/DevGuideExamples/DCPS/Messenger/Subscriber.cpp index fe0bde61b9f..3a248b6745a 100644 --- a/DevGuideExamples/DCPS/Messenger/Subscriber.cpp +++ b/DevGuideExamples/DCPS/Messenger/Subscriber.cpp @@ -10,7 +10,7 @@ #include #include #include -#ifdef ACE_AS_STATIC_LIBS +#if OPENDDS_DO_MANNUAL_STATIC_INCLUDES # include # include #endif diff --git a/cmake/config.h.in b/cmake/config.h.in new file mode 100644 index 00000000000..ce9d6af60b8 --- /dev/null +++ b/cmake/config.h.in @@ -0,0 +1,8 @@ +#ifndef OPENDDS_DCPS_CONFIG_EXPORT_H +#define OPENDDS_DCPS_CONFIG_EXPORT_H + +#include + +#define OPENDDS_USES_AUTO_STATIC_INCLUDES 1 + +#endif diff --git a/cmake/opendds_build_helpers.cmake b/cmake/opendds_build_helpers.cmake index 65596b9da20..24ec3c9fe51 100644 --- a/cmake/opendds_build_helpers.cmake +++ b/cmake/opendds_build_helpers.cmake @@ -26,6 +26,7 @@ function(_opendds_library target) RUNTIME_OUTPUT_DIRECTORY "${OPENDDS_LIB_DIR}" LIBRARY_OUTPUT_DIRECTORY "${OPENDDS_LIB_DIR}" ARCHIVE_OUTPUT_DIRECTORY "${OPENDDS_LIB_DIR}" + POSITION_INDEPENDENT_CODE TRUE ) get_target_property(target_type ${target} TYPE) diff --git a/dds/DCPS/Definitions.h b/dds/DCPS/Definitions.h index 2501ff56127..f401b22530a 100644 --- a/dds/DCPS/Definitions.h +++ b/dds/DCPS/Definitions.h @@ -6,6 +6,10 @@ #ifndef OPENDDS_DCPS_DEFINITIONS_H #define OPENDDS_DCPS_DEFINITIONS_H +#if defined __has_include && __has_include() +# include +#endif + #include #include @@ -89,6 +93,16 @@ # define OPENDDS_GCC_HAS_DIAG_PUSHPOP 0 #endif +#ifndef OPENDDS_USES_AUTO_STATIC_INCLUDES +# define OPENDDS_USES_AUTO_STATIC_INCLUDES 0 +#endif + +#if !OPENDDS_USES_AUTO_STATIC_INCLUDES && defined(ACE_AS_STATIC_LIBS) +# define OPENDDS_DO_MANNUAL_STATIC_INCLUDES 1 +#else +# define OPENDDS_DO_MANNUAL_STATIC_INCLUDES 0 +#endif + OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL namespace OpenDDS { diff --git a/dds/DCPS/StaticIncludes.h b/dds/DCPS/StaticIncludes.h index 59a418a1128..e5fc6d72957 100644 --- a/dds/DCPS/StaticIncludes.h +++ b/dds/DCPS/StaticIncludes.h @@ -1,10 +1,48 @@ #ifndef OPENDDS_DCPS_STATICINCLUDES_H #define OPENDDS_DCPS_STATICINCLUDES_H +#include "Definitions.h" + +#if OPENDDS_USES_AUTO_STATIC_INCLUDES +// Explict checks depend on *_HAS_DLL macros being set to 0 to initialize static +// plugins. + +# if defined OPENDDS_INFOREPODISCOVERY_HAS_DLL && !OPENDDS_INFOREPODISCOVERY_HAS_DLL +# include "InfoRepoDiscovery/InfoRepoDiscovery.h" +# endif + +# if defined OPENDDS_RTPS_HAS_DLL && !OPENDDS_RTPS_HAS_DLL +# include "RTPS/RtpsDiscovery.h" +# endif + +# if defined OPENDDS_TCP_HAS_DLL && !OPENDDS_TCP_HAS_DLL +# include "transport/tcp/Tcp.h" +# endif + +# if defined OPENDDS_RTPS_UDP_HAS_DLL && !OPENDDS_RTPS_UDP_HAS_DLL +# include "transport/rtps_udp/RtpsUdp.h" +# endif + +# if defined OPENDDS_UDP_HAS_DLL && !OPENDDS_UDP_HAS_DLL +# include "transport/udp/Udp.h" +# endif + +# if defined OPENDDS_SHMEM_HAS_DLL && !OPENDDS_SHMEM_HAS_DLL +# include "transport/shmem/Shmem.h" +# endif + +# if defined OPENDDS_MULTICAST_HAS_DLL && !OPENDDS_MULTICAST_HAS_DLL +# include "transport/multicast/Multicast.h" +# endif + +# if defined OPENDDS_SECURITY_HAS_DLL && !OPENDDS_SECURITY_HAS_DLL +# include "security/BuiltInPlugins.h" +# endif + +#elif OPENDDS_DO_MANNUAL_STATIC_INCLUDES // Only for static builds, include default libraries for both discovery // and transport. This file will be included by the code in the executable // so that the static link includes the initializers for these libraries. -#ifdef ACE_AS_STATIC_LIBS # ifdef OPENDDS_SAFETY_PROFILE # include "StaticDiscovery.h" # include "RTPS/RtpsDiscovery.h" diff --git a/dds/DCPS/security/framework/SecurityRegistry.cpp b/dds/DCPS/security/framework/SecurityRegistry.cpp index f95cb4f20ba..9aaa1fbc490 100644 --- a/dds/DCPS/security/framework/SecurityRegistry.cpp +++ b/dds/DCPS/security/framework/SecurityRegistry.cpp @@ -277,18 +277,16 @@ SecurityRegistry::default_config(const SecurityConfig_rch& config) SecurityConfig_rch SecurityRegistry::builtin_config() const { -#if defined(OPENDDS_SECURITY) +#ifdef OPENDDS_SECURITY GuardType g1(default_load_lock_); GuardType guard(lock_); if (!builtin_config_) { -#if !defined(ACE_AS_STATIC_LIBS) LibDirectiveMap::const_iterator lib_iter = lib_directive_map_.find(DEFAULT_PLUGIN_NAME); OPENDDS_ASSERT(lib_iter != lib_directive_map_.end()); ACE_TString directive = ACE_TEXT_CHAR_TO_TCHAR(lib_iter->second.c_str()); guard.release(); ACE_Service_Config::process_directive(directive.c_str()); guard.acquire(); -#endif } #endif return builtin_config_; @@ -372,8 +370,6 @@ SecurityRegistry::load_security_configuration(ACE_Configuration_Heap& cf) void SecurityRegistry::load_security_plugin_lib(const OPENDDS_STRING& security_plugin_type) { - ACE_UNUSED_ARG(security_plugin_type); -#if !defined(ACE_AS_STATIC_LIBS) GuardType guard(lock_); LibDirectiveMap::iterator lib_iter = lib_directive_map_.find(security_plugin_type); if (lib_iter != lib_directive_map_.end()) { @@ -381,7 +377,6 @@ SecurityRegistry::load_security_plugin_lib(const OPENDDS_STRING& security_plugin guard.release(); ACE_Service_Config::process_directive(directive.c_str()); } -#endif } bool @@ -426,7 +421,6 @@ SecurityPluginInst_rch SecurityRegistry::get_plugin_inst( SecurityPluginInst_rch plugin_inst; if (find(registered_plugins_, plugin_name, plugin_inst) != 0 && attempt_fix) { -#if !defined(ACE_AS_STATIC_LIBS) guard.release(); // Not present, try to load library load_security_plugin_lib(plugin_name); @@ -434,7 +428,6 @@ SecurityPluginInst_rch SecurityRegistry::get_plugin_inst( // Try to find it again find(registered_plugins_, plugin_name, plugin_inst); -#endif } return plugin_inst; diff --git a/tests/DCPS/Messenger/publisher.cpp b/tests/DCPS/Messenger/publisher.cpp index 256c1ea434e..d81c587ff3c 100644 --- a/tests/DCPS/Messenger/publisher.cpp +++ b/tests/DCPS/Messenger/publisher.cpp @@ -16,7 +16,7 @@ # include #endif #include -#ifdef ACE_AS_STATIC_LIBS +#if OPENDDS_DO_MANNUAL_STATIC_INCLUDES # ifndef OPENDDS_SAFETY_PROFILE # include # include diff --git a/tests/DCPS/Messenger/subscriber.cpp b/tests/DCPS/Messenger/subscriber.cpp index 7a6e5317fcc..93921f8de5b 100644 --- a/tests/DCPS/Messenger/subscriber.cpp +++ b/tests/DCPS/Messenger/subscriber.cpp @@ -16,7 +16,7 @@ # include #endif #include -#ifdef ACE_AS_STATIC_LIBS +#if OPENDDS_DO_MANNUAL_STATIC_INCLUDES # ifndef OPENDDS_SAFETY_PROFILE # include # include From df4d8d7ddc499859ac295d53811952957d6c5e2b Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Thu, 29 Jun 2023 19:16:41 -0500 Subject: [PATCH 017/140] CMake Install, RtpsRelay, inspect --- CMakeLists.txt | 504 +++++++++++++++--- cmake/OpenDDSConfig.cmake | 63 ++- cmake/OpenDDSConfigVersion.cmake | 10 +- cmake/init.cmake | 16 + cmake/opendds_build_helpers.cmake | 61 ++- cmake/opendds_installed_config.cmake.in | 3 + cmake/opendds_target_sources.cmake | 33 +- cmake/opendds_testing.cmake | 9 +- dds/DCPS/InfoRepoDiscovery/CMakeLists.txt | 15 +- dds/DCPS/RTPS/CMakeLists.txt | 25 +- dds/DCPS/security/CMakeLists.txt | 42 +- dds/DCPS/transport/multicast/CMakeLists.txt | 27 + dds/DCPS/transport/rtps_udp/CMakeLists.txt | 33 +- dds/DCPS/transport/shmem/CMakeLists.txt | 20 +- dds/DCPS/transport/tcp/CMakeLists.txt | 29 +- .../transport/tcp/TcpReceiveStrategy_rch.h | 0 dds/DCPS/transport/udp/CMakeLists.txt | 19 +- dds/InfoRepo/CMakeLists.txt | 17 +- dds/idl/CMakeLists.txt | 4 + tests/DCPS/Messenger/publisher.cpp | 4 +- tests/DCPS/Messenger/subscriber.cpp | 4 +- .../Messenger/Messenger_2/CMakeLists.txt | 4 +- tools/dds/rtpsrelaylib/CMakeLists.txt | 30 ++ tools/inspect/CMakeLists.txt | 11 + tools/rtpsrelay/CMakeLists.txt | 29 + tools/rtpsrelay/RelayThreadMonitor.cpp | 6 +- 26 files changed, 855 insertions(+), 163 deletions(-) create mode 100644 cmake/opendds_installed_config.cmake.in mode change 100755 => 100644 dds/DCPS/transport/tcp/TcpReceiveStrategy_rch.h create mode 100644 tools/dds/rtpsrelaylib/CMakeLists.txt create mode 100644 tools/inspect/CMakeLists.txt create mode 100644 tools/rtpsrelay/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b73fee3351..be7a935570d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,15 +3,18 @@ cmake_minimum_required(VERSION 3.22) project(opendds CXX) enable_testing() +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) +include(FetchContent) + set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") set(OPENDDS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") set(OPENDDS_BIN_DIR "${OPENDDS_BUILD_DIR}/bin" CACHE INTERNAL "") set(OPENDDS_LIB_DIR "${OPENDDS_BUILD_DIR}/lib" CACHE INTERNAL "") -set(OPENDDS_SOURCE_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "") -list(APPEND CMAKE_PREFIX_PATH "${OPENDDS_SOURCE_ROOT}") -list(APPEND CMAKE_FIND_ROOT_PATH "${OPENDDS_SOURCE_ROOT}") -set(_OPENDDS_CMAKE_DIR "${OPENDDS_SOURCE_ROOT}/cmake" CACHE INTERNAL "") -list(APPEND CMAKE_MODULE_PATH "${_OPENDDS_CMAKE_DIR}") +set(OPENDDS_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "") +list(APPEND CMAKE_PREFIX_PATH "${OPENDDS_SOURCE_DIR}") +list(APPEND CMAKE_FIND_ROOT_PATH "${OPENDDS_SOURCE_DIR}") +set(_OPENDDS_CMAKE_DIR "${OPENDDS_SOURCE_DIR}/cmake" CACHE INTERNAL "") include("${_OPENDDS_CMAKE_DIR}/opendds_features.cmake") @@ -27,6 +30,18 @@ if(DEFINED OPENDDS_HOST_TOOLS) set(_OPENDDS_OPENDDS_HOST_TOOLS "${OPENDDS_HOST_TOOLS}/bin" CACHE INTERNAL "") endif() +if(NOT DEFINED OPENDDS_RAPIDJSON) + set(OPENDDS_RAPIDJSON "${OPENDDS_SOURCE_DIR}/tools/rapidjson") + if(NOT EXISTS "${OPENDDS_RAPIDJSON}/include") + FetchContent_Declare(rapidjson + GIT_REPOSITORY https://github.com/Tencent/rapidjson.git + GIT_TAG fd3dc29a5c2852df569e1ea81dbde2c412ac5051 + ) + FetchContent_Populate(rapidjson) + set(OPENDDS_RAPIDJSON "${rapidjson_SOURCE_DIR}") + endif() +endif() + if(NOT CMAKE_CROSSCOMPILING) add_subdirectory(dds/DCPS) add_subdirectory(dds/idl) @@ -51,27 +66,21 @@ add_library(OpenDDS_Dcps dds/DCPS/BitPubListenerImpl.cpp dds/DCPS/BuiltInTopicUtils.cpp dds/DCPS/CoherentChangeControl.cpp - dds/DCPS/CoherentChangeControl.inl dds/DCPS/ConditionImpl.cpp dds/DCPS/ConfigStoreImpl.cpp dds/DCPS/ConfigUtils.cpp dds/DCPS/ConnectionRecords.cpp dds/DCPS/ContentFilteredTopicImpl.cpp dds/DCPS/DCPS_Utils.cpp - dds/DCPS/DataCollector_T.inl dds/DCPS/DataDurabilityCache.cpp dds/DCPS/DataReaderImpl.cpp - dds/DCPS/DataReaderImpl.inl dds/DCPS/DataSampleElement.cpp - dds/DCPS/DataSampleElement.inl dds/DCPS/DataSampleHeader.cpp - dds/DCPS/DataSampleHeader.inl dds/DCPS/DataWriterImpl.cpp dds/DCPS/DcpsUpcalls.cpp dds/DCPS/DdsDcps_pch.cpp dds/DCPS/Discovery.cpp dds/DCPS/DisjointSequence.cpp - dds/DCPS/DisjointSequence.inl dds/DCPS/DispatchService.cpp dds/DCPS/DomainParticipantFactoryImpl.cpp dds/DCPS/DomainParticipantImpl.cpp @@ -82,15 +91,12 @@ add_library(OpenDDS_Dcps dds/DCPS/GroupRakeData.cpp dds/DCPS/GuardCondition.cpp dds/DCPS/GuidBuilder.cpp - dds/DCPS/GuidBuilder.inl dds/DCPS/GuidConverter.cpp dds/DCPS/GuidUtils.cpp dds/DCPS/Hash.cpp dds/DCPS/InstanceDataSampleList.cpp - dds/DCPS/InstanceDataSampleList.inl dds/DCPS/InstanceHandle.cpp dds/DCPS/InstanceState.cpp - dds/DCPS/InstanceState.inl dds/DCPS/JobQueue.cpp dds/DCPS/LinuxNetworkConfigMonitor.cpp dds/DCPS/LogAddr.cpp @@ -107,21 +113,17 @@ add_library(OpenDDS_Dcps dds/DCPS/NetworkConfigModifier.cpp dds/DCPS/NetworkConfigMonitor.cpp dds/DCPS/NetworkResource.cpp - dds/DCPS/NetworkResource.inl dds/DCPS/Observer.cpp dds/DCPS/OwnershipManager.cpp dds/DCPS/PeriodicEvent.cpp dds/DCPS/PublisherImpl.cpp dds/DCPS/Qos_Helper.cpp - dds/DCPS/Qos_Helper.inl dds/DCPS/QueryConditionImpl.cpp dds/DCPS/RawDataSample.cpp dds/DCPS/ReactorInterceptor.cpp dds/DCPS/ReactorTask.cpp - dds/DCPS/ReactorTask.inl dds/DCPS/ReadConditionImpl.cpp dds/DCPS/ReceivedDataElementList.cpp - dds/DCPS/ReceivedDataElementList.inl dds/DCPS/ReceivedDataStrategy.cpp dds/DCPS/Recorder.cpp dds/DCPS/RecorderImpl.cpp @@ -129,20 +131,16 @@ add_library(OpenDDS_Dcps dds/DCPS/Replayer.cpp dds/DCPS/ReplayerImpl.cpp dds/DCPS/RepoIdBuilder.cpp - dds/DCPS/RepoIdBuilder.inl dds/DCPS/RepoIdConverter.cpp dds/DCPS/RepoIdGenerator.cpp dds/DCPS/SafetyProfilePool.cpp dds/DCPS/SafetyProfileSequences.cpp dds/DCPS/SafetyProfileStreams.cpp dds/DCPS/SendStateDataSampleList.cpp - dds/DCPS/SendStateDataSampleList.inl dds/DCPS/SequenceNumber.cpp dds/DCPS/Serializer.cpp - dds/DCPS/Serializer.inl dds/DCPS/ServiceEventDispatcher.cpp dds/DCPS/Service_Participant.cpp - dds/DCPS/Service_Participant.inl dds/DCPS/SporadicEvent.cpp dds/DCPS/StaticDiscovery.cpp dds/DCPS/StatusConditionImpl.cpp @@ -151,21 +149,16 @@ add_library(OpenDDS_Dcps dds/DCPS/ThreadPool.cpp dds/DCPS/ThreadStatusManager.cpp dds/DCPS/TimeDuration.cpp - dds/DCPS/TimeDuration.inl - dds/DCPS/TimePoint_T.inl dds/DCPS/Time_Helper.cpp - dds/DCPS/Time_Helper.inl dds/DCPS/TopicDescriptionImpl.cpp dds/DCPS/TopicImpl.cpp dds/DCPS/Transient_Kludge.cpp - dds/DCPS/Transient_Kludge.inl dds/DCPS/TypeSupportImpl.cpp dds/DCPS/ValueReader.cpp dds/DCPS/ValueWriter.cpp dds/DCPS/WaitSet.cpp dds/DCPS/WriteDataContainer.cpp dds/DCPS/WriterDataSampleList.cpp - dds/DCPS/WriterDataSampleList.inl dds/DCPS/WriterInfo.cpp dds/DCPS/XTypes/DynamicDataAdapter.cpp dds/DCPS/XTypes/DynamicDataBase.cpp @@ -183,110 +176,425 @@ add_library(OpenDDS_Dcps dds/DCPS/XTypes/TypeLookupService.cpp dds/DCPS/XTypes/TypeObject.cpp dds/DCPS/XTypes/Utils.cpp - dds/DCPS/ZeroCopyAllocator_T.inl - dds/DCPS/ZeroCopySeq_T.inl dds/DCPS/debug.cpp dds/DCPS/security/framework/HandleRegistry.cpp dds/DCPS/security/framework/SecurityConfig.cpp dds/DCPS/security/framework/SecurityPluginInst.cpp dds/DCPS/security/framework/SecurityRegistry.cpp dds/DCPS/transport/framework/BuildChainVisitor.cpp - dds/DCPS/transport/framework/BuildChainVisitor.inl dds/DCPS/transport/framework/CopyChainVisitor.cpp - dds/DCPS/transport/framework/CopyChainVisitor.inl dds/DCPS/transport/framework/DataLink.cpp - dds/DCPS/transport/framework/DataLink.inl dds/DCPS/transport/framework/DataLinkCleanupTask.cpp dds/DCPS/transport/framework/DataLinkSet.cpp - dds/DCPS/transport/framework/DataLinkSet.inl dds/DCPS/transport/framework/DirectPriorityMapper.cpp - dds/DCPS/transport/framework/DirectPriorityMapper.inl dds/DCPS/transport/framework/MessageDropper.cpp dds/DCPS/transport/framework/NullSynch.cpp - dds/DCPS/transport/framework/NullSynch.inl dds/DCPS/transport/framework/NullSynchStrategy.cpp dds/DCPS/transport/framework/PacketRemoveVisitor.cpp - dds/DCPS/transport/framework/PacketRemoveVisitor.inl dds/DCPS/transport/framework/PerConnectionSynch.cpp - dds/DCPS/transport/framework/PerConnectionSynch.inl dds/DCPS/transport/framework/PerConnectionSynchStrategy.cpp - dds/DCPS/transport/framework/PerConnectionSynchStrategy.inl dds/DCPS/transport/framework/PoolSynch.cpp - dds/DCPS/transport/framework/PoolSynch.inl dds/DCPS/transport/framework/PoolSynchStrategy.cpp - dds/DCPS/transport/framework/PoolSynchStrategy.inl dds/DCPS/transport/framework/PriorityKey.cpp - dds/DCPS/transport/framework/PriorityKey.inl dds/DCPS/transport/framework/PriorityMapper.cpp - dds/DCPS/transport/framework/PriorityMapper.inl dds/DCPS/transport/framework/QueueRemoveVisitor.cpp - dds/DCPS/transport/framework/QueueRemoveVisitor.inl dds/DCPS/transport/framework/ReactorSynch.cpp - dds/DCPS/transport/framework/ReactorSynch.inl dds/DCPS/transport/framework/ReactorSynchStrategy.cpp - dds/DCPS/transport/framework/ReactorSynchStrategy.inl dds/DCPS/transport/framework/ReceiveListenerSet.cpp - dds/DCPS/transport/framework/ReceiveListenerSet.inl dds/DCPS/transport/framework/ReceiveListenerSetMap.cpp - dds/DCPS/transport/framework/ReceiveListenerSetMap.inl dds/DCPS/transport/framework/ReceivedDataSample.cpp dds/DCPS/transport/framework/RemoveAllVisitor.cpp - dds/DCPS/transport/framework/RemoveAllVisitor.inl dds/DCPS/transport/framework/ScheduleOutputHandler.cpp - dds/DCPS/transport/framework/ScheduleOutputHandler.inl dds/DCPS/transport/framework/SendResponseListener.cpp dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.cpp - dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.inl dds/DCPS/transport/framework/ThreadPerConnectionSendTask.cpp dds/DCPS/transport/framework/ThreadSynch.cpp - dds/DCPS/transport/framework/ThreadSynch.inl dds/DCPS/transport/framework/ThreadSynchResource.cpp - dds/DCPS/transport/framework/ThreadSynchResource.inl dds/DCPS/transport/framework/ThreadSynchStrategy.cpp - dds/DCPS/transport/framework/ThreadSynchStrategy.inl dds/DCPS/transport/framework/ThreadSynchWorker.cpp - dds/DCPS/transport/framework/ThreadSynchWorker.inl dds/DCPS/transport/framework/TransportClient.cpp dds/DCPS/transport/framework/TransportConfig.cpp dds/DCPS/transport/framework/TransportControlElement.cpp - dds/DCPS/transport/framework/TransportControlElement.inl dds/DCPS/transport/framework/TransportCustomizedElement.cpp - dds/DCPS/transport/framework/TransportCustomizedElement.inl dds/DCPS/transport/framework/TransportDebug.cpp dds/DCPS/transport/framework/TransportHeader.cpp - dds/DCPS/transport/framework/TransportHeader.inl dds/DCPS/transport/framework/TransportImpl.cpp - dds/DCPS/transport/framework/TransportImpl.inl dds/DCPS/transport/framework/TransportInst.cpp - dds/DCPS/transport/framework/TransportInst.inl dds/DCPS/transport/framework/TransportQueueElement.cpp - dds/DCPS/transport/framework/TransportQueueElement.inl dds/DCPS/transport/framework/TransportReassembly.cpp dds/DCPS/transport/framework/TransportReceiveListener.cpp dds/DCPS/transport/framework/TransportReceiveStrategy.cpp - dds/DCPS/transport/framework/TransportReceiveStrategy_T.inl dds/DCPS/transport/framework/TransportRegistry.cpp - dds/DCPS/transport/framework/TransportRegistry.inl dds/DCPS/transport/framework/TransportReplacedElement.cpp - dds/DCPS/transport/framework/TransportReplacedElement.inl dds/DCPS/transport/framework/TransportRetainedElement.cpp - dds/DCPS/transport/framework/TransportRetainedElement.inl dds/DCPS/transport/framework/TransportSendBuffer.cpp - dds/DCPS/transport/framework/TransportSendBuffer.inl dds/DCPS/transport/framework/TransportSendControlElement.cpp - dds/DCPS/transport/framework/TransportSendControlElement.inl dds/DCPS/transport/framework/TransportSendElement.cpp - dds/DCPS/transport/framework/TransportSendElement.inl dds/DCPS/transport/framework/TransportSendListener.cpp dds/DCPS/transport/framework/TransportSendStrategy.cpp - dds/DCPS/transport/framework/TransportSendStrategy.inl dds/DCPS/transport/framework/TransportStatistics.cpp dds/DCPS/transport/framework/TransportStrategy.cpp dds/DCPS/transport/framework/TransportType.cpp ) -if(OPENDDS_SECURITY) - target_compile_definitions(OpenDDS_Dcps PUBLIC OPENDDS_SECURITY=1) -endif() +target_sources(OpenDDS_Dcps + PUBLIC FILE_SET HEADERS FILES + FACE/Fixed.h + FACE/OpenDDS_FACE_Export.h + FACE/Sequence.h + FACE/SequenceVar.h + FACE/StringManager.h + FACE/TS.hpp + FACE/TS_common.hpp + FACE/common.hpp + FACE/types.hpp + dds/DCPS/AddressCache.h + dds/DCPS/AssociationData.h + dds/DCPS/AstNodeWrapper.h + dds/DCPS/Atomic.h + dds/DCPS/AtomicBool.h + dds/DCPS/BitPubListenerImpl.h + dds/DCPS/BuiltInTopicDataReaderImpls.h + dds/DCPS/BuiltInTopicUtils.h + dds/DCPS/Cached_Allocator_With_Overflow_T.h + dds/DCPS/CoherentChangeControl.h + dds/DCPS/CoherentChangeControl.inl + dds/DCPS/Comparator_T.h + dds/DCPS/ConditionImpl.h + dds/DCPS/ConditionVariable.h + dds/DCPS/ConfigStoreImpl.h + dds/DCPS/ConfigUtils.h + dds/DCPS/ConnectionRecords.h + dds/DCPS/ContentFilteredTopicImpl.h + dds/DCPS/DCPS_Utils.h + dds/DCPS/DataBlockLockPool.h + dds/DCPS/DataCollector_T.cpp + dds/DCPS/DataCollector_T.h + dds/DCPS/DataCollector_T.inl + dds/DCPS/DataDurabilityCache.h + dds/DCPS/DataReaderCallbacks.h + dds/DCPS/DataReaderImpl.h + dds/DCPS/DataReaderImpl.inl + dds/DCPS/DataReaderImpl_T.h + dds/DCPS/DataSampleElement.h + dds/DCPS/DataSampleElement.inl + dds/DCPS/DataSampleHeader.h + dds/DCPS/DataSampleHeader.inl + dds/DCPS/DataWriterCallbacks.h + dds/DCPS/DataWriterImpl.h + dds/DCPS/DataWriterImpl_T.h + dds/DCPS/DcpsUpcalls.h + dds/DCPS/DdsDcps_pch.h + dds/DCPS/DefaultNetworkConfigMonitor.h + dds/DCPS/Definitions.h + dds/DCPS/DirentWrapper.h + dds/DCPS/Discovery.h + dds/DCPS/DiscoveryListener.h + dds/DCPS/DisjointSequence.h + dds/DCPS/DisjointSequence.inl + dds/DCPS/DispatchService.h + dds/DCPS/DomainParticipantFactoryImpl.h + dds/DCPS/DomainParticipantImpl.h + dds/DCPS/DurabilityArray.h + dds/DCPS/DurabilityQueue.h + dds/DCPS/Dynamic_Cached_Allocator_With_Overflow_T.h + dds/DCPS/EntityImpl.h + dds/DCPS/EventDispatcher.h + dds/DCPS/FeatureDisabledQosCheck.h + dds/DCPS/FibonacciSequence.h + dds/DCPS/FileSystemStorage.h + dds/DCPS/FilterEvaluator.h + dds/DCPS/FilterExpressionGrammar.h + dds/DCPS/GroupRakeData.h + dds/DCPS/GuardCondition.h + dds/DCPS/GuidBuilder.h + dds/DCPS/GuidBuilder.inl + dds/DCPS/GuidConverter.h + dds/DCPS/GuidUtils.h + dds/DCPS/Hash.h + dds/DCPS/Ice.h + dds/DCPS/InstanceDataSampleList.h + dds/DCPS/InstanceDataSampleList.inl + dds/DCPS/InstanceHandle.h + dds/DCPS/InstanceState.h + dds/DCPS/InstanceState.inl + dds/DCPS/InternalDataReader.h + dds/DCPS/InternalDataReaderListener.h + dds/DCPS/InternalDataWriter.h + dds/DCPS/InternalTopic.h + dds/DCPS/JobQueue.h + dds/DCPS/JsonValueReader.h + dds/DCPS/JsonValueWriter.h + dds/DCPS/LinuxNetworkConfigMonitor.h + dds/DCPS/LocalObject.h + dds/DCPS/LogAddr.h + dds/DCPS/Logging.h + dds/DCPS/Marked_Default_Qos.h + dds/DCPS/MemoryPool.h + dds/DCPS/MessageBlock.h + dds/DCPS/MessageTracker.h + dds/DCPS/Message_Block_Ptr.h + dds/DCPS/MonitorFactory.h + dds/DCPS/MultiTask.h + dds/DCPS/MultiTopicDataReaderBase.h + dds/DCPS/MultiTopicDataReader_T.cpp + dds/DCPS/MultiTopicDataReader_T.h + dds/DCPS/MultiTopicImpl.h + dds/DCPS/MulticastManager.h + dds/DCPS/NetworkAddress.h + dds/DCPS/NetworkConfigModifier.h + dds/DCPS/NetworkConfigMonitor.h + dds/DCPS/NetworkResource.h + dds/DCPS/NetworkResource.inl + dds/DCPS/Observer.h + dds/DCPS/OwnershipManager.h + dds/DCPS/PeriodicEvent.h + dds/DCPS/PeriodicTask.h + dds/DCPS/PoolAllocationBase.h + dds/DCPS/PoolAllocator.h + dds/DCPS/PrinterValueWriter.h + dds/DCPS/PublicationInstance.h + dds/DCPS/PublisherImpl.h + dds/DCPS/Qos_Helper.h + dds/DCPS/Qos_Helper.inl + dds/DCPS/QueryConditionImpl.h + dds/DCPS/RakeData.h + dds/DCPS/RakeResults_T.cpp + dds/DCPS/RakeResults_T.h + dds/DCPS/RapidJsonWrapper.h + dds/DCPS/RawDataSample.h + dds/DCPS/RcEventHandler.h + dds/DCPS/RcHandle_T.h + dds/DCPS/RcObject.h + dds/DCPS/ReactorInterceptor.h + dds/DCPS/ReactorTask.h + dds/DCPS/ReactorTask.inl + dds/DCPS/ReactorTask_rch.h + dds/DCPS/ReadConditionImpl.h + dds/DCPS/ReceivedDataElementList.h + dds/DCPS/ReceivedDataElementList.inl + dds/DCPS/ReceivedDataStrategy.h + dds/DCPS/Recorder.h + dds/DCPS/RecorderImpl.h + dds/DCPS/Registered_Data_Types.h + dds/DCPS/Replayer.h + dds/DCPS/ReplayerImpl.h + dds/DCPS/RepoIdBuilder.h + dds/DCPS/RepoIdBuilder.inl + dds/DCPS/RepoIdConverter.h + dds/DCPS/RepoIdGenerator.h + dds/DCPS/RestoreOutputStreamState.h + dds/DCPS/SafeBool_T.h + dds/DCPS/SafetyProfilePool.h + dds/DCPS/SafetyProfileSequence.h + dds/DCPS/SafetyProfileSequenceVar.h + dds/DCPS/SafetyProfileSequences.h + dds/DCPS/SafetyProfileStreams.h + dds/DCPS/Sample.h + dds/DCPS/SendStateDataSampleList.h + dds/DCPS/SendStateDataSampleList.inl + dds/DCPS/SequenceIterator.h + dds/DCPS/SequenceNumber.h + dds/DCPS/Serializer.h + dds/DCPS/Serializer.inl + dds/DCPS/ServiceEventDispatcher.h + dds/DCPS/Service_Participant.h + dds/DCPS/Service_Participant.inl + dds/DCPS/SporadicEvent.h + dds/DCPS/SporadicTask.h + dds/DCPS/StaticDiscovery.h + dds/DCPS/StaticIncludes.h + dds/DCPS/Stats_T.h + dds/DCPS/StatusConditionImpl.h + dds/DCPS/SubscriberImpl.h + dds/DCPS/SubscriptionInstance.h + dds/DCPS/ThreadPool.h + dds/DCPS/ThreadStatusManager.h + dds/DCPS/TimeDuration.h + dds/DCPS/TimeDuration.inl + dds/DCPS/TimePoint_T.cpp + dds/DCPS/TimePoint_T.h + dds/DCPS/TimePoint_T.inl + dds/DCPS/TimeSource.h + dds/DCPS/TimeTypes.h + dds/DCPS/Time_Helper.h + dds/DCPS/Time_Helper.inl + dds/DCPS/TopicCallbacks.h + dds/DCPS/TopicDescriptionImpl.h + dds/DCPS/TopicDetails.h + dds/DCPS/TopicExpressionGrammar.h + dds/DCPS/TopicImpl.h + dds/DCPS/Transient_Kludge.h + dds/DCPS/Transient_Kludge.inl + dds/DCPS/TypeSupportImpl.h + dds/DCPS/Util.h + dds/DCPS/ValueDispatcher.h + dds/DCPS/ValueHelper.h + dds/DCPS/ValueReader.h + dds/DCPS/ValueWriter.h + dds/DCPS/WaitSet.h + dds/DCPS/WriteDataContainer.h + dds/DCPS/WriterDataSampleList.h + dds/DCPS/WriterDataSampleList.inl + dds/DCPS/WriterInfo.h + dds/DCPS/XTypes/DynamicDataAdapter.h + dds/DCPS/XTypes/DynamicDataBase.h + dds/DCPS/XTypes/DynamicDataFactory.h + dds/DCPS/XTypes/DynamicDataImpl.h + dds/DCPS/XTypes/DynamicDataReaderImpl.h + dds/DCPS/XTypes/DynamicDataWriterImpl.h + dds/DCPS/XTypes/DynamicDataXcdrReadImpl.h + dds/DCPS/XTypes/DynamicSample.h + dds/DCPS/XTypes/DynamicTypeImpl.h + dds/DCPS/XTypes/DynamicTypeMemberImpl.h + dds/DCPS/XTypes/DynamicTypeSupport.h + dds/DCPS/XTypes/External.h + dds/DCPS/XTypes/MemberDescriptorImpl.h + dds/DCPS/XTypes/TypeAssignability.h + dds/DCPS/XTypes/TypeDescriptorImpl.h + dds/DCPS/XTypes/TypeLookupService.h + dds/DCPS/XTypes/TypeObject.h + dds/DCPS/XTypes/TypeObjectC.h + dds/DCPS/XTypes/TypeObjectTypeSupportImpl.h + dds/DCPS/XTypes/Utils.h + dds/DCPS/ZeroCopyAllocator_T.cpp + dds/DCPS/ZeroCopyAllocator_T.h + dds/DCPS/ZeroCopyAllocator_T.inl + dds/DCPS/ZeroCopyInfoSeq_T.h + dds/DCPS/ZeroCopySeqBase.h + dds/DCPS/ZeroCopySeq_T.cpp + dds/DCPS/ZeroCopySeq_T.h + dds/DCPS/ZeroCopySeq_T.inl + dds/DCPS/dcps_export.h + dds/DCPS/debug.h + dds/DCPS/security/framework/HandleRegistry.h + dds/DCPS/security/framework/Properties.h + dds/DCPS/security/framework/SecurityConfig.h + dds/DCPS/security/framework/SecurityConfigPropertyList.h + dds/DCPS/security/framework/SecurityConfig_rch.h + dds/DCPS/security/framework/SecurityPluginInst.h + dds/DCPS/security/framework/SecurityPluginInst_rch.h + dds/DCPS/security/framework/SecurityRegistry.h + dds/DCPS/transport/framework/BasicQueueVisitor_T.h + dds/DCPS/transport/framework/BasicQueue_T.h + dds/DCPS/transport/framework/BuildChainVisitor.h + dds/DCPS/transport/framework/BuildChainVisitor.inl + dds/DCPS/transport/framework/CopyChainVisitor.h + dds/DCPS/transport/framework/CopyChainVisitor.inl + dds/DCPS/transport/framework/DataLink.h + dds/DCPS/transport/framework/DataLink.inl + dds/DCPS/transport/framework/DataLinkCleanupTask.h + dds/DCPS/transport/framework/DataLinkSet.h + dds/DCPS/transport/framework/DataLinkSet.inl + dds/DCPS/transport/framework/DataLinkSet_rch.h + dds/DCPS/transport/framework/DataLink_rch.h + dds/DCPS/transport/framework/DirectPriorityMapper.h + dds/DCPS/transport/framework/DirectPriorityMapper.inl + dds/DCPS/transport/framework/EntryExit.h + dds/DCPS/transport/framework/MessageDropper.h + dds/DCPS/transport/framework/NullSynch.h + dds/DCPS/transport/framework/NullSynch.inl + dds/DCPS/transport/framework/NullSynchStrategy.h + dds/DCPS/transport/framework/PacketRemoveVisitor.h + dds/DCPS/transport/framework/PacketRemoveVisitor.inl + dds/DCPS/transport/framework/PerConnectionSynch.h + dds/DCPS/transport/framework/PerConnectionSynch.inl + dds/DCPS/transport/framework/PerConnectionSynchStrategy.h + dds/DCPS/transport/framework/PerConnectionSynchStrategy.inl + dds/DCPS/transport/framework/PoolSynch.h + dds/DCPS/transport/framework/PoolSynch.inl + dds/DCPS/transport/framework/PoolSynchStrategy.h + dds/DCPS/transport/framework/PoolSynchStrategy.inl + dds/DCPS/transport/framework/PriorityKey.h + dds/DCPS/transport/framework/PriorityKey.inl + dds/DCPS/transport/framework/PriorityMapper.h + dds/DCPS/transport/framework/PriorityMapper.inl + dds/DCPS/transport/framework/QueueRemoveVisitor.h + dds/DCPS/transport/framework/QueueRemoveVisitor.inl + dds/DCPS/transport/framework/QueueTaskBase_T.h + dds/DCPS/transport/framework/ReactorSynch.h + dds/DCPS/transport/framework/ReactorSynch.inl + dds/DCPS/transport/framework/ReactorSynchStrategy.h + dds/DCPS/transport/framework/ReactorSynchStrategy.inl + dds/DCPS/transport/framework/ReceiveListenerSet.h + dds/DCPS/transport/framework/ReceiveListenerSet.inl + dds/DCPS/transport/framework/ReceiveListenerSetMap.h + dds/DCPS/transport/framework/ReceiveListenerSetMap.inl + dds/DCPS/transport/framework/ReceiveListenerSet_rch.h + dds/DCPS/transport/framework/ReceivedDataSample.h + dds/DCPS/transport/framework/RemoveAllVisitor.h + dds/DCPS/transport/framework/RemoveAllVisitor.inl + dds/DCPS/transport/framework/ScheduleOutputHandler.h + dds/DCPS/transport/framework/ScheduleOutputHandler.inl + dds/DCPS/transport/framework/SendResponseListener.h + dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.h + dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.inl + dds/DCPS/transport/framework/ThreadPerConnectionSendTask.h + dds/DCPS/transport/framework/ThreadSynch.h + dds/DCPS/transport/framework/ThreadSynch.inl + dds/DCPS/transport/framework/ThreadSynchResource.h + dds/DCPS/transport/framework/ThreadSynchResource.inl + dds/DCPS/transport/framework/ThreadSynchStrategy.h + dds/DCPS/transport/framework/ThreadSynchStrategy.inl + dds/DCPS/transport/framework/ThreadSynchStrategy_rch.h + dds/DCPS/transport/framework/ThreadSynchWorker.h + dds/DCPS/transport/framework/ThreadSynchWorker.inl + dds/DCPS/transport/framework/TransportClient.h + dds/DCPS/transport/framework/TransportConfig.h + dds/DCPS/transport/framework/TransportConfig_rch.h + dds/DCPS/transport/framework/TransportControlElement.h + dds/DCPS/transport/framework/TransportControlElement.inl + dds/DCPS/transport/framework/TransportCustomizedElement.h + dds/DCPS/transport/framework/TransportCustomizedElement.inl + dds/DCPS/transport/framework/TransportDebug.h + dds/DCPS/transport/framework/TransportDefs.h + dds/DCPS/transport/framework/TransportExceptions.h + dds/DCPS/transport/framework/TransportHeader.h + dds/DCPS/transport/framework/TransportHeader.inl + dds/DCPS/transport/framework/TransportImpl.h + dds/DCPS/transport/framework/TransportImpl.inl + dds/DCPS/transport/framework/TransportImpl_rch.h + dds/DCPS/transport/framework/TransportInst.h + dds/DCPS/transport/framework/TransportInst.inl + dds/DCPS/transport/framework/TransportInst_rch.h + dds/DCPS/transport/framework/TransportQueueElement.h + dds/DCPS/transport/framework/TransportQueueElement.inl + dds/DCPS/transport/framework/TransportReassembly.h + dds/DCPS/transport/framework/TransportReceiveListener.h + dds/DCPS/transport/framework/TransportReceiveStrategy_T.cpp + dds/DCPS/transport/framework/TransportReceiveStrategy_T.h + dds/DCPS/transport/framework/TransportReceiveStrategy_T.inl + dds/DCPS/transport/framework/TransportReceiveStrategy_rch.h + dds/DCPS/transport/framework/TransportRegistry.h + dds/DCPS/transport/framework/TransportRegistry.inl + dds/DCPS/transport/framework/TransportReplacedElement.h + dds/DCPS/transport/framework/TransportReplacedElement.inl + dds/DCPS/transport/framework/TransportRetainedElement.h + dds/DCPS/transport/framework/TransportRetainedElement.inl + dds/DCPS/transport/framework/TransportSendBuffer.h + dds/DCPS/transport/framework/TransportSendBuffer.inl + dds/DCPS/transport/framework/TransportSendControlElement.h + dds/DCPS/transport/framework/TransportSendControlElement.inl + dds/DCPS/transport/framework/TransportSendElement.h + dds/DCPS/transport/framework/TransportSendElement.inl + dds/DCPS/transport/framework/TransportSendListener.h + dds/DCPS/transport/framework/TransportSendStrategy.h + dds/DCPS/transport/framework/TransportSendStrategy.inl + dds/DCPS/transport/framework/TransportSendStrategy_rch.h + dds/DCPS/transport/framework/TransportStatistics.h + dds/DCPS/transport/framework/TransportStrategy.h + dds/DCPS/transport/framework/TransportStrategy_rch.h + dds/DCPS/transport/framework/TransportType.h + dds/DCPS/transport/framework/TransportType_rch.h + dds/DCPS/unique_ptr.h + dds/DCPS/yard/yard_base_grammar.hpp + dds/DCPS/yard/yard_char_set.hpp + dds/DCPS/yard/yard_parser.hpp + dds/DCPS/yard/yard_text_grammar.hpp + dds/DCPS/yard/yard_tree.hpp + dds/Version.h + dds/Versioned_Namespace.h +) +target_compile_definitions(OpenDDS_Dcps PUBLIC ${OPENDDS_DCPS_COMPILE_DEFINITIONS}) _opendds_library(OpenDDS_Dcps MSVC_BIGOBJ) target_include_directories(OpenDDS_Dcps PUBLIC @@ -295,12 +603,15 @@ target_include_directories(OpenDDS_Dcps PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/dds" ) +if(OPENDDS_RAPIDJSON) + target_include_directories(OpenDDS_Dcps PUBLIC "$") +endif() target_link_libraries(OpenDDS_Dcps PUBLIC ${dcps_lib_deps}) set(opendds_target_sources_args AUTO_LINK FALSE USE_EXPORT "dds/DCPS/dcps_export.h" OpenDDS_Dcps_Export - INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" ) opendds_target_sources(OpenDDS_Dcps @@ -365,7 +676,11 @@ opendds_target_sources(OpenDDS_Dcps ) get_target_property(gendir OpenDDS_Dcps OPENDDS_GENERATED_DIRECTORY) -configure_file("${_OPENDDS_CMAKE_DIR}/config.h.in" "${gendir}/dds/DCPS/config.h") +set(config_file "${gendir}/dds/DCPS/config.h") +configure_file("${_OPENDDS_CMAKE_DIR}/config.h.in" "${config_file}") +opendds_install_interface_files(OpenDDS_Dcps INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" + EXTRA_GENERATED_FILES "${config_file}" +) add_subdirectory(dds/DCPS/transport/multicast) add_subdirectory(dds/DCPS/RTPS) @@ -374,11 +689,52 @@ add_subdirectory(dds/DCPS/transport/shmem) add_subdirectory(dds/DCPS/transport/tcp) add_subdirectory(dds/DCPS/InfoRepoDiscovery) add_subdirectory(dds/DCPS/transport/udp) - add_subdirectory(dds/InfoRepo) if(OPENDDS_SECURITY) add_subdirectory(dds/DCPS/security) endif() +add_subdirectory(tools/inspect) +add_subdirectory(tools/dds/rtpsrelaylib) +add_subdirectory(tools/rtpsrelay) + +set(cmake_dest "${CMAKE_INSTALL_DATAROOTDIR}/cmake/OpenDDS") +install(EXPORT opendds_targets + FILE "opendds_targets.cmake" + DESTINATION ${cmake_dest} +) +set(pkg_config_cmake "opendds_installed_config.cmake") +set(tmp_pkg_config_cmake "${CMAKE_CURRENT_BINARY_DIR}/${pkg_config_cmake}") +configure_package_config_file( + "cmake/${pkg_config_cmake}.in" ${tmp_pkg_config_cmake} + INSTALL_DESTINATION ${cmake_dest} +) +set(tmp_config_cmake "${CMAKE_CURRENT_BINARY_DIR}/config.cmake") +configure_file("${_OPENDDS_CMAKE_DIR}/config.cmake.in" "${tmp_config_cmake}") +install( + FILES + cmake/OpenDDSConfig.cmake + cmake/OpenDDSConfigVersion.cmake + cmake/ace_group.cmake + cmake/dds_idl_sources.cmake + cmake/export.h.in + cmake/import_common.cmake + cmake/init.cmake + cmake/opendds_build_helpers.cmake + cmake/opendds_features.cmake + cmake/opendds_group.cmake + cmake/opendds_target_sources.cmake + cmake/opendds_testing.cmake + cmake/tao_group.cmake + cmake/tao_idl_sources.cmake + "${tmp_pkg_config_cmake}" + "${tmp_config_cmake}" + DESTINATION "${cmake_dest}" +) +install(FILES VERSION.txt DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dds/") +if(OPENDDS_RAPIDJSON) + install(DIRECTORY "${OPENDDS_RAPIDJSON}/include/rapidjson" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +endif() add_subdirectory(DevGuideExamples/DCPS/Messenger) add_subdirectory(tests/cmake/ace_tao_only) diff --git a/cmake/OpenDDSConfig.cmake b/cmake/OpenDDSConfig.cmake index 03d416d0c78..6d9f578a43c 100644 --- a/cmake/OpenDDSConfig.cmake +++ b/cmake/OpenDDSConfig.cmake @@ -219,39 +219,56 @@ if(_opendds_tao_find_libs OR _opendds_tao_find_exes) endif() endif() -if(_opendds_find_libs OR _opendds_find_exes) +if(_OPENDDS_CMAKE_BUILT_AND_INSTALLED) + include("${CMAKE_CURRENT_LIST_DIR}/opendds_installed_config.cmake") + set(OpenDDS_FOUND TRUE) +elseif(_opendds_find_libs OR _opendds_find_exes) _opendds_find_group_targets(OpenDDS "${_opendds_find_libs}" "${_opendds_find_exes}") _opendds_found_required_deps(OpenDDS_FOUND "${_opendds_required}") if(OpenDDS_FOUND) _opendds_import_group_targets(OpenDDS "${_opendds_find_libs}" "${_opendds_find_exes}") - - if(NOT TARGET OpenDDS::OpenDDS) - add_library(OpenDDS::OpenDDS INTERFACE IMPORTED) - - set(_opendds_core_libs - OpenDDS::Dcps - OpenDDS::Multicast - OpenDDS::Rtps - OpenDDS::Rtps_Udp - OpenDDS::InfoRepoDiscovery - OpenDDS::Shmem - OpenDDS::Tcp - OpenDDS::Udp - ) - if(OPENDDS_SECURITY) - list(APPEND _opendds_core_libs OpenDDS::Security) - endif() - - set_target_properties(OpenDDS::OpenDDS - PROPERTIES - INTERFACE_LINK_LIBRARIES "${_opendds_core_libs}") - endif() else() set(CMAKE_MESSAGE_INDENT "${_opendds_cmake_message_indent}") return() endif() endif() +if(NOT TARGET OpenDDS::OpenDDS) + set(_opendds_core_libs + OpenDDS::Dcps + OpenDDS::Multicast + OpenDDS::Rtps + OpenDDS::Rtps_Udp + OpenDDS::InfoRepoDiscovery + OpenDDS::Shmem + OpenDDS::Tcp + OpenDDS::Udp + ) + if(OPENDDS_SECURITY) + list(APPEND _opendds_core_libs OpenDDS::Security) + endif() + + set(_found_all TRUE) + foreach(_lib ${_opendds_core_libs}) + if(NOT TARGET "${_lib}") + set(_found_all FALSE) + break() + endif() + endforeach() + + if(_found_all) + add_library(OpenDDS::OpenDDS INTERFACE IMPORTED) + set_target_properties(OpenDDS::OpenDDS + PROPERTIES + INTERFACE_LINK_LIBRARIES "${_opendds_core_libs}") + endif() +endif() + +if(NOT TARGET OpenDDS::TestUtils AND DEFINED OPENDDS_SOURCE_DIR) + add_library(OpenDDS::TestUtils INTERFACE IMPORTED) + target_include_directories(OpenDDS::TestUtils INTERFACE "${OPENDDS_SOURCE_DIR}") +endif() + if(TARGET TAO::tao_idl OR TARGET OpenDDS::opendds_idl) include("${CMAKE_CURRENT_LIST_DIR}/opendds_target_sources.cmake") endif() diff --git a/cmake/OpenDDSConfigVersion.cmake b/cmake/OpenDDSConfigVersion.cmake index 7a76c7890c6..b7874c62bf9 100644 --- a/cmake/OpenDDSConfigVersion.cmake +++ b/cmake/OpenDDSConfigVersion.cmake @@ -1,15 +1,9 @@ # Distributed under the OpenDDS License. See accompanying LICENSE # file or http://www.opendds.org/license.html for details. -include(${CMAKE_CURRENT_LIST_DIR}/init.cmake) +include("${CMAKE_CURRENT_LIST_DIR}/init.cmake") -set(version_file "${DDS_ROOT}/VERSION.txt") -file(READ ${version_file} version_file_contents) -string(REGEX MATCH "OpenDDS version ([0-9]+.[0-9]+.[0-9]+)" _ ${version_file_contents}) -set(PACKAGE_VERSION ${CMAKE_MATCH_1}) -if(NOT PACKAGE_VERSION) - message(FATAL_ERROR "Couldn't get OpenDDS version from ${version_file}") -endif() +set(PACKAGE_VERSION "${OPENDDS_VERSION}") if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) set(PACKAGE_VERSION_EXACT TRUE) diff --git a/cmake/init.cmake b/cmake/init.cmake index 2a2bc0579a9..bd75d08634e 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -193,6 +193,22 @@ if(NOT DEFINED ACE_ROOT) set(ACE_BIN_DIR "${ACE_ROOT}/bin") endif() +if(NOT DEFINED OPENDDS_VERSION) + set(_version_file "${_OPENDDS_CMAKE_DIR}/../VERSION.txt") + if(NOT EXISTS "${_version_file}") + set(_version_file "${_OPENDDS_CMAKE_DIR}/../../dds/VERSION.txt") + if(NOT EXISTS "${_version_file}") + message(FATAL_ERROR "Can't find OpenDDS VERSION.txt file") + endif() + endif() + file(READ "${_version_file}" _version_file_contents) + string(REGEX MATCH "OpenDDS version ([0-9]+.[0-9]+.[0-9]+)" _ "${_version_file_contents}") + set(OPENDDS_VERSION "${CMAKE_MATCH_1}") + if(NOT OPENDDS_VERSION) + message(FATAL_ERROR "Couldn't get OpenDDS version from ${_version_file}") + endif() +endif() + if(NOT DEFINED TAO_ROOT) if(OPENDDS_USE_PREFIX_PATH) set(TAO_ROOT "${OPENDDS_ROOT}/share/tao") diff --git a/cmake/opendds_build_helpers.cmake b/cmake/opendds_build_helpers.cmake index 24ec3c9fe51..2246d36b279 100644 --- a/cmake/opendds_build_helpers.cmake +++ b/cmake/opendds_build_helpers.cmake @@ -1,3 +1,10 @@ +include(GNUInstallDirs) + +set(_opendds_exec_perms + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_WRITE GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + function(_opendds_alias target) # This is the name the target should be exported from CMake-build OpenDDS as # or imported in the MPC-built OpenDDS CMake package. For consistency and @@ -10,10 +17,11 @@ function(_opendds_alias target) else() add_executable("${name}" ALIAS "${target}") endif() + set_target_properties(${target} PROPERTIES EXPORT_NAME "${name}") endfunction() function(_opendds_library target) - set(no_value_options MSVC_BIGOBJ) + set(no_value_options MSVC_BIGOBJ NO_INSTALL) set(single_value_options EXPORT_SYMBOLS_NAME) set(multi_value_options) cmake_parse_arguments(arg @@ -49,33 +57,38 @@ function(_opendds_library target) target_compile_options(${target} PRIVATE /bigobj) endif() - set(exec_perms - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_WRITE GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) - # TODO: Export Targets - install(TARGETS ${target} - LIBRARY - DESTINATION lib - PERMISSIONS ${exec_perms} - RUNTIME - DESTINATION lib - PERMISSIONS ${exec_perms} - ARCHIVE DESTINATION lib - ) + if(NOT arg_NO_INSTALL) + install(TARGETS ${target} + EXPORT opendds_targets + LIBRARY + DESTINATION ${CMAKE_INSTALL_LIBDIR} + PERMISSIONS ${_opendds_exec_perms} + RUNTIME + DESTINATION ${CMAKE_INSTALL_LIBDIR} + PERMISSIONS ${_opendds_exec_perms} + FILE_SET HEADERS + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ARCHIVE DESTINATION lib + ) + endif() endfunction() function(_opendds_executable target) + set(no_value_options NO_INSTALL) + set(single_value_options) + set(multi_value_options) + cmake_parse_arguments(arg + "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) + _opendds_alias(${target}) set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OPENDDS_BIN_DIR}") - set(exec_perms - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_WRITE GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) - install(TARGETS ${target} - RUNTIME - DESTINATION bin - PERMISSIONS ${exec_perms} - ) + if(NOT arg_NO_INSTALL) + install(TARGETS ${target} + EXPORT opendds_targets + RUNTIME + DESTINATION ${CMAKE_INSTALL_BINDIR} + PERMISSIONS ${_opendds_exec_perms} + ) + endif() endfunction() diff --git a/cmake/opendds_installed_config.cmake.in b/cmake/opendds_installed_config.cmake.in new file mode 100644 index 00000000000..2968f9aabf3 --- /dev/null +++ b/cmake/opendds_installed_config.cmake.in @@ -0,0 +1,3 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/opendds_targets.cmake") diff --git a/cmake/opendds_target_sources.cmake b/cmake/opendds_target_sources.cmake index 43e090a2185..efd6d0a1e8c 100644 --- a/cmake/opendds_target_sources.cmake +++ b/cmake/opendds_target_sources.cmake @@ -6,6 +6,8 @@ if(_OPENDDS_TARGET_SOURCES_CMAKE) endif() set(_OPENDDS_TARGET_SOURCES_CMAKE TRUE) +include(GNUInstallDirs) + include("${CMAKE_CURRENT_LIST_DIR}/opendds_group.cmake") include("${CMAKE_CURRENT_LIST_DIR}/dds_idl_sources.cmake") @@ -365,6 +367,35 @@ function(opendds_target_sources target) set(inc_scope PUBLIC) endif() foreach(include ${includes}) - target_include_directories(${target} ${inc_scope} $) + target_include_directories(${target} ${inc_scope} "$") + endforeach() +endfunction() + +function(opendds_install_interface_files target) + set(no_value_options) + set(single_value_options DEST INCLUDE_BASE) + set(multi_value_options EXTRA_GENERATED_FILES) + cmake_parse_arguments(arg + "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) + + if(NOT DEFINED arg_INCLUDE_BASE) + set(arg_INCLUDE_BASE "${CMAKE_CURRENT_SOURCE_DIR}") + endif() + if(NOT DEFINED arg_DEST) + set(arg_DEST "${CMAKE_INSTALL_INCLUDEDIR}") + endif() + + get_target_property(passed ${target} OPENDDS_ALL_PASSED_INTERFACE_FILES) + foreach(file ${passed}) + file(RELATIVE_PATH dest ${arg_INCLUDE_BASE} ${file}) + get_filename_component(dest ${dest} DIRECTORY) + install(FILES ${file} DESTINATION "${arg_DEST}/${dest}") + endforeach() + get_target_property(generated ${target} OPENDDS_ALL_GENERATED_INTERFACE_FILES) + get_target_property(gendir ${target} OPENDDS_GENERATED_DIRECTORY) + foreach(file ${generated} ${arg_EXTRA_GENERATED_FILES}) + file(RELATIVE_PATH dest ${gendir} ${file}) + get_filename_component(dest ${dest} DIRECTORY) + install(FILES ${file} DESTINATION "${arg_DEST}/${dest}") endforeach() endfunction() diff --git a/cmake/opendds_testing.cmake b/cmake/opendds_testing.cmake index 1df5808e455..b711a70f936 100644 --- a/cmake/opendds_testing.cmake +++ b/cmake/opendds_testing.cmake @@ -44,10 +44,13 @@ function(_opendds_add_test) list(APPEND env "OPENDDS_TEST_CONFIG_DIR=${OPENDDS_TEST_CONFIG_DIR}") endif() - if(DEFINED OPENDDS_SOURCE_ROOT) - _opendds_path_list(perl5lib "${OPENDDS_SOURCE_ROOT}/bin" "${ACE_ROOT}/bin") + if(DEFINED OPENDDS_SOURCE_DIR) + if(NOT DEFINED ACE_SOURCE_DIR) + set(ACE_SOURCE_DIR "${ACE_ROOT}") + endif() + _opendds_path_list(perl5lib "${OPENDDS_SOURCE_DIR}/bin" "${ACE_SOURCE_DIR}/bin") list(APPEND env "PERL5LIB=${perl5lib}") - list(APPEND env "OPENDDS_SOURCE_ROOT=${OPENDDS_SOURCE_ROOT}") + list(APPEND env "OPENDDS_SOURCE_DIR=${OPENDDS_SOURCE_DIR}") endif() if(env) diff --git a/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt index 76b2bd6ccc8..5cf64b03f99 100644 --- a/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt +++ b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt @@ -10,6 +10,14 @@ add_library(OpenDDS_InfoRepoDiscovery FailoverListener.cpp InfoRepoDiscovery.cpp ) +target_sources(OpenDDS_InfoRepoDiscovery + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + DataReaderRemoteImpl.h + InfoRepoDiscovery_Export.h + FailoverListener.h + DataWriterRemoteImpl.h + InfoRepoDiscovery.h +) _opendds_library(OpenDDS_InfoRepoDiscovery) target_link_libraries(OpenDDS_InfoRepoDiscovery PUBLIC ${lib_deps}) @@ -18,8 +26,11 @@ opendds_target_sources(OpenDDS_InfoRepoDiscovery Info.idl DataReaderRemote.idl DataWriterRemote.idl - INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" SKIP_OPENDDS_IDL GENERATE_SERVER_SKELETONS TRUE - USE_EXPORT "dds/DCPS/InfoRepoDiscovery/InfoRepoDiscovery_Export.h" OpenDDS_InfoRepoDiscovery_Export + USE_EXPORT + "dds/DCPS/InfoRepoDiscovery/InfoRepoDiscovery_Export.h" + OpenDDS_InfoRepoDiscovery_Export ) +opendds_install_interface_files(OpenDDS_InfoRepoDiscovery INCLUDE_BASE "${OPENDDS_SOURCE_DIR}") diff --git a/dds/DCPS/RTPS/CMakeLists.txt b/dds/DCPS/RTPS/CMakeLists.txt index 9e2f266fa91..a31a3f59608 100644 --- a/dds/DCPS/RTPS/CMakeLists.txt +++ b/dds/DCPS/RTPS/CMakeLists.txt @@ -19,11 +19,33 @@ add_library(OpenDDS_Rtps ICE/Checklist.cpp ICE/AgentImpl.cpp ) +target_sources(OpenDDS_Rtps + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + AssociationRecord.h + DiscoveredEntities.h + GuidGenerator.h + ICE/AgentImpl.h + ICE/Checklist.h + ICE/EndpointManager.h + ICE/Ice.h + ICE/Stun.h + ICE/Task.h + LocalEntities.h + MessageParser.h + MessageTypes.h + MessageUtils.h + ParameterListConverter.h + RtpsDiscovery.h + RtpsDiscoveryConfig.h + Sedp.h + Spdp.h + rtps_export.h +) _opendds_library(OpenDDS_Rtps) target_link_libraries(OpenDDS_Rtps PUBLIC OpenDDS::Dcps) set(ots_args - INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" USE_EXPORT "dds/DCPS/RTPS/rtps_export.h" OpenDDS_Rtps_Export ) opendds_target_sources(OpenDDS_Rtps @@ -44,3 +66,4 @@ opendds_target_sources(OpenDDS_Rtps ${ots_args} SKIP_TAO_IDL ) +opendds_install_interface_files(OpenDDS_Rtps INCLUDE_BASE "${OPENDDS_SOURCE_DIR}") diff --git a/dds/DCPS/security/CMakeLists.txt b/dds/DCPS/security/CMakeLists.txt index 9e75cf38421..d077ff4401f 100644 --- a/dds/DCPS/security/CMakeLists.txt +++ b/dds/DCPS/security/CMakeLists.txt @@ -27,11 +27,51 @@ add_library(OpenDDS_Security TokenWriter.cpp UtilityImpl.cpp ) +target_sources(OpenDDS_Security + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + AccessControl/DomainIdSet.h + AccessControl/Governance.h + AccessControl/LocalAccessCredentialData.h + AccessControl/Permissions.h + AccessControl/XmlUtils.h + AccessControlBuiltInImpl.h + Authentication/LocalAuthCredentialData.h + AuthenticationBuiltInImpl.h + BuiltInPluginLoader.h + BuiltInPlugins.h + BuiltInSecurityPluginInst.h + CommonUtilities.h + CryptoBuiltInImpl.h + OpenDDS_Security_Export.h + OpenSSL_init.h + OpenSSL_legacy.h + SSL/Certificate.h + SSL/DiffieHellman.h + SSL/Err.h + SSL/PrivateKey.h + SSL/SignedDocument.h + SSL/SubjectName.h + SSL/Utils.h + TokenReader.h + TokenWriter.h + Utility.h + UtilityImpl.h + framework/HandleRegistry.h + framework/Properties.h + framework/SecurityConfig.h + framework/SecurityConfigPropertyList.h + framework/SecurityConfig_rch.h + framework/SecurityPluginInst.h + framework/SecurityPluginInst_rch.h + framework/SecurityRegistry.h +) _opendds_library(OpenDDS_Security) target_link_libraries(OpenDDS_Security PUBLIC ${deps} PRIVATE OpenSSL::Crypto) + opendds_target_sources(OpenDDS_Security PUBLIC CryptoBuiltIn.idl - INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" USE_EXPORT "dds/DCPS/security/OpenDDS_Security_Export.h" OpenDDS_Security_Export ) +opendds_install_interface_files(OpenDDS_Security INCLUDE_BASE "${OPENDDS_SOURCE_DIR}") diff --git a/dds/DCPS/transport/multicast/CMakeLists.txt b/dds/DCPS/transport/multicast/CMakeLists.txt index e0fde894eab..5804525b82b 100644 --- a/dds/DCPS/transport/multicast/CMakeLists.txt +++ b/dds/DCPS/transport/multicast/CMakeLists.txt @@ -22,5 +22,32 @@ add_library(OpenDDS_Multicast MulticastDataLink.inl MulticastSession.inl ) +target_sources(OpenDDS_Multicast + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + BestEffortSession.h + BestEffortSessionFactory.h + Multicast.h + MulticastDataLink.h + MulticastDataLink.inl + MulticastDataLink_rch.h + MulticastInst.h + MulticastInst_rch.h + MulticastLoader.h + MulticastReceiveStrategy.h + MulticastReceiveStrategy_rch.h + MulticastSendStrategy.h + MulticastSendStrategy_rch.h + MulticastSession.h + MulticastSession.inl + MulticastSessionFactory.h + MulticastSessionFactory_rch.h + MulticastSession_rch.h + MulticastTransport.h + MulticastTransport_rch.h + MulticastTypes.h + Multicast_Export.h + ReliableSession.h + ReliableSessionFactory.h +) _opendds_library(OpenDDS_Multicast) target_link_libraries(OpenDDS_Multicast PUBLIC ${deps}) diff --git a/dds/DCPS/transport/rtps_udp/CMakeLists.txt b/dds/DCPS/transport/rtps_udp/CMakeLists.txt index f0c327be09e..93d04551a01 100644 --- a/dds/DCPS/transport/rtps_udp/CMakeLists.txt +++ b/dds/DCPS/transport/rtps_udp/CMakeLists.txt @@ -17,11 +17,34 @@ add_library(OpenDDS_Rtps_Udp RtpsUdpSendStrategy.cpp RtpsUdpTransport.cpp TransactionalRtpsSendQueue.cpp - - RtpsCustomizedElement.inl - RtpsSampleHeader.inl - RtpsTransportHeader.inl - RtpsUdpDataLink.inl +) +target_sources(OpenDDS_Rtps_Udp + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + BundlingCacheKey.h + ConstSharedRepoIdSet.h + LocatorCacheKey.h + MetaSubmessage.h + RtpsCustomizedElement.h + RtpsCustomizedElement.inl + RtpsSampleHeader.h + RtpsSampleHeader.inl + RtpsTransportHeader.h + RtpsTransportHeader.inl + RtpsUdp.h + RtpsUdpDataLink.h + RtpsUdpDataLink.inl + RtpsUdpDataLink_rch.h + RtpsUdpInst.h + RtpsUdpInst_rch.h + RtpsUdpLoader.h + RtpsUdpReceiveStrategy.h + RtpsUdpReceiveStrategy_rch.h + RtpsUdpSendStrategy.h + RtpsUdpSendStrategy_rch.h + RtpsUdpTransport.h + RtpsUdpTransport_rch.h + Rtps_Udp_Export.h + TransactionalRtpsSendQueue.h ) _opendds_library(OpenDDS_Rtps_Udp MSVC_BIGOBJ) target_link_libraries(OpenDDS_Rtps_Udp PUBLIC ${deps}) diff --git a/dds/DCPS/transport/shmem/CMakeLists.txt b/dds/DCPS/transport/shmem/CMakeLists.txt index f91c25b1b20..5ba1d0fbac7 100644 --- a/dds/DCPS/transport/shmem/CMakeLists.txt +++ b/dds/DCPS/transport/shmem/CMakeLists.txt @@ -12,8 +12,24 @@ add_library(OpenDDS_Shmem ShmemReceiveStrategy.cpp ShmemSendStrategy.cpp ShmemTransport.cpp - - ShmemDataLink.inl +) +target_sources(OpenDDS_Shmem + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + Shmem.h + ShmemAllocator.h + ShmemDataLink.h + ShmemDataLink.inl + ShmemDataLink_rch.h + ShmemInst.h + ShmemInst_rch.h + ShmemLoader.h + ShmemReceiveStrategy.h + ShmemReceiveStrategy_rch.h + ShmemSendStrategy.h + ShmemSendStrategy_rch.h + ShmemTransport.h + ShmemTransport_rch.h + Shmem_Export.h ) _opendds_library(OpenDDS_Shmem) target_link_libraries(OpenDDS_Shmem PUBLIC ${deps}) diff --git a/dds/DCPS/transport/tcp/CMakeLists.txt b/dds/DCPS/transport/tcp/CMakeLists.txt index 9223be1992b..21fcee00fdd 100644 --- a/dds/DCPS/transport/tcp/CMakeLists.txt +++ b/dds/DCPS/transport/tcp/CMakeLists.txt @@ -15,11 +15,30 @@ add_library(OpenDDS_Tcp TcpSendStrategy.cpp TcpSynchResource.cpp TcpTransport.cpp - - TcpConnection.inl - TcpDataLink.inl - TcpInst.inl - TcpReceiveStrategy.inl +) +target_sources(OpenDDS_Tcp + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + Tcp.h + TcpAcceptor.h + TcpConnection.h + TcpConnection.inl + TcpConnection_rch.h + TcpDataLink.h + TcpDataLink.inl + TcpDataLink_rch.h + TcpInst.h + TcpInst.inl + TcpInst_rch.h + TcpLoader.h + TcpReceiveStrategy.h + TcpReceiveStrategy.inl + TcpReceiveStrategy_rch.h + TcpSendStrategy.h + TcpSendStrategy_rch.h + TcpSynchResource.h + TcpTransport.h + TcpTransport_rch.h + Tcp_export.h ) _opendds_library(OpenDDS_Tcp) target_link_libraries(OpenDDS_Tcp PUBLIC ${deps}) diff --git a/dds/DCPS/transport/tcp/TcpReceiveStrategy_rch.h b/dds/DCPS/transport/tcp/TcpReceiveStrategy_rch.h old mode 100755 new mode 100644 diff --git a/dds/DCPS/transport/udp/CMakeLists.txt b/dds/DCPS/transport/udp/CMakeLists.txt index 8077594e181..dc5ed01a39c 100644 --- a/dds/DCPS/transport/udp/CMakeLists.txt +++ b/dds/DCPS/transport/udp/CMakeLists.txt @@ -12,8 +12,23 @@ add_library(OpenDDS_Udp UdpReceiveStrategy.cpp UdpSendStrategy.cpp UdpTransport.cpp - - UdpDataLink.inl +) +target_sources(OpenDDS_Udp + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + Udp.h + UdpDataLink.h + UdpDataLink.inl + UdpDataLink_rch.h + UdpInst.h + UdpInst_rch.h + UdpLoader.h + UdpReceiveStrategy.h + UdpReceiveStrategy_rch.h + UdpSendStrategy.h + UdpSendStrategy_rch.h + UdpTransport.h + UdpTransport_rch.h + Udp_Export.h ) _opendds_library(OpenDDS_Udp) target_link_libraries(OpenDDS_Udp PUBLIC ${deps}) diff --git a/dds/InfoRepo/CMakeLists.txt b/dds/InfoRepo/CMakeLists.txt index e63d29dcd56..1f251a3a936 100644 --- a/dds/InfoRepo/CMakeLists.txt +++ b/dds/InfoRepo/CMakeLists.txt @@ -37,9 +37,13 @@ add_library(OpenDDS_Federator FederatorManagerImpl.cpp FederatorManagerImpl_updates.cpp InfoRepoMulticastResponder.cpp - - FederatorConfig.inl - FederatorManagerImpl.inl +) +target_sources(OpenDDS_Federator + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + federator_export.h + UpdateListener_T.h + UpdateReceiver_T.h + UpdateProcessor_T.h ) _opendds_library(OpenDDS_Federator MSVC_BIGOBJ) target_link_libraries(OpenDDS_Federator PUBLIC OpenDDS::InfoRepoLib) @@ -47,12 +51,17 @@ target_compile_definitions(OpenDDS_Federator PRIVATE OPENDDS_FEDERATOR_BUILD_DLL opendds_target_sources(OpenDDS_Federator PUBLIC Federator.idl - INCLUDE_BASE "${OPENDDS_SOURCE_ROOT}" + INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" GENERATE_SERVER_SKELETONS TRUE USE_EXPORT "dds/InfoRepo/federator_export.h" OpenDDS_Federator_Export ) +opendds_install_interface_files(OpenDDS_Federator INCLUDE_BASE "${OPENDDS_SOURCE_DIR}") add_library(OpenDDS_InfoRepoServ DCPSInfoRepoServ.cpp) +target_sources(OpenDDS_InfoRepoServ + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + DCPSInfoRepoServ.h +) _opendds_library(OpenDDS_InfoRepoServ) target_link_libraries(OpenDDS_InfoRepoServ PUBLIC OpenDDS::Federator) diff --git a/dds/idl/CMakeLists.txt b/dds/idl/CMakeLists.txt index eb63fe875e8..5f4842e8546 100644 --- a/dds/idl/CMakeLists.txt +++ b/dds/idl/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.22) project(opendds_idl CXX) +include(GNUInstallDirs) + set(deps ACE::ACE TAO::IDL_FE) find_package(OpenDDS REQUIRED COMPONENTS NO_DEFAULTS ${deps}) include(opendds_build_helpers) @@ -36,3 +38,5 @@ set_target_properties(opendds_idl PROPERTIES # opendds_idl doesn't play nice with bundling the cpp files together UNITY_BUILD FALSE ) + +install(FILES IDLTemplate.txt DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dds/dds/idl") diff --git a/tests/DCPS/Messenger/publisher.cpp b/tests/DCPS/Messenger/publisher.cpp index d81c587ff3c..341d772bc24 100644 --- a/tests/DCPS/Messenger/publisher.cpp +++ b/tests/DCPS/Messenger/publisher.cpp @@ -81,9 +81,9 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) if (TheServiceParticipant->get_security()) { // Determine the path to the keys String path_to_tests; - const char* const source_root = ACE_OS::getenv("OPENDDS_SOURCE_ROOT"); + const char* const source_root = ACE_OS::getenv("OPENDDS_SOURCE_DIR"); if (source_root && source_root[0]) { - // Use OPENDDS_SOURCE_ROOT in case we are one of the CMake tests + // Use OPENDDS_SOURCE_DIR in case we are one of the CMake tests path_to_tests = String("file:") + source_root + "/tests/"; } else { // Else try to do it relative to the traditional location diff --git a/tests/DCPS/Messenger/subscriber.cpp b/tests/DCPS/Messenger/subscriber.cpp index 93921f8de5b..442229427fa 100644 --- a/tests/DCPS/Messenger/subscriber.cpp +++ b/tests/DCPS/Messenger/subscriber.cpp @@ -64,9 +64,9 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) if (TheServiceParticipant->get_security()) { // Determine the path to the keys String path_to_tests; - const char* const source_root = ACE_OS::getenv("OPENDDS_SOURCE_ROOT"); + const char* const source_root = ACE_OS::getenv("OPENDDS_SOURCE_DIR"); if (source_root && source_root[0]) { - // Use OPENDDS_SOURCE_ROOT in case we are one of the CMake tests + // Use OPENDDS_SOURCE_DIR in case we are one of the CMake tests path_to_tests = String("file:") + source_root + "/tests/"; } else { // Else try to do it relative to the traditional location diff --git a/tests/cmake/Messenger/Messenger_2/CMakeLists.txt b/tests/cmake/Messenger/Messenger_2/CMakeLists.txt index 993076f1ea4..4482aac9bef 100644 --- a/tests/cmake/Messenger/Messenger_2/CMakeLists.txt +++ b/tests/cmake/Messenger/Messenger_2/CMakeLists.txt @@ -8,6 +8,7 @@ project(opendds_messenger_2 CXX) cmake_minimum_required(VERSION 3.8.2) enable_testing() +set(OPENDDS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../..") find_package(OpenDDS REQUIRED) include(opendds_testing) @@ -45,8 +46,7 @@ add_executable(${publisher} set_target_properties(${publisher} PROPERTIES OUTPUT_NAME publisher ) -target_include_directories(${publisher} PRIVATE "${src}/../../../") -target_link_libraries(${publisher} ${messenger} OpenDDS::OpenDDS) +target_link_libraries(${publisher} ${messenger} OpenDDS::OpenDDS OpenDDS::TestUtils) # Subscriber add_executable(${subscriber} diff --git a/tools/dds/rtpsrelaylib/CMakeLists.txt b/tools/dds/rtpsrelaylib/CMakeLists.txt new file mode 100644 index 00000000000..1c8913ade70 --- /dev/null +++ b/tools/dds/rtpsrelaylib/CMakeLists.txt @@ -0,0 +1,30 @@ +project(opendds_rtps_relay_lib CXX) + +set(deps + OpenDDS::Dcps +) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps} safety_profile=FALSE) +include(opendds_build_helpers) + +add_library(OpenDDS_RtpsRelayLib + Name.cpp +) +set_target_properties(OpenDDS_RtpsRelayLib PROPERTIES OUTPUT_NAME OpenDDS_RtpsRelay) +target_sources(OpenDDS_RtpsRelayLib + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}/tools" FILES + Name.h + PartitionIndex.h + Utility.h + export.h +) +_opendds_library(OpenDDS_RtpsRelayLib) +target_link_libraries(OpenDDS_RtpsRelayLib PUBLIC ${deps}) + +opendds_target_sources(OpenDDS_RtpsRelayLib + PUBLIC + Relay.idl + INCLUDE_BASE "${OPENDDS_SOURCE_DIR}/tools" + USE_EXPORT "dds/rtpsrelaylib/export.h" OpenDDS_RtpsRelayLib_Export + OPENDDS_IDL_OPTIONS -Lc++11 +) +opendds_install_interface_files(OpenDDS_RtpsRelayLib INCLUDE_BASE "${OPENDDS_SOURCE_DIR}/tools") diff --git a/tools/inspect/CMakeLists.txt b/tools/inspect/CMakeLists.txt new file mode 100644 index 00000000000..68bc427a662 --- /dev/null +++ b/tools/inspect/CMakeLists.txt @@ -0,0 +1,11 @@ +project(opendds_inspect CXX) + +set(dep_libs + OpenDDS::Rtps_Udp +) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${dep_libs} safety_profile=FALSE) +include(opendds_build_helpers) + +add_executable(inspect Inspect.cpp) +_opendds_executable(inspect) +target_link_libraries(inspect ${dep_libs}) diff --git a/tools/rtpsrelay/CMakeLists.txt b/tools/rtpsrelay/CMakeLists.txt new file mode 100644 index 00000000000..412b0c7b744 --- /dev/null +++ b/tools/rtpsrelay/CMakeLists.txt @@ -0,0 +1,29 @@ +project(opendds_rtps_relay CXX) + +set(dep_libs + OpenDDS::Rtps_Udp + OpenDDS::Security + OpenDDS::RtpsRelayLib +) +find_package(OpenDDS REQUIRED ${dep_libs} built_in_topics safety_profile=FALSE) +include(opendds_build_helpers) + +add_executable(RtpsRelay + GuidAddrSet.cpp + GuidPartitionTable.cpp + ParticipantListener.cpp + ParticipantStatisticsReporter.cpp + PublicationListener.cpp + RelayAddressListener.cpp + RelayHandler.cpp + RelayHttpMetaDiscovery.cpp + RelayParticipantStatusReporter.cpp + RelayPartitionsListener.cpp + RelayStatusReporter.cpp + RelayThreadMonitor.cpp + RtpsRelay.cpp + SpdpReplayListener.cpp + SubscriptionListener.cpp +) +_opendds_executable(RtpsRelay) +target_link_libraries(RtpsRelay ${dep_libs}) diff --git a/tools/rtpsrelay/RelayThreadMonitor.cpp b/tools/rtpsrelay/RelayThreadMonitor.cpp index e897736425d..080e5d52fd7 100644 --- a/tools/rtpsrelay/RelayThreadMonitor.cpp +++ b/tools/rtpsrelay/RelayThreadMonitor.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -67,7 +68,7 @@ int RelayThreadMonitor::svc() continue; } - const DDS::Time_t timestamp = SystemTimePoint::now().to_dds_time() - time_value_to_duration((thread_status_interval * safety_factor).value()); + const SystemTimePoint expire = SystemTimePoint::now() - thread_status_interval * safety_factor; for (CORBA::ULong idx = 0; idx != infos.length(); ++idx) { if (infos[idx].valid_data) { @@ -82,7 +83,8 @@ int RelayThreadMonitor::svc() to_json(infos[idx]).c_str())); } - if (infos[idx].instance_state == DDS::ALIVE_INSTANCE_STATE && infos[idx].source_timestamp < timestamp) { + const SystemTimePoint timestamp(infos[idx].source_timestamp); + if (infos[idx].instance_state == DDS::ALIVE_INSTANCE_STATE && timestamp < expire) { ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: RelayThreadMonitor::svc thread %C failed to update status. Aborting...\n"), datas[idx].thread_id.in())); From 28132c2ad8710115037f7ae85ce1dd773528b389 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Thu, 29 Jun 2023 20:36:12 -0500 Subject: [PATCH 018/140] Allow Building ACE/TAO with CMake with Ninja --- cmake/tao_idl_sources.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index 1f172a5fabc..cb5fcc62261 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -226,13 +226,19 @@ function(_opendds_tao_idl target) message(STATUS "tao_idl: ${generated_file}") endforeach() endif() + + set(tao_idl "$") + if(CMAKE_GENERATOR STREQUAL "Ninja" AND TAO_IS_BEING_BUILT) + set(tao_idl "$") + set(gperf_location "$") + endif() add_custom_command( OUTPUT ${generated_files} DEPENDS TAO::tao_idl ${tao_idl_shared_libs} ACE::ace_gperf MAIN_DEPENDENCY ${idl_file_path} COMMAND ${CMAKE_COMMAND} -E env "DDS_ROOT=${DDS_ROOT}" "TAO_ROOT=${TAO_INCLUDE_DIR}" "${extra_lib_dirs}" - $ -g ${gperf_location} ${feature_flags} -Sg + "${tao_idl}" -g ${gperf_location} ${feature_flags} -Sg -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h --idl-version 4 -as --unknown-annotations ignore -I${TAO_INCLUDE_DIR} -I${working_source_dir} From b0f84f0635a33e315fb27374f40f5fa66433fa0f Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Mon, 17 Jul 2023 12:57:28 -0500 Subject: [PATCH 019/140] Windows Fixes, Lof of Other Fixes --- CMakeLists.txt | 695 +----------------- cmake/.gitignore | 1 + cmake/OpenDDSConfig.cmake | 2 +- cmake/build_ace_tao.cmake | 53 +- cmake/config.cmake.in | 5 + cmake/configure_ace_tao.pl | 1 + cmake/dds_idl_sources.cmake | 2 +- cmake/init.cmake | 12 + cmake/opendds_features.cmake | 5 +- cmake/opendds_installed_config.cmake.in | 3 - cmake/tao_group.cmake | 7 +- cmake/tao_idl_sources.cmake | 41 +- dds/CMakeLists.txt | 635 ++++++++++++++++ dds/DCPS/CMakeLists.txt | 4 +- .../rtps_udp/RtpsUdpSendStrategy.cpp | 3 +- 15 files changed, 780 insertions(+), 689 deletions(-) create mode 100644 cmake/config.cmake.in delete mode 100644 cmake/opendds_installed_config.cmake.in create mode 100644 dds/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index be7a935570d..1df1b7155ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,21 @@ cmake_minimum_required(VERSION 3.22) project(opendds CXX) -enable_testing() include(CMakePackageConfigHelpers) include(GNUInstallDirs) include(FetchContent) set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") +set(OPENDDS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "") set(OPENDDS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") +get_filename_component(_OPENDDS_SOURCE_DIR_REAL "${OPENDDS_SOURCE_DIR}" REALPATH) +get_filename_component(_OPENDDS_BUILD_DIR_REAL "${OPENDDS_BUILD_DIR}" REALPATH) +if("${_OPENDDS_SOURCE_DIR_REAL}" STREQUAL "${_OPENDDS_BUILD_DIR_REAL}") + message(FATAL_ERROR "Please build OpenDDS in a different directory from the source") +endif() set(OPENDDS_BIN_DIR "${OPENDDS_BUILD_DIR}/bin" CACHE INTERNAL "") set(OPENDDS_LIB_DIR "${OPENDDS_BUILD_DIR}/lib" CACHE INTERNAL "") -set(OPENDDS_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "") list(APPEND CMAKE_PREFIX_PATH "${OPENDDS_SOURCE_DIR}") list(APPEND CMAKE_FIND_ROOT_PATH "${OPENDDS_SOURCE_DIR}") set(_OPENDDS_CMAKE_DIR "${OPENDDS_SOURCE_DIR}/cmake" CACHE INTERNAL "") @@ -22,14 +26,6 @@ if(NOT DEFINED OPENDDS_ACE) include("${_OPENDDS_CMAKE_DIR}/build_ace_tao.cmake") endif() -if(DEFINED OPENDDS_ACE_TAO_HOST_TOOLS) - set(_OPENDDS_ACE_HOST_TOOLS "${OPENDDS_ACE_TAO_HOST_TOOLS}/bin" CACHE INTERNAL "") - set(_OPENDDS_TAO_HOST_TOOLS "${OPENDDS_ACE_TAO_HOST_TOOLS}/bin" CACHE INTERNAL "") -endif() -if(DEFINED OPENDDS_HOST_TOOLS) - set(_OPENDDS_OPENDDS_HOST_TOOLS "${OPENDDS_HOST_TOOLS}/bin" CACHE INTERNAL "") -endif() - if(NOT DEFINED OPENDDS_RAPIDJSON) set(OPENDDS_RAPIDJSON "${OPENDDS_SOURCE_DIR}/tools/rapidjson") if(NOT EXISTS "${OPENDDS_RAPIDJSON}/include") @@ -43,645 +39,14 @@ if(NOT DEFINED OPENDDS_RAPIDJSON) endif() if(NOT CMAKE_CROSSCOMPILING) - add_subdirectory(dds/DCPS) - add_subdirectory(dds/idl) + add_subdirectory(dds/DCPS) # OpenDDS_Util + add_subdirectory(dds/idl) # opendds_idl if(BUILD_OPENDDS_HOST_TOOLS) return() endif() endif() -# TODO: Move Dcps to dds/CMakeLists.txt? - -set(dcps_lib_deps - ACE::ACE - TAO::TAO - TAO::PortableServer - TAO::BiDirGIOP - TAO::Valuetype -) -find_package(OpenDDS REQUIRED NO_DEFAULTS TAO::tao_idl OpenDDS::opendds_idl ${dcps_lib_deps}) -include(opendds_build_helpers) - -add_library(OpenDDS_Dcps - dds/DCPS/BitPubListenerImpl.cpp - dds/DCPS/BuiltInTopicUtils.cpp - dds/DCPS/CoherentChangeControl.cpp - dds/DCPS/ConditionImpl.cpp - dds/DCPS/ConfigStoreImpl.cpp - dds/DCPS/ConfigUtils.cpp - dds/DCPS/ConnectionRecords.cpp - dds/DCPS/ContentFilteredTopicImpl.cpp - dds/DCPS/DCPS_Utils.cpp - dds/DCPS/DataDurabilityCache.cpp - dds/DCPS/DataReaderImpl.cpp - dds/DCPS/DataSampleElement.cpp - dds/DCPS/DataSampleHeader.cpp - dds/DCPS/DataWriterImpl.cpp - dds/DCPS/DcpsUpcalls.cpp - dds/DCPS/DdsDcps_pch.cpp - dds/DCPS/Discovery.cpp - dds/DCPS/DisjointSequence.cpp - dds/DCPS/DispatchService.cpp - dds/DCPS/DomainParticipantFactoryImpl.cpp - dds/DCPS/DomainParticipantImpl.cpp - dds/DCPS/EntityImpl.cpp - dds/DCPS/EventDispatcher.cpp - dds/DCPS/FileSystemStorage.cpp - dds/DCPS/FilterEvaluator.cpp - dds/DCPS/GroupRakeData.cpp - dds/DCPS/GuardCondition.cpp - dds/DCPS/GuidBuilder.cpp - dds/DCPS/GuidConverter.cpp - dds/DCPS/GuidUtils.cpp - dds/DCPS/Hash.cpp - dds/DCPS/InstanceDataSampleList.cpp - dds/DCPS/InstanceHandle.cpp - dds/DCPS/InstanceState.cpp - dds/DCPS/JobQueue.cpp - dds/DCPS/LinuxNetworkConfigMonitor.cpp - dds/DCPS/LogAddr.cpp - dds/DCPS/Logging.cpp - dds/DCPS/Marked_Default_Qos.cpp - dds/DCPS/MemoryPool.cpp - dds/DCPS/MessageBlock.cpp - dds/DCPS/MessageTracker.cpp - dds/DCPS/MonitorFactory.cpp - dds/DCPS/MultiTopicDataReaderBase.cpp - dds/DCPS/MultiTopicImpl.cpp - dds/DCPS/MulticastManager.cpp - dds/DCPS/NetworkAddress.cpp - dds/DCPS/NetworkConfigModifier.cpp - dds/DCPS/NetworkConfigMonitor.cpp - dds/DCPS/NetworkResource.cpp - dds/DCPS/Observer.cpp - dds/DCPS/OwnershipManager.cpp - dds/DCPS/PeriodicEvent.cpp - dds/DCPS/PublisherImpl.cpp - dds/DCPS/Qos_Helper.cpp - dds/DCPS/QueryConditionImpl.cpp - dds/DCPS/RawDataSample.cpp - dds/DCPS/ReactorInterceptor.cpp - dds/DCPS/ReactorTask.cpp - dds/DCPS/ReadConditionImpl.cpp - dds/DCPS/ReceivedDataElementList.cpp - dds/DCPS/ReceivedDataStrategy.cpp - dds/DCPS/Recorder.cpp - dds/DCPS/RecorderImpl.cpp - dds/DCPS/Registered_Data_Types.cpp - dds/DCPS/Replayer.cpp - dds/DCPS/ReplayerImpl.cpp - dds/DCPS/RepoIdBuilder.cpp - dds/DCPS/RepoIdConverter.cpp - dds/DCPS/RepoIdGenerator.cpp - dds/DCPS/SafetyProfilePool.cpp - dds/DCPS/SafetyProfileSequences.cpp - dds/DCPS/SafetyProfileStreams.cpp - dds/DCPS/SendStateDataSampleList.cpp - dds/DCPS/SequenceNumber.cpp - dds/DCPS/Serializer.cpp - dds/DCPS/ServiceEventDispatcher.cpp - dds/DCPS/Service_Participant.cpp - dds/DCPS/SporadicEvent.cpp - dds/DCPS/StaticDiscovery.cpp - dds/DCPS/StatusConditionImpl.cpp - dds/DCPS/SubscriberImpl.cpp - dds/DCPS/SubscriptionInstance.cpp - dds/DCPS/ThreadPool.cpp - dds/DCPS/ThreadStatusManager.cpp - dds/DCPS/TimeDuration.cpp - dds/DCPS/Time_Helper.cpp - dds/DCPS/TopicDescriptionImpl.cpp - dds/DCPS/TopicImpl.cpp - dds/DCPS/Transient_Kludge.cpp - dds/DCPS/TypeSupportImpl.cpp - dds/DCPS/ValueReader.cpp - dds/DCPS/ValueWriter.cpp - dds/DCPS/WaitSet.cpp - dds/DCPS/WriteDataContainer.cpp - dds/DCPS/WriterDataSampleList.cpp - dds/DCPS/WriterInfo.cpp - dds/DCPS/XTypes/DynamicDataAdapter.cpp - dds/DCPS/XTypes/DynamicDataBase.cpp - dds/DCPS/XTypes/DynamicDataFactory.cpp - dds/DCPS/XTypes/DynamicDataImpl.cpp - dds/DCPS/XTypes/DynamicDataReaderImpl.cpp - dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp - dds/DCPS/XTypes/DynamicSample.cpp - dds/DCPS/XTypes/DynamicTypeImpl.cpp - dds/DCPS/XTypes/DynamicTypeMemberImpl.cpp - dds/DCPS/XTypes/DynamicTypeSupport.cpp - dds/DCPS/XTypes/MemberDescriptorImpl.cpp - dds/DCPS/XTypes/TypeAssignability.cpp - dds/DCPS/XTypes/TypeDescriptorImpl.cpp - dds/DCPS/XTypes/TypeLookupService.cpp - dds/DCPS/XTypes/TypeObject.cpp - dds/DCPS/XTypes/Utils.cpp - dds/DCPS/debug.cpp - dds/DCPS/security/framework/HandleRegistry.cpp - dds/DCPS/security/framework/SecurityConfig.cpp - dds/DCPS/security/framework/SecurityPluginInst.cpp - dds/DCPS/security/framework/SecurityRegistry.cpp - dds/DCPS/transport/framework/BuildChainVisitor.cpp - dds/DCPS/transport/framework/CopyChainVisitor.cpp - dds/DCPS/transport/framework/DataLink.cpp - dds/DCPS/transport/framework/DataLinkCleanupTask.cpp - dds/DCPS/transport/framework/DataLinkSet.cpp - dds/DCPS/transport/framework/DirectPriorityMapper.cpp - dds/DCPS/transport/framework/MessageDropper.cpp - dds/DCPS/transport/framework/NullSynch.cpp - dds/DCPS/transport/framework/NullSynchStrategy.cpp - dds/DCPS/transport/framework/PacketRemoveVisitor.cpp - dds/DCPS/transport/framework/PerConnectionSynch.cpp - dds/DCPS/transport/framework/PerConnectionSynchStrategy.cpp - dds/DCPS/transport/framework/PoolSynch.cpp - dds/DCPS/transport/framework/PoolSynchStrategy.cpp - dds/DCPS/transport/framework/PriorityKey.cpp - dds/DCPS/transport/framework/PriorityMapper.cpp - dds/DCPS/transport/framework/QueueRemoveVisitor.cpp - dds/DCPS/transport/framework/ReactorSynch.cpp - dds/DCPS/transport/framework/ReactorSynchStrategy.cpp - dds/DCPS/transport/framework/ReceiveListenerSet.cpp - dds/DCPS/transport/framework/ReceiveListenerSetMap.cpp - dds/DCPS/transport/framework/ReceivedDataSample.cpp - dds/DCPS/transport/framework/RemoveAllVisitor.cpp - dds/DCPS/transport/framework/ScheduleOutputHandler.cpp - dds/DCPS/transport/framework/SendResponseListener.cpp - dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.cpp - dds/DCPS/transport/framework/ThreadPerConnectionSendTask.cpp - dds/DCPS/transport/framework/ThreadSynch.cpp - dds/DCPS/transport/framework/ThreadSynchResource.cpp - dds/DCPS/transport/framework/ThreadSynchStrategy.cpp - dds/DCPS/transport/framework/ThreadSynchWorker.cpp - dds/DCPS/transport/framework/TransportClient.cpp - dds/DCPS/transport/framework/TransportConfig.cpp - dds/DCPS/transport/framework/TransportControlElement.cpp - dds/DCPS/transport/framework/TransportCustomizedElement.cpp - dds/DCPS/transport/framework/TransportDebug.cpp - dds/DCPS/transport/framework/TransportHeader.cpp - dds/DCPS/transport/framework/TransportImpl.cpp - dds/DCPS/transport/framework/TransportInst.cpp - dds/DCPS/transport/framework/TransportQueueElement.cpp - dds/DCPS/transport/framework/TransportReassembly.cpp - dds/DCPS/transport/framework/TransportReceiveListener.cpp - dds/DCPS/transport/framework/TransportReceiveStrategy.cpp - dds/DCPS/transport/framework/TransportRegistry.cpp - dds/DCPS/transport/framework/TransportReplacedElement.cpp - dds/DCPS/transport/framework/TransportRetainedElement.cpp - dds/DCPS/transport/framework/TransportSendBuffer.cpp - dds/DCPS/transport/framework/TransportSendControlElement.cpp - dds/DCPS/transport/framework/TransportSendElement.cpp - dds/DCPS/transport/framework/TransportSendListener.cpp - dds/DCPS/transport/framework/TransportSendStrategy.cpp - dds/DCPS/transport/framework/TransportStatistics.cpp - dds/DCPS/transport/framework/TransportStrategy.cpp - dds/DCPS/transport/framework/TransportType.cpp -) -target_sources(OpenDDS_Dcps - PUBLIC FILE_SET HEADERS FILES - FACE/Fixed.h - FACE/OpenDDS_FACE_Export.h - FACE/Sequence.h - FACE/SequenceVar.h - FACE/StringManager.h - FACE/TS.hpp - FACE/TS_common.hpp - FACE/common.hpp - FACE/types.hpp - dds/DCPS/AddressCache.h - dds/DCPS/AssociationData.h - dds/DCPS/AstNodeWrapper.h - dds/DCPS/Atomic.h - dds/DCPS/AtomicBool.h - dds/DCPS/BitPubListenerImpl.h - dds/DCPS/BuiltInTopicDataReaderImpls.h - dds/DCPS/BuiltInTopicUtils.h - dds/DCPS/Cached_Allocator_With_Overflow_T.h - dds/DCPS/CoherentChangeControl.h - dds/DCPS/CoherentChangeControl.inl - dds/DCPS/Comparator_T.h - dds/DCPS/ConditionImpl.h - dds/DCPS/ConditionVariable.h - dds/DCPS/ConfigStoreImpl.h - dds/DCPS/ConfigUtils.h - dds/DCPS/ConnectionRecords.h - dds/DCPS/ContentFilteredTopicImpl.h - dds/DCPS/DCPS_Utils.h - dds/DCPS/DataBlockLockPool.h - dds/DCPS/DataCollector_T.cpp - dds/DCPS/DataCollector_T.h - dds/DCPS/DataCollector_T.inl - dds/DCPS/DataDurabilityCache.h - dds/DCPS/DataReaderCallbacks.h - dds/DCPS/DataReaderImpl.h - dds/DCPS/DataReaderImpl.inl - dds/DCPS/DataReaderImpl_T.h - dds/DCPS/DataSampleElement.h - dds/DCPS/DataSampleElement.inl - dds/DCPS/DataSampleHeader.h - dds/DCPS/DataSampleHeader.inl - dds/DCPS/DataWriterCallbacks.h - dds/DCPS/DataWriterImpl.h - dds/DCPS/DataWriterImpl_T.h - dds/DCPS/DcpsUpcalls.h - dds/DCPS/DdsDcps_pch.h - dds/DCPS/DefaultNetworkConfigMonitor.h - dds/DCPS/Definitions.h - dds/DCPS/DirentWrapper.h - dds/DCPS/Discovery.h - dds/DCPS/DiscoveryListener.h - dds/DCPS/DisjointSequence.h - dds/DCPS/DisjointSequence.inl - dds/DCPS/DispatchService.h - dds/DCPS/DomainParticipantFactoryImpl.h - dds/DCPS/DomainParticipantImpl.h - dds/DCPS/DurabilityArray.h - dds/DCPS/DurabilityQueue.h - dds/DCPS/Dynamic_Cached_Allocator_With_Overflow_T.h - dds/DCPS/EntityImpl.h - dds/DCPS/EventDispatcher.h - dds/DCPS/FeatureDisabledQosCheck.h - dds/DCPS/FibonacciSequence.h - dds/DCPS/FileSystemStorage.h - dds/DCPS/FilterEvaluator.h - dds/DCPS/FilterExpressionGrammar.h - dds/DCPS/GroupRakeData.h - dds/DCPS/GuardCondition.h - dds/DCPS/GuidBuilder.h - dds/DCPS/GuidBuilder.inl - dds/DCPS/GuidConverter.h - dds/DCPS/GuidUtils.h - dds/DCPS/Hash.h - dds/DCPS/Ice.h - dds/DCPS/InstanceDataSampleList.h - dds/DCPS/InstanceDataSampleList.inl - dds/DCPS/InstanceHandle.h - dds/DCPS/InstanceState.h - dds/DCPS/InstanceState.inl - dds/DCPS/InternalDataReader.h - dds/DCPS/InternalDataReaderListener.h - dds/DCPS/InternalDataWriter.h - dds/DCPS/InternalTopic.h - dds/DCPS/JobQueue.h - dds/DCPS/JsonValueReader.h - dds/DCPS/JsonValueWriter.h - dds/DCPS/LinuxNetworkConfigMonitor.h - dds/DCPS/LocalObject.h - dds/DCPS/LogAddr.h - dds/DCPS/Logging.h - dds/DCPS/Marked_Default_Qos.h - dds/DCPS/MemoryPool.h - dds/DCPS/MessageBlock.h - dds/DCPS/MessageTracker.h - dds/DCPS/Message_Block_Ptr.h - dds/DCPS/MonitorFactory.h - dds/DCPS/MultiTask.h - dds/DCPS/MultiTopicDataReaderBase.h - dds/DCPS/MultiTopicDataReader_T.cpp - dds/DCPS/MultiTopicDataReader_T.h - dds/DCPS/MultiTopicImpl.h - dds/DCPS/MulticastManager.h - dds/DCPS/NetworkAddress.h - dds/DCPS/NetworkConfigModifier.h - dds/DCPS/NetworkConfigMonitor.h - dds/DCPS/NetworkResource.h - dds/DCPS/NetworkResource.inl - dds/DCPS/Observer.h - dds/DCPS/OwnershipManager.h - dds/DCPS/PeriodicEvent.h - dds/DCPS/PeriodicTask.h - dds/DCPS/PoolAllocationBase.h - dds/DCPS/PoolAllocator.h - dds/DCPS/PrinterValueWriter.h - dds/DCPS/PublicationInstance.h - dds/DCPS/PublisherImpl.h - dds/DCPS/Qos_Helper.h - dds/DCPS/Qos_Helper.inl - dds/DCPS/QueryConditionImpl.h - dds/DCPS/RakeData.h - dds/DCPS/RakeResults_T.cpp - dds/DCPS/RakeResults_T.h - dds/DCPS/RapidJsonWrapper.h - dds/DCPS/RawDataSample.h - dds/DCPS/RcEventHandler.h - dds/DCPS/RcHandle_T.h - dds/DCPS/RcObject.h - dds/DCPS/ReactorInterceptor.h - dds/DCPS/ReactorTask.h - dds/DCPS/ReactorTask.inl - dds/DCPS/ReactorTask_rch.h - dds/DCPS/ReadConditionImpl.h - dds/DCPS/ReceivedDataElementList.h - dds/DCPS/ReceivedDataElementList.inl - dds/DCPS/ReceivedDataStrategy.h - dds/DCPS/Recorder.h - dds/DCPS/RecorderImpl.h - dds/DCPS/Registered_Data_Types.h - dds/DCPS/Replayer.h - dds/DCPS/ReplayerImpl.h - dds/DCPS/RepoIdBuilder.h - dds/DCPS/RepoIdBuilder.inl - dds/DCPS/RepoIdConverter.h - dds/DCPS/RepoIdGenerator.h - dds/DCPS/RestoreOutputStreamState.h - dds/DCPS/SafeBool_T.h - dds/DCPS/SafetyProfilePool.h - dds/DCPS/SafetyProfileSequence.h - dds/DCPS/SafetyProfileSequenceVar.h - dds/DCPS/SafetyProfileSequences.h - dds/DCPS/SafetyProfileStreams.h - dds/DCPS/Sample.h - dds/DCPS/SendStateDataSampleList.h - dds/DCPS/SendStateDataSampleList.inl - dds/DCPS/SequenceIterator.h - dds/DCPS/SequenceNumber.h - dds/DCPS/Serializer.h - dds/DCPS/Serializer.inl - dds/DCPS/ServiceEventDispatcher.h - dds/DCPS/Service_Participant.h - dds/DCPS/Service_Participant.inl - dds/DCPS/SporadicEvent.h - dds/DCPS/SporadicTask.h - dds/DCPS/StaticDiscovery.h - dds/DCPS/StaticIncludes.h - dds/DCPS/Stats_T.h - dds/DCPS/StatusConditionImpl.h - dds/DCPS/SubscriberImpl.h - dds/DCPS/SubscriptionInstance.h - dds/DCPS/ThreadPool.h - dds/DCPS/ThreadStatusManager.h - dds/DCPS/TimeDuration.h - dds/DCPS/TimeDuration.inl - dds/DCPS/TimePoint_T.cpp - dds/DCPS/TimePoint_T.h - dds/DCPS/TimePoint_T.inl - dds/DCPS/TimeSource.h - dds/DCPS/TimeTypes.h - dds/DCPS/Time_Helper.h - dds/DCPS/Time_Helper.inl - dds/DCPS/TopicCallbacks.h - dds/DCPS/TopicDescriptionImpl.h - dds/DCPS/TopicDetails.h - dds/DCPS/TopicExpressionGrammar.h - dds/DCPS/TopicImpl.h - dds/DCPS/Transient_Kludge.h - dds/DCPS/Transient_Kludge.inl - dds/DCPS/TypeSupportImpl.h - dds/DCPS/Util.h - dds/DCPS/ValueDispatcher.h - dds/DCPS/ValueHelper.h - dds/DCPS/ValueReader.h - dds/DCPS/ValueWriter.h - dds/DCPS/WaitSet.h - dds/DCPS/WriteDataContainer.h - dds/DCPS/WriterDataSampleList.h - dds/DCPS/WriterDataSampleList.inl - dds/DCPS/WriterInfo.h - dds/DCPS/XTypes/DynamicDataAdapter.h - dds/DCPS/XTypes/DynamicDataBase.h - dds/DCPS/XTypes/DynamicDataFactory.h - dds/DCPS/XTypes/DynamicDataImpl.h - dds/DCPS/XTypes/DynamicDataReaderImpl.h - dds/DCPS/XTypes/DynamicDataWriterImpl.h - dds/DCPS/XTypes/DynamicDataXcdrReadImpl.h - dds/DCPS/XTypes/DynamicSample.h - dds/DCPS/XTypes/DynamicTypeImpl.h - dds/DCPS/XTypes/DynamicTypeMemberImpl.h - dds/DCPS/XTypes/DynamicTypeSupport.h - dds/DCPS/XTypes/External.h - dds/DCPS/XTypes/MemberDescriptorImpl.h - dds/DCPS/XTypes/TypeAssignability.h - dds/DCPS/XTypes/TypeDescriptorImpl.h - dds/DCPS/XTypes/TypeLookupService.h - dds/DCPS/XTypes/TypeObject.h - dds/DCPS/XTypes/TypeObjectC.h - dds/DCPS/XTypes/TypeObjectTypeSupportImpl.h - dds/DCPS/XTypes/Utils.h - dds/DCPS/ZeroCopyAllocator_T.cpp - dds/DCPS/ZeroCopyAllocator_T.h - dds/DCPS/ZeroCopyAllocator_T.inl - dds/DCPS/ZeroCopyInfoSeq_T.h - dds/DCPS/ZeroCopySeqBase.h - dds/DCPS/ZeroCopySeq_T.cpp - dds/DCPS/ZeroCopySeq_T.h - dds/DCPS/ZeroCopySeq_T.inl - dds/DCPS/dcps_export.h - dds/DCPS/debug.h - dds/DCPS/security/framework/HandleRegistry.h - dds/DCPS/security/framework/Properties.h - dds/DCPS/security/framework/SecurityConfig.h - dds/DCPS/security/framework/SecurityConfigPropertyList.h - dds/DCPS/security/framework/SecurityConfig_rch.h - dds/DCPS/security/framework/SecurityPluginInst.h - dds/DCPS/security/framework/SecurityPluginInst_rch.h - dds/DCPS/security/framework/SecurityRegistry.h - dds/DCPS/transport/framework/BasicQueueVisitor_T.h - dds/DCPS/transport/framework/BasicQueue_T.h - dds/DCPS/transport/framework/BuildChainVisitor.h - dds/DCPS/transport/framework/BuildChainVisitor.inl - dds/DCPS/transport/framework/CopyChainVisitor.h - dds/DCPS/transport/framework/CopyChainVisitor.inl - dds/DCPS/transport/framework/DataLink.h - dds/DCPS/transport/framework/DataLink.inl - dds/DCPS/transport/framework/DataLinkCleanupTask.h - dds/DCPS/transport/framework/DataLinkSet.h - dds/DCPS/transport/framework/DataLinkSet.inl - dds/DCPS/transport/framework/DataLinkSet_rch.h - dds/DCPS/transport/framework/DataLink_rch.h - dds/DCPS/transport/framework/DirectPriorityMapper.h - dds/DCPS/transport/framework/DirectPriorityMapper.inl - dds/DCPS/transport/framework/EntryExit.h - dds/DCPS/transport/framework/MessageDropper.h - dds/DCPS/transport/framework/NullSynch.h - dds/DCPS/transport/framework/NullSynch.inl - dds/DCPS/transport/framework/NullSynchStrategy.h - dds/DCPS/transport/framework/PacketRemoveVisitor.h - dds/DCPS/transport/framework/PacketRemoveVisitor.inl - dds/DCPS/transport/framework/PerConnectionSynch.h - dds/DCPS/transport/framework/PerConnectionSynch.inl - dds/DCPS/transport/framework/PerConnectionSynchStrategy.h - dds/DCPS/transport/framework/PerConnectionSynchStrategy.inl - dds/DCPS/transport/framework/PoolSynch.h - dds/DCPS/transport/framework/PoolSynch.inl - dds/DCPS/transport/framework/PoolSynchStrategy.h - dds/DCPS/transport/framework/PoolSynchStrategy.inl - dds/DCPS/transport/framework/PriorityKey.h - dds/DCPS/transport/framework/PriorityKey.inl - dds/DCPS/transport/framework/PriorityMapper.h - dds/DCPS/transport/framework/PriorityMapper.inl - dds/DCPS/transport/framework/QueueRemoveVisitor.h - dds/DCPS/transport/framework/QueueRemoveVisitor.inl - dds/DCPS/transport/framework/QueueTaskBase_T.h - dds/DCPS/transport/framework/ReactorSynch.h - dds/DCPS/transport/framework/ReactorSynch.inl - dds/DCPS/transport/framework/ReactorSynchStrategy.h - dds/DCPS/transport/framework/ReactorSynchStrategy.inl - dds/DCPS/transport/framework/ReceiveListenerSet.h - dds/DCPS/transport/framework/ReceiveListenerSet.inl - dds/DCPS/transport/framework/ReceiveListenerSetMap.h - dds/DCPS/transport/framework/ReceiveListenerSetMap.inl - dds/DCPS/transport/framework/ReceiveListenerSet_rch.h - dds/DCPS/transport/framework/ReceivedDataSample.h - dds/DCPS/transport/framework/RemoveAllVisitor.h - dds/DCPS/transport/framework/RemoveAllVisitor.inl - dds/DCPS/transport/framework/ScheduleOutputHandler.h - dds/DCPS/transport/framework/ScheduleOutputHandler.inl - dds/DCPS/transport/framework/SendResponseListener.h - dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.h - dds/DCPS/transport/framework/ThreadPerConRemoveVisitor.inl - dds/DCPS/transport/framework/ThreadPerConnectionSendTask.h - dds/DCPS/transport/framework/ThreadSynch.h - dds/DCPS/transport/framework/ThreadSynch.inl - dds/DCPS/transport/framework/ThreadSynchResource.h - dds/DCPS/transport/framework/ThreadSynchResource.inl - dds/DCPS/transport/framework/ThreadSynchStrategy.h - dds/DCPS/transport/framework/ThreadSynchStrategy.inl - dds/DCPS/transport/framework/ThreadSynchStrategy_rch.h - dds/DCPS/transport/framework/ThreadSynchWorker.h - dds/DCPS/transport/framework/ThreadSynchWorker.inl - dds/DCPS/transport/framework/TransportClient.h - dds/DCPS/transport/framework/TransportConfig.h - dds/DCPS/transport/framework/TransportConfig_rch.h - dds/DCPS/transport/framework/TransportControlElement.h - dds/DCPS/transport/framework/TransportControlElement.inl - dds/DCPS/transport/framework/TransportCustomizedElement.h - dds/DCPS/transport/framework/TransportCustomizedElement.inl - dds/DCPS/transport/framework/TransportDebug.h - dds/DCPS/transport/framework/TransportDefs.h - dds/DCPS/transport/framework/TransportExceptions.h - dds/DCPS/transport/framework/TransportHeader.h - dds/DCPS/transport/framework/TransportHeader.inl - dds/DCPS/transport/framework/TransportImpl.h - dds/DCPS/transport/framework/TransportImpl.inl - dds/DCPS/transport/framework/TransportImpl_rch.h - dds/DCPS/transport/framework/TransportInst.h - dds/DCPS/transport/framework/TransportInst.inl - dds/DCPS/transport/framework/TransportInst_rch.h - dds/DCPS/transport/framework/TransportQueueElement.h - dds/DCPS/transport/framework/TransportQueueElement.inl - dds/DCPS/transport/framework/TransportReassembly.h - dds/DCPS/transport/framework/TransportReceiveListener.h - dds/DCPS/transport/framework/TransportReceiveStrategy_T.cpp - dds/DCPS/transport/framework/TransportReceiveStrategy_T.h - dds/DCPS/transport/framework/TransportReceiveStrategy_T.inl - dds/DCPS/transport/framework/TransportReceiveStrategy_rch.h - dds/DCPS/transport/framework/TransportRegistry.h - dds/DCPS/transport/framework/TransportRegistry.inl - dds/DCPS/transport/framework/TransportReplacedElement.h - dds/DCPS/transport/framework/TransportReplacedElement.inl - dds/DCPS/transport/framework/TransportRetainedElement.h - dds/DCPS/transport/framework/TransportRetainedElement.inl - dds/DCPS/transport/framework/TransportSendBuffer.h - dds/DCPS/transport/framework/TransportSendBuffer.inl - dds/DCPS/transport/framework/TransportSendControlElement.h - dds/DCPS/transport/framework/TransportSendControlElement.inl - dds/DCPS/transport/framework/TransportSendElement.h - dds/DCPS/transport/framework/TransportSendElement.inl - dds/DCPS/transport/framework/TransportSendListener.h - dds/DCPS/transport/framework/TransportSendStrategy.h - dds/DCPS/transport/framework/TransportSendStrategy.inl - dds/DCPS/transport/framework/TransportSendStrategy_rch.h - dds/DCPS/transport/framework/TransportStatistics.h - dds/DCPS/transport/framework/TransportStrategy.h - dds/DCPS/transport/framework/TransportStrategy_rch.h - dds/DCPS/transport/framework/TransportType.h - dds/DCPS/transport/framework/TransportType_rch.h - dds/DCPS/unique_ptr.h - dds/DCPS/yard/yard_base_grammar.hpp - dds/DCPS/yard/yard_char_set.hpp - dds/DCPS/yard/yard_parser.hpp - dds/DCPS/yard/yard_text_grammar.hpp - dds/DCPS/yard/yard_tree.hpp - dds/Version.h - dds/Versioned_Namespace.h -) -target_compile_definitions(OpenDDS_Dcps PUBLIC ${OPENDDS_DCPS_COMPILE_DEFINITIONS}) -_opendds_library(OpenDDS_Dcps MSVC_BIGOBJ) -target_include_directories(OpenDDS_Dcps - PUBLIC - "$" - "$" - PRIVATE - "${CMAKE_CURRENT_SOURCE_DIR}/dds" -) -if(OPENDDS_RAPIDJSON) - target_include_directories(OpenDDS_Dcps PUBLIC "$") -endif() -target_link_libraries(OpenDDS_Dcps PUBLIC ${dcps_lib_deps}) - -set(opendds_target_sources_args - AUTO_LINK FALSE - USE_EXPORT "dds/DCPS/dcps_export.h" OpenDDS_Dcps_Export - INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" -) - -opendds_target_sources(OpenDDS_Dcps - PUBLIC - dds/CorbaSeq/BooleanSeq.idl - dds/CorbaSeq/CharSeq.idl - dds/CorbaSeq/DoubleSeq.idl - dds/CorbaSeq/FloatSeq.idl - dds/CorbaSeq/Int8Seq.idl - dds/CorbaSeq/LongDoubleSeq.idl - dds/CorbaSeq/LongLongSeq.idl - dds/CorbaSeq/LongSeq.idl - dds/CorbaSeq/OctetSeq.idl - dds/CorbaSeq/ShortSeq.idl - dds/CorbaSeq/StringSeq.idl - dds/CorbaSeq/UInt8Seq.idl - dds/CorbaSeq/ULongLongSeq.idl - dds/CorbaSeq/ULongSeq.idl - dds/CorbaSeq/UShortSeq.idl - dds/CorbaSeq/WCharSeq.idl - dds/CorbaSeq/WStringSeq.idl - SKIP_TAO_IDL - OPENDDS_IDL_OPTIONS -SI -Wb,tao_include_prefix=tao/ - ${opendds_target_sources_args} -) - -opendds_target_sources(OpenDDS_Dcps - PUBLIC - dds/DdsDcps.idl - dds/DdsDcpsConditionSeq.idl # TODO - dds/DdsDcpsCore.idl # TODO - dds/DdsDcpsDataReaderSeq.idl # TODO - dds/DdsDcpsDomain.idl - dds/DdsDcpsGuid.idl # TODO - dds/DdsDcpsInfoUtils.idl # TODO - dds/DdsDcpsInfrastructure.idl - dds/DdsDcpsPublication.idl - dds/DdsDcpsSubscription.idl - dds/DdsDcpsSubscriptionExt.idl - dds/DdsDcpsTopic.idl - dds/DdsDcpsTypeSupportExt.idl - dds/DdsSecurityCore.idl # TODO - dds/DdsSecurityParams.idl # TODO - dds/OpenddsDcpsExt.idl # TODO - ${opendds_target_sources_args} -) - -opendds_target_sources(OpenDDS_Dcps - PUBLIC - dds/DdsDynamicDataSeq.idl - ${opendds_target_sources_args} -) - -# valuetypes in DdsDynamicData.idl require -Scdr -# -Scdr requires -Sa whether or not the dds_suppress_anys feature is on -opendds_target_sources(OpenDDS_Dcps - PUBLIC - dds/DdsDynamicData.idl - dds/DdsDynamicTypeSupport.idl - TAO_IDL_OPTIONS -Scdr -Sa - ${opendds_target_sources_args} -) - -get_target_property(gendir OpenDDS_Dcps OPENDDS_GENERATED_DIRECTORY) -set(config_file "${gendir}/dds/DCPS/config.h") -configure_file("${_OPENDDS_CMAKE_DIR}/config.h.in" "${config_file}") -opendds_install_interface_files(OpenDDS_Dcps INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" - EXTRA_GENERATED_FILES "${config_file}" -) - +add_subdirectory(dds) # OpenDDS_Dcps add_subdirectory(dds/DCPS/transport/multicast) add_subdirectory(dds/DCPS/RTPS) add_subdirectory(dds/DCPS/transport/rtps_udp) @@ -692,24 +57,24 @@ add_subdirectory(dds/DCPS/transport/udp) add_subdirectory(dds/InfoRepo) if(OPENDDS_SECURITY) add_subdirectory(dds/DCPS/security) + if(OPENDDS_BUILT_IN_TOPICS) + add_subdirectory(tools/dds/rtpsrelaylib) + add_subdirectory(tools/rtpsrelay) + endif() endif() add_subdirectory(tools/inspect) -add_subdirectory(tools/dds/rtpsrelaylib) -add_subdirectory(tools/rtpsrelay) set(cmake_dest "${CMAKE_INSTALL_DATAROOTDIR}/cmake/OpenDDS") install(EXPORT opendds_targets FILE "opendds_targets.cmake" DESTINATION ${cmake_dest} ) -set(pkg_config_cmake "opendds_installed_config.cmake") -set(tmp_pkg_config_cmake "${CMAKE_CURRENT_BINARY_DIR}/${pkg_config_cmake}") -configure_package_config_file( - "cmake/${pkg_config_cmake}.in" ${tmp_pkg_config_cmake} - INSTALL_DESTINATION ${cmake_dest} -) -set(tmp_config_cmake "${CMAKE_CURRENT_BINARY_DIR}/config.cmake") -configure_file("${_OPENDDS_CMAKE_DIR}/config.cmake.in" "${tmp_config_cmake}") +set(config_cmake "${CMAKE_CURRENT_BINARY_DIR}/config.cmake") +set(opendds_feature_vars) +foreach(var ${_OPENDDS_FEATURE_VARS}) + set(opendds_feature_vars "${opendds_feature_vars}set(${var} ${${var}})\n") +endforeach() +configure_file("${_OPENDDS_CMAKE_DIR}/config.cmake.in" "${config_cmake}") install( FILES cmake/OpenDDSConfig.cmake @@ -726,8 +91,7 @@ install( cmake/opendds_testing.cmake cmake/tao_group.cmake cmake/tao_idl_sources.cmake - "${tmp_pkg_config_cmake}" - "${tmp_config_cmake}" + "${config_cmake}" DESTINATION "${cmake_dest}" ) install(FILES VERSION.txt DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dds/") @@ -736,9 +100,16 @@ if(OPENDDS_RAPIDJSON) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) endif() -add_subdirectory(DevGuideExamples/DCPS/Messenger) -add_subdirectory(tests/cmake/ace_tao_only) -add_subdirectory(tests/cmake/Messenger) -# add_subdirectory(tests/cmake/idl_compiler_tests) -add_subdirectory(tests/cmake/include_subdir) -add_subdirectory(tests/cmake/generated_global) +if(NOT DEFINED OPENDDS_BUILD_TESTS AND BUILD_TESTING) + set(OPENDDS_BUILD_TESTS TRUE) +endif() +if(OPENDDS_BUILD_EXAMPLES OR OPENDDS_BUILD_TESTS) + add_subdirectory(DevGuideExamples/DCPS/Messenger) +endif() +if(OPENDDS_BUILD_TESTS) + add_subdirectory(tests/cmake/ace_tao_only) + add_subdirectory(tests/cmake/Messenger) + add_subdirectory(tests/cmake/idl_compiler_tests) + add_subdirectory(tests/cmake/include_subdir) + add_subdirectory(tests/cmake/generated_global) +endif() diff --git a/cmake/.gitignore b/cmake/.gitignore index 5c02b66b286..7a4c1bc408f 100644 --- a/cmake/.gitignore +++ b/cmake/.gitignore @@ -1,2 +1,3 @@ # Ignore because it will be auto-generated by $DDS_ROOT/configure /config.cmake* +!/config.cmake.in diff --git a/cmake/OpenDDSConfig.cmake b/cmake/OpenDDSConfig.cmake index 6d9f578a43c..d17e00ac934 100644 --- a/cmake/OpenDDSConfig.cmake +++ b/cmake/OpenDDSConfig.cmake @@ -220,7 +220,7 @@ if(_opendds_tao_find_libs OR _opendds_tao_find_exes) endif() if(_OPENDDS_CMAKE_BUILT_AND_INSTALLED) - include("${CMAKE_CURRENT_LIST_DIR}/opendds_installed_config.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/opendds_targets.cmake") set(OpenDDS_FOUND TRUE) elseif(_opendds_find_libs OR _opendds_find_exes) _opendds_find_group_targets(OpenDDS "${_opendds_find_libs}" "${_opendds_find_exes}") diff --git a/cmake/build_ace_tao.cmake b/cmake/build_ace_tao.cmake index a058356f767..03c4a90bbb3 100644 --- a/cmake/build_ace_tao.cmake +++ b/cmake/build_ace_tao.cmake @@ -11,10 +11,17 @@ set(ace_ver "7.1.0") set(configre_ace_tao_args) if(WIN32) set(ext "zip") - set(md5 "46f1ca435aa6f22cbafb80f8ac78d8cb") - set(mpc_type vs2017) + set(md5 "032e0d4c969d675b5e72cce29858ebf8") + if(CMAKE_GENERATOR STREQUAL "Visual Studio 17 2022") + set(mpc_type vs2022) + elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 16 2019") + set(mpc_type vs2019) + elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 15 2017") + set(mpc_type vs2017) + else() + set(mpc_type vs2022) + endif() set(config_file "config-win32.h") - # TODO: Invoke msbuild else() set(ext "tar.bz2") set(md5 "4696c2898de3bda28dd69abf0055b7eb") @@ -96,6 +103,46 @@ if(mpc_type STREQUAL gnuace) USES_TERMINAL_BUILD TRUE # Needed for Ninja to show the ACE/TAO build INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "No install step" ) +elseif(mpc_type MATCHES "^vs") + set(sln ACE_TAO_for_OpenDDS.sln) + execute_process( + COMMAND + "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/scrape_vs.pl" + --sln "${OPENDDS_ACE}/${sln}" + --ace "${OPENDDS_ACE}" + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + OUTPUT_VARIABLE mpc_projects + ) + set(_OPENDDS_ACE_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") + set(_OPENDDS_ACE_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") + set(_OPENDDS_TAO_MPC_PROJECTS "${mpc_projects}" CACHE INTERNAL "") + set(_OPENDDS_TAO_MPC_EXTERNAL_PROJECT "build_ace_tao" CACHE INTERNAL "") + + string(JSON project_count LENGTH "${mpc_projects}") + if(project_count EQUAL 0) + message(FATAL_ERROR "MPC projects was empty!") + endif() + set(byproducts) + math(EXPR member_index_end "${project_count} - 1") + foreach(member_index RANGE ${member_index_end}) + string(JSON member_name MEMBER "${mpc_projects}" ${member_index}) + string(JSON mpc_project GET "${mpc_projects}" ${member_name}) + string(JSON file GET "${mpc_project}" loc) + list(APPEND byproducts "${file}") + endforeach() + + ExternalProject_Add(build_ace_tao + SOURCE_DIR "${OPENDDS_ACE}" + CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "Already configured" + BUILD_IN_SOURCE TRUE + BUILD_COMMAND + "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}" + MSBuild "${sln}" -property:Configuration=Debug,Platform=x64 + BUILD_BYPRODUCTS ${byproducts} + USES_TERMINAL_BUILD TRUE # Needed for Ninja to show the ACE/TAO build + INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "No install step" + ) else() message(FATAL_ERROR "Not sure how to build ACE/TAO for this system") endif() diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in new file mode 100644 index 00000000000..a58069321a7 --- /dev/null +++ b/cmake/config.cmake.in @@ -0,0 +1,5 @@ +set(_OPENDDS_CMAKE_BUILT_AND_INSTALLED TRUE) +set(OPENDDS_USE_PREFIX_PATH TRUE) +set(OPENDDS_INSTALL_LIB @CMAKE_INSTALL_LIBDIR@) + +@opendds_feature_vars@ diff --git a/cmake/configure_ace_tao.pl b/cmake/configure_ace_tao.pl index 2a972013f8b..e643a66d7ea 100755 --- a/cmake/configure_ace_tao.pl +++ b/cmake/configure_ace_tao.pl @@ -74,6 +74,7 @@ sub run_command { print $config_file ( "#define ACE_DISABLE_MKTEMP\n" . "#define ACE_LACKS_READDIR_R\n" . + "#define ACE_LACKS_TEMPNAM\n" . "#include \"$values{'config-file'}\"\n"); close($config_file); diff --git a/cmake/dds_idl_sources.cmake b/cmake/dds_idl_sources.cmake index a4c9475dfbf..41aaf99b07a 100644 --- a/cmake/dds_idl_sources.cmake +++ b/cmake/dds_idl_sources.cmake @@ -263,7 +263,7 @@ function(_opendds_target_idl_sources target) else() _opendds_get_generated_idl_output( ${target} "${arg_INCLUDE_BASE}" "${input}" "${opendds_idl_opt_-o}" output_prefix output_dir) - _opendds_get_generated_output_dir(${target} file_auto_includes) + _opendds_get_generated_output_dir(${target} file_auto_includes O_OPT "${opendds_idl_opt_-o}") if(arg_INCLUDE_BASE) list(APPEND file_auto_includes "${arg_INCLUDE_BASE}") endif() diff --git a/cmake/init.cmake b/cmake/init.cmake index bd75d08634e..b448eb56357 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -248,3 +248,15 @@ endif() if(DEFINED OPENDDS_SANITIZER_LINKER_ARGS) list(APPEND OPENDDS_ALL_LIBS_INTERFACE_LINK_OPTIONS "${OPENDDS_SANITIZER_LINKER_ARGS}") endif() + +if(DEFINED OPENDDS_ACE_TAO_HOST_TOOLS) + set(_OPENDDS_ACE_HOST_TOOLS "${OPENDDS_ACE_TAO_HOST_TOOLS}/bin" CACHE INTERNAL "") + set(_OPENDDS_TAO_HOST_TOOLS "${OPENDDS_ACE_TAO_HOST_TOOLS}/bin" CACHE INTERNAL "") +endif() +if(DEFINED OPENDDS_HOST_TOOLS) + set(_OPENDDS_OPENDDS_HOST_TOOLS "${OPENDDS_HOST_TOOLS}/bin" CACHE INTERNAL "") + if(NOT DEFINED OPENDDS_ACE_TAO_HOST_TOOLS) + set(_OPENDDS_ACE_HOST_TOOLS "${_OPENDDS_OPENDDS_HOST_TOOLS}" CACHE INTERNAL "") + set(_OPENDDS_TAO_HOST_TOOLS "${_OPENDDS_OPENDDS_HOST_TOOLS}/bin" CACHE INTERNAL "") + endif() +endif() diff --git a/cmake/opendds_features.cmake b/cmake/opendds_features.cmake index 76f5aa2b040..3e228fdf421 100644 --- a/cmake/opendds_features.cmake +++ b/cmake/opendds_features.cmake @@ -3,6 +3,7 @@ if(DEFINED _OPENDDS_ALL_FEATURES) endif() set(_OPENDDS_ALL_FEATURES) +set(_OPENDDS_FEATURE_VARS) set(_OPENDDS_MPC_FEATURES) function(_opendds_feature name default_value) set(no_value_options MPC MPC_INVERTED) @@ -12,11 +13,12 @@ function(_opendds_feature name default_value) "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) string(TOLOWER "${name}" lowercase_name) + list(APPEND _OPENDDS_ALL_FEATURES "${lowercase_name}") set(name "OPENDDS_${name}") if(NOT DEFINED "${name}") set("${name}" "${default_value}" CACHE INTERNAL "") endif() - list(APPEND _OPENDDS_ALL_FEATURES "${lowercase_name}") + list(APPEND _OPENDDS_FEATURE_VARS "${name}") if(arg_MPC OR arg_MPC_INVERTED) if(NOT DEFINED arg_MPC_NAME) set(arg_MPC_NAME "${lowercase_name}") @@ -37,6 +39,7 @@ function(_opendds_feature name default_value) endif() set(_OPENDDS_ALL_FEATURES "${_OPENDDS_ALL_FEATURES}" CACHE INTERNAL "" FORCE) + set(_OPENDDS_FEATURE_VARS "${_OPENDDS_FEATURE_VARS}" CACHE INTERNAL "" FORCE) set(_OPENDDS_MPC_FEATURES "${_OPENDDS_MPC_FEATURES}" CACHE INTERNAL "" FORCE) endfunction() diff --git a/cmake/opendds_installed_config.cmake.in b/cmake/opendds_installed_config.cmake.in deleted file mode 100644 index 2968f9aabf3..00000000000 --- a/cmake/opendds_installed_config.cmake.in +++ /dev/null @@ -1,3 +0,0 @@ -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/opendds_targets.cmake") diff --git a/cmake/tao_group.cmake b/cmake/tao_group.cmake index a0a1fba93d6..90cba577dee 100644 --- a/cmake/tao_group.cmake +++ b/cmake/tao_group.cmake @@ -12,8 +12,13 @@ include("${CMAKE_CURRENT_LIST_DIR}/import_common.cmake") _opendds_group(TAO DEFAULT_REQUIRED TAO::TAO TAO::tao_idl) +if(MSVC) + set(_mpc_name TAO) +else() + set(_mpc_name TAO-target) +endif() _opendds_group_lib(TAO - MPC_NAME TAO-target + MPC_NAME "${_mpc_name}" DEPENDS ACE::ACE ) _opendds_group_lib(IDL_FE diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index cb5fcc62261..fce998f1299 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -19,21 +19,29 @@ function(_opendds_tao_append_runtime_lib_dir_to_path dst) endfunction() function(_opendds_get_generated_output_dir target output_dir_var) + set(no_value_options) + set(single_value_options O_OPT) + set(multi_value_options) + cmake_parse_arguments(arg + "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) + # TODO base output_dir_var on target - set(${output_dir_var} "${CMAKE_CURRENT_BINARY_DIR}/opendds_generated" PARENT_SCOPE) + set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/opendds_generated") + if(arg_O_OPT) + if(IS_ABSOLUTE "${arg_O_OPT}") + set(output_dir "${arg_O_OPT}") + else() + set(output_dir "${output_dir}/${arg_O_OPT}") + endif() + endif() + set(${output_dir_var} "${output_dir}" PARENT_SCOPE) endfunction() -function(_opendds_ensure_generated_output_dir target include_base file o_arg output_dir_var) +function(_opendds_ensure_generated_output_dir target include_base file o_opt output_dir_var) get_filename_component(abs_file "${file}" ABSOLUTE) get_filename_component(abs_dir "${abs_file}" DIRECTORY) - _opendds_get_generated_output_dir("${target}" output_dir) - if(o_arg) - if(IS_ABSOLUTE "${o_arg}") - set(output_dir "${o_arg}") - else() - set(output_dir "${output_dir}/${o_arg}") - endif() - elseif(include_base AND NOT OPENDDS_FILENAME_ONLY_INCLUDES) + _opendds_get_generated_output_dir("${target}" output_dir O_OPT "${o_opt}") + if(include_base AND NOT OPENDDS_FILENAME_ONLY_INCLUDES AND NOT O_OPT) get_filename_component(output_dir "${output_dir}" REALPATH) get_filename_component(real_abs_file "${abs_file}" REALPATH) get_filename_component(real_include_base "${include_base}" REALPATH) @@ -48,7 +56,7 @@ function(_opendds_ensure_generated_output_dir target include_base file o_arg out endif() get_filename_component(rel_dir "${rel_file}" DIRECTORY) if(rel_file MATCHES "^\\.\\.") - message(WARNING "THIS IS WRONG: ${rel_file}") + message(FATAL_ERROR "This IDL file:\n\n ${rel_file}\n\nis outside the INCLUDE_BASE:\n\n ${include_base}") endif() if(rel_dir) set(output_dir "${output_dir}/${rel_dir}") @@ -65,8 +73,9 @@ function(_opendds_get_generated_file_path target include_base file output_path_v endfunction() function(_opendds_get_generated_idl_output - target include_base idl_file o_arg output_prefix_var output_dir_var) - _opendds_ensure_generated_output_dir(${target} "${include_base}" "${idl_file}" "${o_arg}" output_dir) + target include_base idl_file o_opt output_prefix_var output_dir_var) + _opendds_ensure_generated_output_dir( + ${target} "${include_base}" "${idl_file}" "${o_opt}" output_dir) get_filename_component(idl_filename_no_ext ${idl_file} NAME_WE) set(${output_prefix_var} "${output_dir}/${idl_filename_no_ext}" PARENT_SCOPE) set(${output_dir_var} "${output_dir}" PARENT_SCOPE) @@ -136,7 +145,8 @@ function(_opendds_tao_idl target) list(APPEND added_output_args "-o" "${output_dir}") if(idl_cmd_arg_-oS) _opendds_get_generated_idl_output( - ${target} "${arg_INCLUDE_BASE}" ${idl_file} "${idl_cmd_arg_-oS}" skel_output_prefix skel_output_dir) + ${target} "${arg_INCLUDE_BASE}" ${idl_file} "${idl_cmd_arg_-oS}" + skel_output_prefix skel_output_dir) list(APPEND auto_includes "${skel_output_dir}") list(APPEND added_output_args "-oS" "${skel_output_dir}") else() @@ -144,7 +154,8 @@ function(_opendds_tao_idl target) endif() if(idl_cmd_arg_-oA) _opendds_get_generated_idl_output( - ${target} "${arg_INCLUDE_BASE}" "${idl_file}" "${idl_cmd_arg_-oA}" anyop_output_prefix anyop_output_dir) + ${target} "${arg_INCLUDE_BASE}" "${idl_file}" "${idl_cmd_arg_-oA}" + anyop_output_prefix anyop_output_dir) list(APPEND auto_includes "${anyop_output_dir}") list(APPEND added_output_args "-oA" "${anyop_output_dir}") else() diff --git a/dds/CMakeLists.txt b/dds/CMakeLists.txt new file mode 100644 index 00000000000..b28ca1f41a9 --- /dev/null +++ b/dds/CMakeLists.txt @@ -0,0 +1,635 @@ +# CMakeLists for OpenDDS_Dcps + +project(opendds_dcps CXX) + +set(dcps_lib_deps + ACE::ACE + TAO::TAO + TAO::PortableServer + TAO::BiDirGIOP + TAO::Valuetype +) +find_package(OpenDDS REQUIRED NO_DEFAULTS TAO::tao_idl OpenDDS::opendds_idl ${dcps_lib_deps}) +include(opendds_build_helpers) + +add_library(OpenDDS_Dcps + DCPS/BitPubListenerImpl.cpp + DCPS/BuiltInTopicUtils.cpp + DCPS/CoherentChangeControl.cpp + DCPS/ConditionImpl.cpp + DCPS/ConfigStoreImpl.cpp + DCPS/ConfigUtils.cpp + DCPS/ConnectionRecords.cpp + DCPS/ContentFilteredTopicImpl.cpp + DCPS/DCPS_Utils.cpp + DCPS/DataDurabilityCache.cpp + DCPS/DataReaderImpl.cpp + DCPS/DataSampleElement.cpp + DCPS/DataSampleHeader.cpp + DCPS/DataWriterImpl.cpp + DCPS/DcpsUpcalls.cpp + DCPS/DdsDcps_pch.cpp + DCPS/Discovery.cpp + DCPS/DisjointSequence.cpp + DCPS/DispatchService.cpp + DCPS/DomainParticipantFactoryImpl.cpp + DCPS/DomainParticipantImpl.cpp + DCPS/EntityImpl.cpp + DCPS/EventDispatcher.cpp + DCPS/FileSystemStorage.cpp + DCPS/FilterEvaluator.cpp + DCPS/GroupRakeData.cpp + DCPS/GuardCondition.cpp + DCPS/GuidBuilder.cpp + DCPS/GuidConverter.cpp + DCPS/GuidUtils.cpp + DCPS/Hash.cpp + DCPS/InstanceDataSampleList.cpp + DCPS/InstanceHandle.cpp + DCPS/InstanceState.cpp + DCPS/JobQueue.cpp + DCPS/LinuxNetworkConfigMonitor.cpp + DCPS/LogAddr.cpp + DCPS/Logging.cpp + DCPS/Marked_Default_Qos.cpp + DCPS/MemoryPool.cpp + DCPS/MessageBlock.cpp + DCPS/MessageTracker.cpp + DCPS/MonitorFactory.cpp + DCPS/MultiTopicDataReaderBase.cpp + DCPS/MultiTopicImpl.cpp + DCPS/MulticastManager.cpp + DCPS/NetworkAddress.cpp + DCPS/NetworkConfigModifier.cpp + DCPS/NetworkConfigMonitor.cpp + DCPS/NetworkResource.cpp + DCPS/Observer.cpp + DCPS/OwnershipManager.cpp + DCPS/PeriodicEvent.cpp + DCPS/PublisherImpl.cpp + DCPS/Qos_Helper.cpp + DCPS/QueryConditionImpl.cpp + DCPS/RawDataSample.cpp + DCPS/ReactorInterceptor.cpp + DCPS/ReactorTask.cpp + DCPS/ReadConditionImpl.cpp + DCPS/ReceivedDataElementList.cpp + DCPS/ReceivedDataStrategy.cpp + DCPS/Recorder.cpp + DCPS/RecorderImpl.cpp + DCPS/Registered_Data_Types.cpp + DCPS/Replayer.cpp + DCPS/ReplayerImpl.cpp + DCPS/RepoIdBuilder.cpp + DCPS/RepoIdConverter.cpp + DCPS/RepoIdGenerator.cpp + DCPS/SafetyProfilePool.cpp + DCPS/SafetyProfileSequences.cpp + DCPS/SafetyProfileStreams.cpp + DCPS/SendStateDataSampleList.cpp + DCPS/SequenceNumber.cpp + DCPS/Serializer.cpp + DCPS/ServiceEventDispatcher.cpp + DCPS/Service_Participant.cpp + DCPS/SporadicEvent.cpp + DCPS/StaticDiscovery.cpp + DCPS/StatusConditionImpl.cpp + DCPS/SubscriberImpl.cpp + DCPS/SubscriptionInstance.cpp + DCPS/ThreadPool.cpp + DCPS/ThreadStatusManager.cpp + DCPS/TimeDuration.cpp + DCPS/Time_Helper.cpp + DCPS/TopicDescriptionImpl.cpp + DCPS/TopicImpl.cpp + DCPS/Transient_Kludge.cpp + DCPS/TypeSupportImpl.cpp + DCPS/ValueReader.cpp + DCPS/ValueWriter.cpp + DCPS/WaitSet.cpp + DCPS/WriteDataContainer.cpp + DCPS/WriterDataSampleList.cpp + DCPS/WriterInfo.cpp + DCPS/XTypes/DynamicDataAdapter.cpp + DCPS/XTypes/DynamicDataBase.cpp + DCPS/XTypes/DynamicDataFactory.cpp + DCPS/XTypes/DynamicDataImpl.cpp + DCPS/XTypes/DynamicDataReaderImpl.cpp + DCPS/XTypes/DynamicDataXcdrReadImpl.cpp + DCPS/XTypes/DynamicSample.cpp + DCPS/XTypes/DynamicTypeImpl.cpp + DCPS/XTypes/DynamicTypeMemberImpl.cpp + DCPS/XTypes/DynamicTypeSupport.cpp + DCPS/XTypes/MemberDescriptorImpl.cpp + DCPS/XTypes/TypeAssignability.cpp + DCPS/XTypes/TypeDescriptorImpl.cpp + DCPS/XTypes/TypeLookupService.cpp + DCPS/XTypes/TypeObject.cpp + DCPS/XTypes/Utils.cpp + DCPS/debug.cpp + DCPS/security/framework/HandleRegistry.cpp + DCPS/security/framework/SecurityConfig.cpp + DCPS/security/framework/SecurityPluginInst.cpp + DCPS/security/framework/SecurityRegistry.cpp + DCPS/transport/framework/BuildChainVisitor.cpp + DCPS/transport/framework/CopyChainVisitor.cpp + DCPS/transport/framework/DataLink.cpp + DCPS/transport/framework/DataLinkCleanupTask.cpp + DCPS/transport/framework/DataLinkSet.cpp + DCPS/transport/framework/DirectPriorityMapper.cpp + DCPS/transport/framework/MessageDropper.cpp + DCPS/transport/framework/NullSynch.cpp + DCPS/transport/framework/NullSynchStrategy.cpp + DCPS/transport/framework/PacketRemoveVisitor.cpp + DCPS/transport/framework/PerConnectionSynch.cpp + DCPS/transport/framework/PerConnectionSynchStrategy.cpp + DCPS/transport/framework/PoolSynch.cpp + DCPS/transport/framework/PoolSynchStrategy.cpp + DCPS/transport/framework/PriorityKey.cpp + DCPS/transport/framework/PriorityMapper.cpp + DCPS/transport/framework/QueueRemoveVisitor.cpp + DCPS/transport/framework/ReactorSynch.cpp + DCPS/transport/framework/ReactorSynchStrategy.cpp + DCPS/transport/framework/ReceiveListenerSet.cpp + DCPS/transport/framework/ReceiveListenerSetMap.cpp + DCPS/transport/framework/ReceivedDataSample.cpp + DCPS/transport/framework/RemoveAllVisitor.cpp + DCPS/transport/framework/ScheduleOutputHandler.cpp + DCPS/transport/framework/SendResponseListener.cpp + DCPS/transport/framework/ThreadPerConRemoveVisitor.cpp + DCPS/transport/framework/ThreadPerConnectionSendTask.cpp + DCPS/transport/framework/ThreadSynch.cpp + DCPS/transport/framework/ThreadSynchResource.cpp + DCPS/transport/framework/ThreadSynchStrategy.cpp + DCPS/transport/framework/ThreadSynchWorker.cpp + DCPS/transport/framework/TransportClient.cpp + DCPS/transport/framework/TransportConfig.cpp + DCPS/transport/framework/TransportControlElement.cpp + DCPS/transport/framework/TransportCustomizedElement.cpp + DCPS/transport/framework/TransportDebug.cpp + DCPS/transport/framework/TransportHeader.cpp + DCPS/transport/framework/TransportImpl.cpp + DCPS/transport/framework/TransportInst.cpp + DCPS/transport/framework/TransportQueueElement.cpp + DCPS/transport/framework/TransportReassembly.cpp + DCPS/transport/framework/TransportReceiveListener.cpp + DCPS/transport/framework/TransportReceiveStrategy.cpp + DCPS/transport/framework/TransportRegistry.cpp + DCPS/transport/framework/TransportReplacedElement.cpp + DCPS/transport/framework/TransportRetainedElement.cpp + DCPS/transport/framework/TransportSendBuffer.cpp + DCPS/transport/framework/TransportSendControlElement.cpp + DCPS/transport/framework/TransportSendElement.cpp + DCPS/transport/framework/TransportSendListener.cpp + DCPS/transport/framework/TransportSendStrategy.cpp + DCPS/transport/framework/TransportStatistics.cpp + DCPS/transport/framework/TransportStrategy.cpp + DCPS/transport/framework/TransportType.cpp +) +target_sources(OpenDDS_Dcps + PUBLIC FILE_SET HEADERS + BASE_DIRS "${OPENDDS_SOURCE_DIR}" + FILES + ../FACE/Fixed.h + ../FACE/OpenDDS_FACE_Export.h + ../FACE/Sequence.h + ../FACE/SequenceVar.h + ../FACE/StringManager.h + ../FACE/TS.hpp + ../FACE/TS_common.hpp + ../FACE/common.hpp + ../FACE/types.hpp + DCPS/AddressCache.h + DCPS/AssociationData.h + DCPS/AstNodeWrapper.h + DCPS/Atomic.h + DCPS/AtomicBool.h + DCPS/BitPubListenerImpl.h + DCPS/BuiltInTopicDataReaderImpls.h + DCPS/BuiltInTopicUtils.h + DCPS/Cached_Allocator_With_Overflow_T.h + DCPS/CoherentChangeControl.h + DCPS/CoherentChangeControl.inl + DCPS/Comparator_T.h + DCPS/ConditionImpl.h + DCPS/ConditionVariable.h + DCPS/ConfigStoreImpl.h + DCPS/ConfigUtils.h + DCPS/ConnectionRecords.h + DCPS/ContentFilteredTopicImpl.h + DCPS/DCPS_Utils.h + DCPS/DataBlockLockPool.h + DCPS/DataCollector_T.cpp + DCPS/DataCollector_T.h + DCPS/DataCollector_T.inl + DCPS/DataDurabilityCache.h + DCPS/DataReaderCallbacks.h + DCPS/DataReaderImpl.h + DCPS/DataReaderImpl.inl + DCPS/DataReaderImpl_T.h + DCPS/DataSampleElement.h + DCPS/DataSampleElement.inl + DCPS/DataSampleHeader.h + DCPS/DataSampleHeader.inl + DCPS/DataWriterCallbacks.h + DCPS/DataWriterImpl.h + DCPS/DataWriterImpl_T.h + DCPS/DcpsUpcalls.h + DCPS/DdsDcps_pch.h + DCPS/DefaultNetworkConfigMonitor.h + DCPS/Definitions.h + DCPS/DirentWrapper.h + DCPS/Discovery.h + DCPS/DiscoveryListener.h + DCPS/DisjointSequence.h + DCPS/DisjointSequence.inl + DCPS/DispatchService.h + DCPS/DomainParticipantFactoryImpl.h + DCPS/DomainParticipantImpl.h + DCPS/DurabilityArray.h + DCPS/DurabilityQueue.h + DCPS/Dynamic_Cached_Allocator_With_Overflow_T.h + DCPS/EntityImpl.h + DCPS/EventDispatcher.h + DCPS/FeatureDisabledQosCheck.h + DCPS/FibonacciSequence.h + DCPS/FileSystemStorage.h + DCPS/FilterEvaluator.h + DCPS/FilterExpressionGrammar.h + DCPS/GroupRakeData.h + DCPS/GuardCondition.h + DCPS/GuidBuilder.h + DCPS/GuidBuilder.inl + DCPS/GuidConverter.h + DCPS/GuidUtils.h + DCPS/Hash.h + DCPS/Ice.h + DCPS/InstanceDataSampleList.h + DCPS/InstanceDataSampleList.inl + DCPS/InstanceHandle.h + DCPS/InstanceState.h + DCPS/InstanceState.inl + DCPS/InternalDataReader.h + DCPS/InternalDataReaderListener.h + DCPS/InternalDataWriter.h + DCPS/InternalTopic.h + DCPS/JobQueue.h + DCPS/JsonValueReader.h + DCPS/JsonValueWriter.h + DCPS/LinuxNetworkConfigMonitor.h + DCPS/LocalObject.h + DCPS/LogAddr.h + DCPS/Logging.h + DCPS/Marked_Default_Qos.h + DCPS/MemoryPool.h + DCPS/MessageBlock.h + DCPS/MessageTracker.h + DCPS/Message_Block_Ptr.h + DCPS/MonitorFactory.h + DCPS/MultiTask.h + DCPS/MultiTopicDataReaderBase.h + DCPS/MultiTopicDataReader_T.cpp + DCPS/MultiTopicDataReader_T.h + DCPS/MultiTopicImpl.h + DCPS/MulticastManager.h + DCPS/NetworkAddress.h + DCPS/NetworkConfigModifier.h + DCPS/NetworkConfigMonitor.h + DCPS/NetworkResource.h + DCPS/NetworkResource.inl + DCPS/Observer.h + DCPS/OwnershipManager.h + DCPS/PeriodicEvent.h + DCPS/PeriodicTask.h + DCPS/PoolAllocationBase.h + DCPS/PoolAllocator.h + DCPS/PrinterValueWriter.h + DCPS/PublicationInstance.h + DCPS/PublisherImpl.h + DCPS/Qos_Helper.h + DCPS/Qos_Helper.inl + DCPS/QueryConditionImpl.h + DCPS/RakeData.h + DCPS/RakeResults_T.cpp + DCPS/RakeResults_T.h + DCPS/RapidJsonWrapper.h + DCPS/RawDataSample.h + DCPS/RcEventHandler.h + DCPS/RcHandle_T.h + DCPS/RcObject.h + DCPS/ReactorInterceptor.h + DCPS/ReactorTask.h + DCPS/ReactorTask.inl + DCPS/ReactorTask_rch.h + DCPS/ReadConditionImpl.h + DCPS/ReceivedDataElementList.h + DCPS/ReceivedDataElementList.inl + DCPS/ReceivedDataStrategy.h + DCPS/Recorder.h + DCPS/RecorderImpl.h + DCPS/Registered_Data_Types.h + DCPS/Replayer.h + DCPS/ReplayerImpl.h + DCPS/RepoIdBuilder.h + DCPS/RepoIdBuilder.inl + DCPS/RepoIdConverter.h + DCPS/RepoIdGenerator.h + DCPS/RestoreOutputStreamState.h + DCPS/SafeBool_T.h + DCPS/SafetyProfilePool.h + DCPS/SafetyProfileSequence.h + DCPS/SafetyProfileSequenceVar.h + DCPS/SafetyProfileSequences.h + DCPS/SafetyProfileStreams.h + DCPS/Sample.h + DCPS/SendStateDataSampleList.h + DCPS/SendStateDataSampleList.inl + DCPS/SequenceIterator.h + DCPS/SequenceNumber.h + DCPS/Serializer.h + DCPS/Serializer.inl + DCPS/ServiceEventDispatcher.h + DCPS/Service_Participant.h + DCPS/Service_Participant.inl + DCPS/SporadicEvent.h + DCPS/SporadicTask.h + DCPS/StaticDiscovery.h + DCPS/StaticIncludes.h + DCPS/Stats_T.h + DCPS/StatusConditionImpl.h + DCPS/SubscriberImpl.h + DCPS/SubscriptionInstance.h + DCPS/ThreadPool.h + DCPS/ThreadStatusManager.h + DCPS/TimeDuration.h + DCPS/TimeDuration.inl + DCPS/TimePoint_T.cpp + DCPS/TimePoint_T.h + DCPS/TimePoint_T.inl + DCPS/TimeSource.h + DCPS/TimeTypes.h + DCPS/Time_Helper.h + DCPS/Time_Helper.inl + DCPS/TopicCallbacks.h + DCPS/TopicDescriptionImpl.h + DCPS/TopicDetails.h + DCPS/TopicExpressionGrammar.h + DCPS/TopicImpl.h + DCPS/Transient_Kludge.h + DCPS/Transient_Kludge.inl + DCPS/TypeSupportImpl.h + DCPS/Util.h + DCPS/ValueDispatcher.h + DCPS/ValueHelper.h + DCPS/ValueReader.h + DCPS/ValueWriter.h + DCPS/WaitSet.h + DCPS/WriteDataContainer.h + DCPS/WriterDataSampleList.h + DCPS/WriterDataSampleList.inl + DCPS/WriterInfo.h + DCPS/XTypes/DynamicDataAdapter.h + DCPS/XTypes/DynamicDataBase.h + DCPS/XTypes/DynamicDataFactory.h + DCPS/XTypes/DynamicDataImpl.h + DCPS/XTypes/DynamicDataReaderImpl.h + DCPS/XTypes/DynamicDataWriterImpl.h + DCPS/XTypes/DynamicDataXcdrReadImpl.h + DCPS/XTypes/DynamicSample.h + DCPS/XTypes/DynamicTypeImpl.h + DCPS/XTypes/DynamicTypeMemberImpl.h + DCPS/XTypes/DynamicTypeSupport.h + DCPS/XTypes/External.h + DCPS/XTypes/MemberDescriptorImpl.h + DCPS/XTypes/TypeAssignability.h + DCPS/XTypes/TypeDescriptorImpl.h + DCPS/XTypes/TypeLookupService.h + DCPS/XTypes/TypeObject.h + DCPS/XTypes/TypeObjectC.h + DCPS/XTypes/TypeObjectTypeSupportImpl.h + DCPS/XTypes/Utils.h + DCPS/ZeroCopyAllocator_T.cpp + DCPS/ZeroCopyAllocator_T.h + DCPS/ZeroCopyAllocator_T.inl + DCPS/ZeroCopyInfoSeq_T.h + DCPS/ZeroCopySeqBase.h + DCPS/ZeroCopySeq_T.cpp + DCPS/ZeroCopySeq_T.h + DCPS/ZeroCopySeq_T.inl + DCPS/dcps_export.h + DCPS/debug.h + DCPS/security/framework/HandleRegistry.h + DCPS/security/framework/Properties.h + DCPS/security/framework/SecurityConfig.h + DCPS/security/framework/SecurityConfigPropertyList.h + DCPS/security/framework/SecurityConfig_rch.h + DCPS/security/framework/SecurityPluginInst.h + DCPS/security/framework/SecurityPluginInst_rch.h + DCPS/security/framework/SecurityRegistry.h + DCPS/transport/framework/BasicQueueVisitor_T.h + DCPS/transport/framework/BasicQueue_T.h + DCPS/transport/framework/BuildChainVisitor.h + DCPS/transport/framework/BuildChainVisitor.inl + DCPS/transport/framework/CopyChainVisitor.h + DCPS/transport/framework/CopyChainVisitor.inl + DCPS/transport/framework/DataLink.h + DCPS/transport/framework/DataLink.inl + DCPS/transport/framework/DataLinkCleanupTask.h + DCPS/transport/framework/DataLinkSet.h + DCPS/transport/framework/DataLinkSet.inl + DCPS/transport/framework/DataLinkSet_rch.h + DCPS/transport/framework/DataLink_rch.h + DCPS/transport/framework/DirectPriorityMapper.h + DCPS/transport/framework/DirectPriorityMapper.inl + DCPS/transport/framework/EntryExit.h + DCPS/transport/framework/MessageDropper.h + DCPS/transport/framework/NullSynch.h + DCPS/transport/framework/NullSynch.inl + DCPS/transport/framework/NullSynchStrategy.h + DCPS/transport/framework/PacketRemoveVisitor.h + DCPS/transport/framework/PacketRemoveVisitor.inl + DCPS/transport/framework/PerConnectionSynch.h + DCPS/transport/framework/PerConnectionSynch.inl + DCPS/transport/framework/PerConnectionSynchStrategy.h + DCPS/transport/framework/PerConnectionSynchStrategy.inl + DCPS/transport/framework/PoolSynch.h + DCPS/transport/framework/PoolSynch.inl + DCPS/transport/framework/PoolSynchStrategy.h + DCPS/transport/framework/PoolSynchStrategy.inl + DCPS/transport/framework/PriorityKey.h + DCPS/transport/framework/PriorityKey.inl + DCPS/transport/framework/PriorityMapper.h + DCPS/transport/framework/PriorityMapper.inl + DCPS/transport/framework/QueueRemoveVisitor.h + DCPS/transport/framework/QueueRemoveVisitor.inl + DCPS/transport/framework/QueueTaskBase_T.h + DCPS/transport/framework/ReactorSynch.h + DCPS/transport/framework/ReactorSynch.inl + DCPS/transport/framework/ReactorSynchStrategy.h + DCPS/transport/framework/ReactorSynchStrategy.inl + DCPS/transport/framework/ReceiveListenerSet.h + DCPS/transport/framework/ReceiveListenerSet.inl + DCPS/transport/framework/ReceiveListenerSetMap.h + DCPS/transport/framework/ReceiveListenerSetMap.inl + DCPS/transport/framework/ReceiveListenerSet_rch.h + DCPS/transport/framework/ReceivedDataSample.h + DCPS/transport/framework/RemoveAllVisitor.h + DCPS/transport/framework/RemoveAllVisitor.inl + DCPS/transport/framework/ScheduleOutputHandler.h + DCPS/transport/framework/ScheduleOutputHandler.inl + DCPS/transport/framework/SendResponseListener.h + DCPS/transport/framework/ThreadPerConRemoveVisitor.h + DCPS/transport/framework/ThreadPerConRemoveVisitor.inl + DCPS/transport/framework/ThreadPerConnectionSendTask.h + DCPS/transport/framework/ThreadSynch.h + DCPS/transport/framework/ThreadSynch.inl + DCPS/transport/framework/ThreadSynchResource.h + DCPS/transport/framework/ThreadSynchResource.inl + DCPS/transport/framework/ThreadSynchStrategy.h + DCPS/transport/framework/ThreadSynchStrategy.inl + DCPS/transport/framework/ThreadSynchStrategy_rch.h + DCPS/transport/framework/ThreadSynchWorker.h + DCPS/transport/framework/ThreadSynchWorker.inl + DCPS/transport/framework/TransportClient.h + DCPS/transport/framework/TransportConfig.h + DCPS/transport/framework/TransportConfig_rch.h + DCPS/transport/framework/TransportControlElement.h + DCPS/transport/framework/TransportControlElement.inl + DCPS/transport/framework/TransportCustomizedElement.h + DCPS/transport/framework/TransportCustomizedElement.inl + DCPS/transport/framework/TransportDebug.h + DCPS/transport/framework/TransportDefs.h + DCPS/transport/framework/TransportExceptions.h + DCPS/transport/framework/TransportHeader.h + DCPS/transport/framework/TransportHeader.inl + DCPS/transport/framework/TransportImpl.h + DCPS/transport/framework/TransportImpl.inl + DCPS/transport/framework/TransportImpl_rch.h + DCPS/transport/framework/TransportInst.h + DCPS/transport/framework/TransportInst.inl + DCPS/transport/framework/TransportInst_rch.h + DCPS/transport/framework/TransportQueueElement.h + DCPS/transport/framework/TransportQueueElement.inl + DCPS/transport/framework/TransportReassembly.h + DCPS/transport/framework/TransportReceiveListener.h + DCPS/transport/framework/TransportReceiveStrategy_T.cpp + DCPS/transport/framework/TransportReceiveStrategy_T.h + DCPS/transport/framework/TransportReceiveStrategy_T.inl + DCPS/transport/framework/TransportReceiveStrategy_rch.h + DCPS/transport/framework/TransportRegistry.h + DCPS/transport/framework/TransportRegistry.inl + DCPS/transport/framework/TransportReplacedElement.h + DCPS/transport/framework/TransportReplacedElement.inl + DCPS/transport/framework/TransportRetainedElement.h + DCPS/transport/framework/TransportRetainedElement.inl + DCPS/transport/framework/TransportSendBuffer.h + DCPS/transport/framework/TransportSendBuffer.inl + DCPS/transport/framework/TransportSendControlElement.h + DCPS/transport/framework/TransportSendControlElement.inl + DCPS/transport/framework/TransportSendElement.h + DCPS/transport/framework/TransportSendElement.inl + DCPS/transport/framework/TransportSendListener.h + DCPS/transport/framework/TransportSendStrategy.h + DCPS/transport/framework/TransportSendStrategy.inl + DCPS/transport/framework/TransportSendStrategy_rch.h + DCPS/transport/framework/TransportStatistics.h + DCPS/transport/framework/TransportStrategy.h + DCPS/transport/framework/TransportStrategy_rch.h + DCPS/transport/framework/TransportType.h + DCPS/transport/framework/TransportType_rch.h + DCPS/unique_ptr.h + DCPS/yard/yard_base_grammar.hpp + DCPS/yard/yard_char_set.hpp + DCPS/yard/yard_parser.hpp + DCPS/yard/yard_text_grammar.hpp + DCPS/yard/yard_tree.hpp + Version.h + Versioned_Namespace.h +) +target_compile_definitions(OpenDDS_Dcps PUBLIC ${OPENDDS_DCPS_COMPILE_DEFINITIONS}) +_opendds_library(OpenDDS_Dcps MSVC_BIGOBJ) +target_include_directories(OpenDDS_Dcps + PUBLIC + "$" + "$" + PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}" +) +if(OPENDDS_RAPIDJSON) + target_include_directories(OpenDDS_Dcps PUBLIC "$") +endif() +target_link_libraries(OpenDDS_Dcps PUBLIC ${dcps_lib_deps}) + +set(opendds_target_sources_args + AUTO_LINK FALSE + USE_EXPORT "dds/DCPS/dcps_export.h" OpenDDS_Dcps_Export + INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" +) + +opendds_target_sources(OpenDDS_Dcps + PUBLIC + CorbaSeq/BooleanSeq.idl + CorbaSeq/CharSeq.idl + CorbaSeq/DoubleSeq.idl + CorbaSeq/FloatSeq.idl + CorbaSeq/Int8Seq.idl + CorbaSeq/LongDoubleSeq.idl + CorbaSeq/LongLongSeq.idl + CorbaSeq/LongSeq.idl + CorbaSeq/OctetSeq.idl + CorbaSeq/ShortSeq.idl + CorbaSeq/StringSeq.idl + CorbaSeq/UInt8Seq.idl + CorbaSeq/ULongLongSeq.idl + CorbaSeq/ULongSeq.idl + CorbaSeq/UShortSeq.idl + CorbaSeq/WCharSeq.idl + CorbaSeq/WStringSeq.idl + SKIP_TAO_IDL + OPENDDS_IDL_OPTIONS -SI -Wb,tao_include_prefix=tao/ + ${opendds_target_sources_args} +) + +opendds_target_sources(OpenDDS_Dcps + PUBLIC + DdsDcps.idl + DdsDcpsConditionSeq.idl # TODO + DdsDcpsCore.idl # TODO + DdsDcpsDataReaderSeq.idl # TODO + DdsDcpsDomain.idl + DdsDcpsGuid.idl # TODO + DdsDcpsInfoUtils.idl # TODO + DdsDcpsInfrastructure.idl + DdsDcpsPublication.idl + DdsDcpsSubscription.idl + DdsDcpsSubscriptionExt.idl + DdsDcpsTopic.idl + DdsDcpsTypeSupportExt.idl + DdsSecurityCore.idl # TODO + DdsSecurityParams.idl # TODO + OpenddsDcpsExt.idl # TODO + ${opendds_target_sources_args} +) + +opendds_target_sources(OpenDDS_Dcps + PUBLIC + DdsDynamicDataSeq.idl + ${opendds_target_sources_args} +) + +# valuetypes in DdsDynamicData.idl require -Scdr +# -Scdr requires -Sa whether or not the dds_suppress_anys feature is on +opendds_target_sources(OpenDDS_Dcps + PUBLIC + DdsDynamicData.idl + DdsDynamicTypeSupport.idl + TAO_IDL_OPTIONS -Scdr -Sa + ${opendds_target_sources_args} +) + +get_target_property(gendir OpenDDS_Dcps OPENDDS_GENERATED_DIRECTORY) +set(config_file "${gendir}/dds/DCPS/config.h") +configure_file("${_OPENDDS_CMAKE_DIR}/config.h.in" "${config_file}") +opendds_install_interface_files(OpenDDS_Dcps INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" + EXTRA_GENERATED_FILES "${config_file}" +) diff --git a/dds/DCPS/CMakeLists.txt b/dds/DCPS/CMakeLists.txt index 043b5ddef9f..376c3ee667a 100644 --- a/dds/DCPS/CMakeLists.txt +++ b/dds/DCPS/CMakeLists.txt @@ -22,7 +22,9 @@ add_library(OpenDDS_Util ${opendds_util_type} _opendds_library(OpenDDS_Util ${opendds_library_args}) target_compile_definitions(OpenDDS_Util PUBLIC OPENDDS_UTIL_BUILD) target_include_directories(OpenDDS_Util - PUBLIC ../.. + PUBLIC + "$" + "$" PRIVATE .. # For pch ${TAO_INCLUDE_DIRS} # Only for orbconf.h and idl_features.h in Definitions.h diff --git a/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp b/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp index 6ad85247422..f5b7f22fa6f 100644 --- a/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp +++ b/dds/DCPS/transport/rtps_udp/RtpsUdpSendStrategy.cpp @@ -57,7 +57,8 @@ RtpsUdpSendStrategy::RtpsUdpSendStrategy(RtpsUdpDataLink* link, } namespace { - bool ss_shouldWarn(int code) { + bool ss_shouldWarn(int code) + { return code == EPERM || code == EACCES || code == EINTR || code == ENOBUFS || code == ENOMEM || code == EADDRNOTAVAIL || code == ENETUNREACH; } From 005fa0e03938531744e44cc4a3ee5b87a7a8ad02 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 19 Jul 2023 08:27:39 -0500 Subject: [PATCH 020/140] Cleanup, Fixes, Docs, Add GHA Job for CMake Build --- .github/workflows/build_and_test.yml | 43 +++++ .gitignore | 1 + CMakeLists.txt | 25 ++- .../DCPS/Messenger/CMakeLists.txt | 6 +- cmake/ace_group.cmake | 10 +- cmake/build_ace_tao.cmake | 80 ++++++--- cmake/configure_ace_tao.pl | 13 +- cmake/import_common.cmake | 13 +- cmake/init.cmake | 10 +- cmake/opendds_features.cmake | 14 +- cmake/opendds_target_sources.cmake | 27 +++ cmake/opendds_testing.cmake | 2 +- cmake/tao_group.cmake | 6 +- cmake/tao_idl_sources.cmake | 9 +- dds/CMakeLists.txt | 3 +- dds/DCPS/CMakeLists.txt | 4 +- dds/DCPS/Definitions.h | 8 +- dds/DCPS/InfoRepoDiscovery/CMakeLists.txt | 1 + dds/DCPS/QOS_XML_Handler/CMakeLists.txt | 51 ++++++ dds/DCPS/RTPS/CMakeLists.txt | 1 + dds/DCPS/security/CMakeLists.txt | 1 + dds/DCPS/security/Utility.h | 20 +-- dds/DCPS/transport/multicast/CMakeLists.txt | 1 + dds/DCPS/transport/rtps_udp/CMakeLists.txt | 1 + dds/DCPS/transport/shmem/CMakeLists.txt | 1 + dds/DCPS/transport/tcp/CMakeLists.txt | 1 + dds/DCPS/transport/udp/CMakeLists.txt | 1 + dds/InfoRepo/CMakeLists.txt | 1 + dds/idl/CMakeLists.txt | 3 +- dds/idl/be_produce.cpp | 30 ++-- docs/building/cmake.rst | 89 +++++++++- docs/building/index.rst | 168 ++++++++++++++++++ docs/news.d/cmake-build.rst | 23 +++ .../typeobject_hash_consistency/.gitignore | 2 + .../typeobject_hash_consistency/run_test.pl | 48 +++-- .../Messenger/C++11_Messenger/CMakeLists.txt | 2 +- .../Messenger/Messenger_1/CMakeLists.txt | 2 +- .../Messenger/Messenger_2/CMakeLists.txt | 52 ++++-- tests/cmake/ace_tao_only/CMakeLists.txt | 4 +- .../cmake/generated_global/cpp/CMakeLists.txt | 4 - .../cmake/generated_global/idl/CMakeLists.txt | 9 +- tools/dds/rtpsrelaylib/CMakeLists.txt | 1 + tools/inspect/CMakeLists.txt | 1 + tools/rtpsrelay/CMakeLists.txt | 1 + 44 files changed, 660 insertions(+), 133 deletions(-) create mode 100644 dds/DCPS/QOS_XML_Handler/CMakeLists.txt create mode 100644 docs/news.d/cmake-build.rst create mode 100644 tests/DCPS/Compiler/typeobject_hash_consistency/.gitignore diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b1a2840cd6a..1bec72725c3 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -12648,3 +12648,46 @@ jobs: with: name: ${{ github.job }}_artifact path: ${{ github.job }}.tar.xz + + build_cmake_u22: + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v3 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v3 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v3 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: Install xerces + run: sudo apt-get -y install libxerces-c-dev + - name: Configure + run: | + cd OpenDDS + cmake -B build \ + -DCMAKE_UNITY_BUILD=TRUE \ + -DBUILD_SHARED_LIBS=FALSE \ + -DCMAKE_BUILD_TYPE=Debug \ + -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ + -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ + -DOPENDDS_BUILD_TESTS=TRUE \ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/gcc-problem-matcher@0.2.0 + - name: Build + run: | + cd OpenDDS + cmake --build build -- -j $(getconf _NPROCESSORS_ONLN) + - name: Run Tests + run: | + cd OpenDDS + cmake --build build -t test diff --git a/.gitignore b/.gitignore index a96ab750b37..50252aaa32b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ GNUmakefile* # CMake build/ +build-*/ cmake-build/ compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 1df1b7155ab..3bae1e105b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ -cmake_minimum_required(VERSION 3.22) - +cmake_minimum_required(VERSION 3.23) project(opendds CXX) include(CMakePackageConfigHelpers) @@ -8,11 +7,16 @@ include(FetchContent) set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") set(OPENDDS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "") +if(EXISTS "${OPENDDS_SOURCE_DIR}/dds/DdsDcpsC.h") + message(FATAL_ERROR "It looks like OpenDDS was already built here using MPC. This could cause " + "issues with a CMake build. Please clean this source tree or use a seperate one.") +endif() set(OPENDDS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") get_filename_component(_OPENDDS_SOURCE_DIR_REAL "${OPENDDS_SOURCE_DIR}" REALPATH) get_filename_component(_OPENDDS_BUILD_DIR_REAL "${OPENDDS_BUILD_DIR}" REALPATH) if("${_OPENDDS_SOURCE_DIR_REAL}" STREQUAL "${_OPENDDS_BUILD_DIR_REAL}") - message(FATAL_ERROR "Please build OpenDDS in a different directory from the source") + message(FATAL_ERROR "Please build OpenDDS in a different directory from the source tree " + "directory. Use something like \"cmake -B build\".") endif() set(OPENDDS_BIN_DIR "${OPENDDS_BUILD_DIR}/bin" CACHE INTERNAL "") set(OPENDDS_LIB_DIR "${OPENDDS_BUILD_DIR}/lib" CACHE INTERNAL "") @@ -22,7 +26,7 @@ set(_OPENDDS_CMAKE_DIR "${OPENDDS_SOURCE_DIR}/cmake" CACHE INTERNAL "") include("${_OPENDDS_CMAKE_DIR}/opendds_features.cmake") -if(NOT DEFINED OPENDDS_ACE) +if(NOT DEFINED OPENDDS_ACE OR (DEFINED ACE_TAO_CONFIGURED AND NOT ACE_TAO_CONFIGURED)) include("${_OPENDDS_CMAKE_DIR}/build_ace_tao.cmake") endif() @@ -41,7 +45,7 @@ endif() if(NOT CMAKE_CROSSCOMPILING) add_subdirectory(dds/DCPS) # OpenDDS_Util add_subdirectory(dds/idl) # opendds_idl - if(BUILD_OPENDDS_HOST_TOOLS) + if(OPENDDS_JUST_BUILD_HOST_TOOLS) return() endif() endif() @@ -55,6 +59,9 @@ add_subdirectory(dds/DCPS/transport/tcp) add_subdirectory(dds/DCPS/InfoRepoDiscovery) add_subdirectory(dds/DCPS/transport/udp) add_subdirectory(dds/InfoRepo) +if(OPENDDS_XERCES3) + add_subdirectory(dds/DCPS/QOS_XML_Handler) +endif() if(OPENDDS_SECURITY) add_subdirectory(dds/DCPS/security) if(OPENDDS_BUILT_IN_TOPICS) @@ -84,7 +91,6 @@ install( cmake/export.h.in cmake/import_common.cmake cmake/init.cmake - cmake/opendds_build_helpers.cmake cmake/opendds_features.cmake cmake/opendds_group.cmake cmake/opendds_target_sources.cmake @@ -104,6 +110,7 @@ if(NOT DEFINED OPENDDS_BUILD_TESTS AND BUILD_TESTING) set(OPENDDS_BUILD_TESTS TRUE) endif() if(OPENDDS_BUILD_EXAMPLES OR OPENDDS_BUILD_TESTS) + enable_testing() add_subdirectory(DevGuideExamples/DCPS/Messenger) endif() if(OPENDDS_BUILD_TESTS) @@ -111,5 +118,9 @@ if(OPENDDS_BUILD_TESTS) add_subdirectory(tests/cmake/Messenger) add_subdirectory(tests/cmake/idl_compiler_tests) add_subdirectory(tests/cmake/include_subdir) - add_subdirectory(tests/cmake/generated_global) + # TODO: This shouldn't matter, but linker complains about ACE/TAO libs + # lacking -fPIC. + if(NOT OPENDDS_STATIC) + add_subdirectory(tests/cmake/generated_global) + endif() endif() diff --git a/DevGuideExamples/DCPS/Messenger/CMakeLists.txt b/DevGuideExamples/DCPS/Messenger/CMakeLists.txt index 853cb2d906b..2fc52e03b04 100644 --- a/DevGuideExamples/DCPS/Messenger/CMakeLists.txt +++ b/DevGuideExamples/DCPS/Messenger/CMakeLists.txt @@ -1,5 +1,5 @@ project(opendds_devguide_messenger CXX) -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.3) enable_testing() find_package(OpenDDS REQUIRED) @@ -43,5 +43,5 @@ target_link_libraries(subscriber ${opendds_libs}) # Testing configure_file(run_test.pl . COPYONLY) configure_file(rtps.ini . COPYONLY) -_opendds_add_test(NAME info_repo COMMAND perl run_test.pl) -_opendds_add_test(NAME rtps COMMAND perl run_test.pl --rtps) +opendds_add_test(NAME info_repo COMMAND perl run_test.pl) +opendds_add_test(NAME rtps COMMAND perl run_test.pl --rtps) diff --git a/cmake/ace_group.cmake b/cmake/ace_group.cmake index 882f3d2edaa..139acfc3e24 100644 --- a/cmake/ace_group.cmake +++ b/cmake/ace_group.cmake @@ -12,7 +12,15 @@ include("${CMAKE_CURRENT_LIST_DIR}/import_common.cmake") _opendds_group(ACE DEFAULT_REQUIRED ACE::ACE) -_opendds_group_lib(ACE DEPENDS Threads::Threads) +if(_OPENDDS_ACE_MPC_NAME_IS_ACE_TARGET) + set(_mpc_name ACE-target) +else() + set(_mpc_name ACE) +endif() +_opendds_group_lib(ACE + MPC_NAME "${_mpc_name}" + DEPENDS Threads::Threads +) _opendds_group_lib(XML_Utils MPC_NAME ACE_XML_Utils DEPENDS ACE::ACE XercesC::XercesC diff --git a/cmake/build_ace_tao.cmake b/cmake/build_ace_tao.cmake index 03c4a90bbb3..516c101a7ac 100644 --- a/cmake/build_ace_tao.cmake +++ b/cmake/build_ace_tao.cmake @@ -1,58 +1,92 @@ include(ExternalProject) include(FetchContent) +set(ACE_TAO_CONFIGURED FALSE CACHE INTERNAL "") set(ACE_IS_BEING_BUILT MPC CACHE INTERNAL "") set(TAO_IS_BEING_BUILT MPC CACHE INTERNAL "") -set(OPENDDS_ACE "${OPENDDS_BUILD_DIR}/ace_tao" CACHE INTERNAL "") -set(OPENDDS_MPC "${OPENDDS_ACE}/MPC" CACHE INTERNAL "") -set(OPENDDS_TAO "${OPENDDS_ACE}/TAO" CACHE INTERNAL "") set(url_base "https://github.com/DOCGroup/ACE_TAO/releases/download/") -set(ace_ver "7.1.0") -set(configre_ace_tao_args) +set(ace_ver "7.1.1") +set(configure_ace_tao_args) if(WIN32) set(ext "zip") - set(md5 "032e0d4c969d675b5e72cce29858ebf8") + set(md5 "40d99f613047a15665c205dacf2e066e") if(CMAKE_GENERATOR STREQUAL "Visual Studio 17 2022") set(mpc_type vs2022) elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 16 2019") set(mpc_type vs2019) elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 15 2017") set(mpc_type vs2017) + elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 14 2015") + set(mpc_type vc14) else() set(mpc_type vs2022) endif() set(config_file "config-win32.h") else() set(ext "tar.bz2") - set(md5 "4696c2898de3bda28dd69abf0055b7eb") + set(md5 "2f60399b059dfd184c8248443920b6e5") set(mpc_type gnuace) - if(LINUX) + if(CMAKE_SYSTEM_NAME STREQUAL Linux) set(config_file "config-linux.h") list(APPEND configure_ace_tao_args --platform-macros-file "platform_linux.GNU") - elseif(APPLE) + elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) set(config_file "config-macosx.h") list(APPEND configure_ace_tao_args --platform-macros-file "platform_macosx.GNU") endif() endif() if(NOT DEFINED mpc_type OR NOT DEFINED config_file) - message(FATAL_ERROR "Not sure how to configure ACE/TAO for this system") + message(FATAL_ERROR "Not sure how to configure ACE/TAO for this system " + "(${CMAKE_SYSTEM_NAME}/${CMAKE_GENERATOR})") endif() string(REPLACE "." "_" ace_ver_tag "${ace_ver}") -FetchContent_Declare(ace_tao_dl - PREFIX "${OPENDDS_BUILD_DIR}/ace_tao_tmp" - SOURCE_DIR "${OPENDDS_ACE}" - URL "${url_base}ACE+TAO-${ace_ver_tag}/ACE+TAO-src-${ace_ver}.${ext}" - URL_MD5 "${md5}" -) -FetchContent_Populate(ace_tao_dl) +if(DEFINED OPENDDS_ACE_TAO_SRC) + if(NOT DEFINED OPENDDS_MPC) + message(FATAL_ERROR "OPENDDS_ACE_TAO_SRC requires OPENDDS_MPC to be set") + endif() + if(EXISTS "${OPENDDS_ACE_TAO_SRC}/ace/Version.h") + set(OPENDDS_ACE "${OPENDDS_ACE_TAO_SRC}" CACHE INTERNAL "") + elseif(EXISTS "${OPENDDS_ACE_TAO_SRC}/ACE/ace/Version.h") + set(OPENDDS_ACE "${OPENDDS_ACE_TAO_SRC}/ACE" CACHE INTERNAL "") + if(mpc_type STREQUAL gnuace) + set(_OPENDDS_ACE_MPC_NAME_IS_ACE_TARGET TRUE CACHE INTERNAL "") + endif() + else() + message(FATAL_ERROR "Can't find ace/Version.h in OPENDDS_ACE_TAO_SRC") + endif() + if(EXISTS "${OPENDDS_ACE_TAO_SRC}/TAO/tao/Version.h") + set(OPENDDS_TAO "${OPENDDS_ACE_TAO_SRC}/TAO" CACHE INTERNAL "") + else() + message(FATAL_ERROR "Can't find tao/Version.h in OPENDDS_ACE_TAO_SRC") + endif() +else() + set(OPENDDS_ACE_TAO_SRC "${OPENDDS_BUILD_DIR}/ace_tao" CACHE INTERNAL "") + set(OPENDDS_ACE "${OPENDDS_ACE_TAO_SRC}" CACHE INTERNAL "") + set(OPENDDS_MPC "${OPENDDS_ACE}/MPC" CACHE INTERNAL "") + set(OPENDDS_TAO "${OPENDDS_ACE}/TAO" CACHE INTERNAL "") + FetchContent_Declare(ace_tao_dl + PREFIX "${OPENDDS_BUILD_DIR}/ace_tao_tmp" + SOURCE_DIR "${OPENDDS_ACE_TAO_SRC}" + URL "${url_base}ACE+TAO-${ace_ver_tag}/ACE+TAO-src-${ace_ver}.${ext}" + URL_MD5 "${md5}" + ) + FetchContent_Populate(ace_tao_dl) +endif() + +if(mpc_type STREQUAL gnuace) + set(_OPENDDS_TAO_MPC_NAME_IS_TAO_TARGET TRUE CACHE INTERNAL "") +endif() find_package(Perl REQUIRED) +if(OPENDDS_STATIC) + list(APPEND configure_ace_tao_args --static=1) +endif() execute_process( COMMAND "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/configure_ace_tao.pl" --mpc "${OPENDDS_MPC}" --mpc-type "${mpc_type}" + --src "${OPENDDS_ACE_TAO_SRC}" --ace "${OPENDDS_ACE}" --tao "${OPENDDS_TAO}" ${configure_ace_tao_args} @@ -66,7 +100,7 @@ if(mpc_type STREQUAL gnuace) execute_process( COMMAND "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/scrape_gnuace.pl" - --workspace "${OPENDDS_ACE}" + --workspace "${OPENDDS_ACE_TAO_SRC}" --loc-base "${OPENDDS_BUILD_DIR}" --ace "${OPENDDS_ACE}" --tao "${OPENDDS_TAO}" @@ -93,7 +127,7 @@ if(mpc_type STREQUAL gnuace) endforeach() ExternalProject_Add(build_ace_tao - SOURCE_DIR "${OPENDDS_ACE}" + SOURCE_DIR "${OPENDDS_ACE_TAO_SRC}" CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "Already configured" BUILD_IN_SOURCE TRUE BUILD_COMMAND @@ -108,7 +142,7 @@ elseif(mpc_type MATCHES "^vs") execute_process( COMMAND "${PERL_EXECUTABLE}" "${_OPENDDS_CMAKE_DIR}/scrape_vs.pl" - --sln "${OPENDDS_ACE}/${sln}" + --sln "${OPENDDS_ACE_TAO_SRC}/${sln}" --ace "${OPENDDS_ACE}" COMMAND_ECHO STDOUT COMMAND_ERROR_IS_FATAL ANY @@ -133,12 +167,12 @@ elseif(mpc_type MATCHES "^vs") endforeach() ExternalProject_Add(build_ace_tao - SOURCE_DIR "${OPENDDS_ACE}" + SOURCE_DIR "${OPENDDS_ACE_TAO_SRC}" CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "Already configured" BUILD_IN_SOURCE TRUE BUILD_COMMAND "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}" - MSBuild "${sln}" -property:Configuration=Debug,Platform=x64 + MSBuild "${sln}" -property:Configuration=$,Platform=${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE} BUILD_BYPRODUCTS ${byproducts} USES_TERMINAL_BUILD TRUE # Needed for Ninja to show the ACE/TAO build INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "No install step" @@ -146,3 +180,5 @@ elseif(mpc_type MATCHES "^vs") else() message(FATAL_ERROR "Not sure how to build ACE/TAO for this system") endif() + +set(ACE_TAO_CONFIGURED TRUE CACHE INTERNAL "") diff --git a/cmake/configure_ace_tao.pl b/cmake/configure_ace_tao.pl index e643a66d7ea..9b81dde42a7 100755 --- a/cmake/configure_ace_tao.pl +++ b/cmake/configure_ace_tao.pl @@ -15,12 +15,14 @@ my @required_values = qw/ mpc mpc-type + src ace tao config-file /; my @optional_values = qw/ platform-macros-file + static /; my %is_value_required = map {$_ => 1} @required_values; my %values = (); @@ -93,9 +95,10 @@ sub run_command { $ENV{TAO_ROOT} = File::Spec->rel2abs($values{tao}); my $mwc_name = 'ACE_TAO_for_OpenDDS.mwc'; my $mwc_src = "$FindBin::RealBin/../$mwc_name"; -my $mwc = "$ENV{ACE_ROOT}/$mwc_name"; +my $mwc = "$values{src}/$mwc_name"; copy($mwc_src, $mwc) or die("Failed to copy $mwc_src to $mwc: $!"); -run_command( - [$Config{perlpath}, 'bin/mwc.pl', $mwc, '-type', $values{'mpc-type'}], - chdir => $ENV{ACE_ROOT}, -); +my $cmd = [$Config{perlpath}, "$ENV{ACE_ROOT}/bin/mwc.pl", $mwc, '-type', $values{'mpc-type'}]; +if ($values{static}) { + push(@{$cmd}, '-static'); +} +run_command($cmd, chdir => $values{src}); diff --git a/cmake/import_common.cmake b/cmake/import_common.cmake index 83367817639..7c80feea317 100644 --- a/cmake/import_common.cmake +++ b/cmake/import_common.cmake @@ -111,6 +111,9 @@ function(_opendds_find_in_mpc_projects found_var path_var mpc_projects mpc_name) return() endif() string(JSON path GET "${mpc_project}" "loc") + if(NOT CMAKE_GENERATOR STREQUAL "Ninja" AND NOT IS_ABSOLUTE "${path}") + cmake_path(ABSOLUTE_PATH path BASE_DIRECTORY "${OPENDDS_BUILD_DIR}") + endif() set(${path_var} "${path}" CACHE FILEPATH "" FORCE) set(${found_var} TRUE CACHE INTERNAL "" FORCE) endfunction() @@ -368,8 +371,14 @@ function(_opendds_import_group_targets group libs exes) add_dependencies(${target} "${${mpc_ext_proj_var}}") endif() - add_target_library_config(${target} ${var_prefix} "RELEASE") - add_target_library_config(${target} ${var_prefix} "DEBUG") + if(MSVC) + add_target_library_config(${target} ${var_prefix} "RELEASE") + add_target_library_config(${target} ${var_prefix} "DEBUG") + elseif(OPENDDS_DEBUG) + add_target_library_config(${target} ${var_prefix} "DEBUG") + else() + add_target_library_config(${target} ${var_prefix} "RELEASE") + endif() endif() endmacro() diff --git a/cmake/init.cmake b/cmake/init.cmake index b448eb56357..30304986d57 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -257,6 +257,14 @@ if(DEFINED OPENDDS_HOST_TOOLS) set(_OPENDDS_OPENDDS_HOST_TOOLS "${OPENDDS_HOST_TOOLS}/bin" CACHE INTERNAL "") if(NOT DEFINED OPENDDS_ACE_TAO_HOST_TOOLS) set(_OPENDDS_ACE_HOST_TOOLS "${_OPENDDS_OPENDDS_HOST_TOOLS}" CACHE INTERNAL "") - set(_OPENDDS_TAO_HOST_TOOLS "${_OPENDDS_OPENDDS_HOST_TOOLS}/bin" CACHE INTERNAL "") + set(_OPENDDS_TAO_HOST_TOOLS "${_OPENDDS_OPENDDS_HOST_TOOLS}" CACHE INTERNAL "") + endif() +endif() + +if(NOT DEFINED OPENDDS_SUPPORTS_SHMEM) + if(APPLE) + set(OPENDDS_SUPPORTS_SHMEM FALSE) + else() + set(OPENDDS_SUPPORTS_SHMEM TRUE) endif() endif() diff --git a/cmake/opendds_features.cmake b/cmake/opendds_features.cmake index 3e228fdf421..f08dda530d2 100644 --- a/cmake/opendds_features.cmake +++ b/cmake/opendds_features.cmake @@ -58,9 +58,19 @@ _opendds_feature(SECURITY OFF) _opendds_feature(SAFETY_PROFILE OFF) # ACE Features -_opendds_feature(DEBUG ON MPC) +if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "Debug") + _opendds_feature(DEBUG ON MPC) + _opendds_feature(OPTIMIZE OFF MPC) +else() + _opendds_feature(DEBUG OFF MPC) + _opendds_feature(OPTIMIZE ON MPC) +endif() _opendds_feature(INLINE ON MPC) -_opendds_feature(STATIC OFF MPC) +if(BUILD_SHARED_LIBS) + _opendds_feature(STATIC OFF MPC) +else() + _opendds_feature(STATIC ON MPC) +endif() _opendds_feature(XERCES3 ${OPENDDS_SECURITY} MPC) # TAO Features diff --git a/cmake/opendds_target_sources.cmake b/cmake/opendds_target_sources.cmake index efd6d0a1e8c..df0388143d6 100644 --- a/cmake/opendds_target_sources.cmake +++ b/cmake/opendds_target_sources.cmake @@ -17,6 +17,7 @@ function(_opendds_get_sources_and_options tao_options opendds_options use_export + use_versioned_namespace suppress_anys always_generate_lib_export_header generate_server_skeletons @@ -39,6 +40,7 @@ function(_opendds_get_sources_and_options PUBLIC PRIVATE INTERFACE TAO_IDL_OPTIONS OPENDDS_IDL_OPTIONS USE_EXPORT + USE_VERSIONED_NAMESPACE ) cmake_parse_arguments(arg "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) @@ -88,6 +90,16 @@ function(_opendds_get_sources_and_options set(${always_generate_lib_export_header} ${arg_ALWAYS_GENERATE_LIB_EXPORT_HEADER} PARENT_SCOPE) endif() + if(arg_USE_VERSIONED_NAMESPACE) + list(LENGTH arg_USE_VERSIONED_NAMESPACE use_versioned_namespace_len) + if(NOT use_versioned_namespace_len EQUAL 2) + message(FATAL_ERROR + "The opendds_target_sources USE_VERSIONED_NAMESPACE option takes a header path and " + "macro prefix, but was passed ${use_versioned_namespace_len} values") + endif() + set(use_versioned_namespace "${arg_USE_VERSIONED_NAMESPACE}" PARENT_SCOPE) + endif() + set(${skip_tao_idl} ${arg_SKIP_TAO_IDL} PARENT_SCOPE) if(NOT TARGET OpenDDS::opendds_idl) set(arg_SKIP_OPENDDS_IDL TRUE) @@ -236,6 +248,7 @@ function(opendds_target_sources target) tao_options opendds_options use_export + use_versioned_namespace suppress_anys always_generate_lib_export_header generate_server_skeletons @@ -275,6 +288,20 @@ function(opendds_target_sources target) endif() endif() + if(use_versioned_namespace) + list(GET use_versioned_namespace 0 vn_header) + list(GET use_versioned_namespace 1 vn_prefix) + set(common_vn_opts + "-Wb,versioning_include=${vn_header}" + "-Wb,versioning_begin=${vn_prefix}_BEGIN_VERSIONED_NAMESPACE_DECL" + "-Wb,versioning_end=${vn_prefix}_END_VERSIONED_NAMESPACE_DECL" + ) + list(APPEND tao_options ${common_vn_opts}) + list(APPEND opendds_options ${common_vn_opts} + "-Wb,versioning_name=${vn_prefix}_VERSIONED_NAMESPACE_NAME" + ) + endif() + if(NOT "${tao_options}" MATCHES "-SS" AND NOT generate_server_skeletons) list(APPEND tao_options "-SS") endif() diff --git a/cmake/opendds_testing.cmake b/cmake/opendds_testing.cmake index b711a70f936..5e9d462a98a 100644 --- a/cmake/opendds_testing.cmake +++ b/cmake/opendds_testing.cmake @@ -1,4 +1,4 @@ -function(_opendds_add_test) +function(opendds_add_test) set(no_value_options) set(single_value_options NAME) set(multi_value_options COMMAND ARGS) diff --git a/cmake/tao_group.cmake b/cmake/tao_group.cmake index 90cba577dee..792eb3e2943 100644 --- a/cmake/tao_group.cmake +++ b/cmake/tao_group.cmake @@ -12,10 +12,10 @@ include("${CMAKE_CURRENT_LIST_DIR}/import_common.cmake") _opendds_group(TAO DEFAULT_REQUIRED TAO::TAO TAO::tao_idl) -if(MSVC) - set(_mpc_name TAO) -else() +if(_OPENDDS_TAO_MPC_NAME_IS_TAO_TARGET) set(_mpc_name TAO-target) +else() + set(_mpc_name TAO) endif() _opendds_group_lib(TAO MPC_NAME "${_mpc_name}" diff --git a/cmake/tao_idl_sources.cmake b/cmake/tao_idl_sources.cmake index fce998f1299..0288943a132 100644 --- a/cmake/tao_idl_sources.cmake +++ b/cmake/tao_idl_sources.cmake @@ -240,8 +240,13 @@ function(_opendds_tao_idl target) set(tao_idl "$") if(CMAKE_GENERATOR STREQUAL "Ninja" AND TAO_IS_BEING_BUILT) - set(tao_idl "$") - set(gperf_location "$") + if(CMAKE_VERSION VERSION_LESS 3.24) + message(FATAL_ERROR "Using Ninja to build ACE/TAO requires CMake 3.24 or later. " + "Please build ACE/TAO separately, use a newer CMake, or a different CMake generator.") + else() + set(tao_idl "$") + set(gperf_location "$") + endif() endif() add_custom_command( OUTPUT ${generated_files} diff --git a/dds/CMakeLists.txt b/dds/CMakeLists.txt index b28ca1f41a9..010efe1cf9e 100644 --- a/dds/CMakeLists.txt +++ b/dds/CMakeLists.txt @@ -1,5 +1,5 @@ # CMakeLists for OpenDDS_Dcps - +cmake_minimum_required(VERSION 3.23) project(opendds_dcps CXX) set(dcps_lib_deps @@ -564,6 +564,7 @@ set(opendds_target_sources_args AUTO_LINK FALSE USE_EXPORT "dds/DCPS/dcps_export.h" OpenDDS_Dcps_Export INCLUDE_BASE "${OPENDDS_SOURCE_DIR}" + USE_VERSIONED_NAMESPACE "dds/Versioned_Namespace.h" OPENDDS ) opendds_target_sources(OpenDDS_Dcps diff --git a/dds/DCPS/CMakeLists.txt b/dds/DCPS/CMakeLists.txt index 376c3ee667a..1e252cd3e96 100644 --- a/dds/DCPS/CMakeLists.txt +++ b/dds/DCPS/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.22) - +# CMakeLists for OpenDDS_Util used by opendds_idl +cmake_minimum_required(VERSION 3.23) project(opendds_util CXX) set(deps ACE::ACE) diff --git a/dds/DCPS/Definitions.h b/dds/DCPS/Definitions.h index f401b22530a..4edf35f8cec 100644 --- a/dds/DCPS/Definitions.h +++ b/dds/DCPS/Definitions.h @@ -6,8 +6,12 @@ #ifndef OPENDDS_DCPS_DEFINITIONS_H #define OPENDDS_DCPS_DEFINITIONS_H -#if defined __has_include && __has_include() -# include +#include + +#ifdef __has_include +# if __has_include() +# include +# endif #endif #include diff --git a/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt index 5cf64b03f99..999496b72b1 100644 --- a/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt +++ b/dds/DCPS/InfoRepoDiscovery/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_info_repo_discovery CXX) set(lib_deps OpenDDS::Dcps OpenDDS::Tcp TAO::TAO TAO::PI) diff --git a/dds/DCPS/QOS_XML_Handler/CMakeLists.txt b/dds/DCPS/QOS_XML_Handler/CMakeLists.txt new file mode 100644 index 00000000000..37d9bd8d9df --- /dev/null +++ b/dds/DCPS/QOS_XML_Handler/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.23) +project(opendds_qos_xml_xsc_handler CXX) + +set(deps OpenDDS::Dcps ACE::XML_Utils) +find_package(OpenDDS REQUIRED NO_DEFAULTS ${deps}) +include(opendds_build_helpers) + +add_library(OpenDDS_QOS_XML_XSC_Handler + DataReaderQos_Handler.cpp + DataWriterQos_Handler.cpp + ParticipantQos_Handler.cpp + PublisherQos_Handler.cpp + QOS_Common.cpp + QOS_XML_Loader.cpp + SubscriberQos_Handler.cpp + TopicQos_Handler.cpp + XML_File_Intf.cpp + XML_Intf.cpp + XML_String_Intf.cpp + dds_qos.cpp +) +target_sources(OpenDDS_QOS_XML_XSC_Handler + PUBLIC FILE_SET HEADERS BASE_DIRS "${OPENDDS_SOURCE_DIR}" FILES + DataReaderQos_Handler.h + DataWriterQos_Handler.h + OpenDDS_XML_QOS_Handler_Export.h + ParticipantQos_Handler.h + PublisherQos_Handler.h + QOS_Common.h + QOS_DataReader_T.cpp + QOS_DataReader_T.h + QOS_DataWriter_T.cpp + QOS_DataWriter_T.h + QOS_DwDrTp_Base_T.cpp + QOS_DwDrTp_Base_T.h + QOS_DwTp_Base_T.cpp + QOS_DwTp_Base_T.h + QOS_PubSub_T.cpp + QOS_PubSub_T.h + QOS_Topic_T.cpp + QOS_Topic_T.h + QOS_XML_Loader.h + SubscriberQos_Handler.h + TopicQos_Handler.h + XML_File_Intf.h + XML_Intf.h + XML_String_Intf.h + dds_qos.hpp +) +_opendds_library(OpenDDS_QOS_XML_XSC_Handler EXPORT_SYMBOLS_NAME OpenDDS_XML_QOS_Handler) +target_link_libraries(OpenDDS_QOS_XML_XSC_Handler PUBLIC ${deps}) diff --git a/dds/DCPS/RTPS/CMakeLists.txt b/dds/DCPS/RTPS/CMakeLists.txt index a31a3f59608..f26dfb2b583 100644 --- a/dds/DCPS/RTPS/CMakeLists.txt +++ b/dds/DCPS/RTPS/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_rtps CXX) find_package(OpenDDS REQUIRED NO_DEFAULTS OpenDDS::Dcps OpenDDS::opendds_idl) diff --git a/dds/DCPS/security/CMakeLists.txt b/dds/DCPS/security/CMakeLists.txt index d077ff4401f..49cae707b34 100644 --- a/dds/DCPS/security/CMakeLists.txt +++ b/dds/DCPS/security/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_security CXX) set(deps OpenDDS::Rtps ACE::XML_Utils) diff --git a/dds/DCPS/security/Utility.h b/dds/DCPS/security/Utility.h index 4efa8dad09e..493de44ed8e 100644 --- a/dds/DCPS/security/Utility.h +++ b/dds/DCPS/security/Utility.h @@ -1,32 +1,28 @@ /* -* -* -* Distributed under the OpenDDS License. -* See: http://www.OpenDDS.org/license.html -*/ + * Distributed under the OpenDDS License. + * See: http://www.OpenDDS.org/license.html + */ #ifndef OPENDDS_DCPS_SECURITY_UTILITY_H #define OPENDDS_DCPS_SECURITY_UTILITY_H -#include "OpenDDS_Security_Export.h" -#include "TokenReader.h" - +#include #include #include #include #include -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ +#ifndef ACE_LACKS_PRAGMA_ONCE +# pragma once +#endif OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL namespace OpenDDS { namespace Security { -class OpenDDS_Security_Export Utility : public DCPS::RcObject { +class OpenDDS_Dcps_Export Utility : public DCPS::RcObject { public: virtual ~Utility() {} virtual void generate_random_bytes(void* ptr, size_t size) = 0; diff --git a/dds/DCPS/transport/multicast/CMakeLists.txt b/dds/DCPS/transport/multicast/CMakeLists.txt index 5804525b82b..63325e70040 100644 --- a/dds/DCPS/transport/multicast/CMakeLists.txt +++ b/dds/DCPS/transport/multicast/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_multicast CXX) set(deps OpenDDS::Dcps) diff --git a/dds/DCPS/transport/rtps_udp/CMakeLists.txt b/dds/DCPS/transport/rtps_udp/CMakeLists.txt index 93d04551a01..07764150353 100644 --- a/dds/DCPS/transport/rtps_udp/CMakeLists.txt +++ b/dds/DCPS/transport/rtps_udp/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_rtps_udp CXX) set(deps OpenDDS::Dcps OpenDDS::Rtps) diff --git a/dds/DCPS/transport/shmem/CMakeLists.txt b/dds/DCPS/transport/shmem/CMakeLists.txt index 5ba1d0fbac7..720847328f2 100644 --- a/dds/DCPS/transport/shmem/CMakeLists.txt +++ b/dds/DCPS/transport/shmem/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_shmem CXX) set(deps OpenDDS::Dcps) diff --git a/dds/DCPS/transport/tcp/CMakeLists.txt b/dds/DCPS/transport/tcp/CMakeLists.txt index 21fcee00fdd..276afd1e76a 100644 --- a/dds/DCPS/transport/tcp/CMakeLists.txt +++ b/dds/DCPS/transport/tcp/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_tcp CXX) set(deps OpenDDS::Dcps) diff --git a/dds/DCPS/transport/udp/CMakeLists.txt b/dds/DCPS/transport/udp/CMakeLists.txt index dc5ed01a39c..48b72f6c67d 100644 --- a/dds/DCPS/transport/udp/CMakeLists.txt +++ b/dds/DCPS/transport/udp/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_udp CXX) set(deps OpenDDS::Dcps) diff --git a/dds/InfoRepo/CMakeLists.txt b/dds/InfoRepo/CMakeLists.txt index 1f251a3a936..3c7e2cbc70b 100644 --- a/dds/InfoRepo/CMakeLists.txt +++ b/dds/InfoRepo/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.23) project(opendds_info_repo CXX) set(lib_dep_libs diff --git a/dds/idl/CMakeLists.txt b/dds/idl/CMakeLists.txt index 5f4842e8546..8d893c57ca2 100644 --- a/dds/idl/CMakeLists.txt +++ b/dds/idl/CMakeLists.txt @@ -1,5 +1,4 @@ -cmake_minimum_required(VERSION 3.22) - +cmake_minimum_required(VERSION 3.23) project(opendds_idl CXX) include(GNUInstallDirs) diff --git a/dds/idl/be_produce.cpp b/dds/idl/be_produce.cpp index 2891fbcab74..8ed2102fe9c 100644 --- a/dds/idl/be_produce.cpp +++ b/dds/idl/be_produce.cpp @@ -226,20 +226,6 @@ void postprocess(const char* fn, ostringstream& content, } break; case BE_GlobalData::STREAM_CPP: { - // For Unity builds, names in anonymous namespace can clash, so this is used - // to make namespaces with names based on the file instead. - std::string prefix = to_macro(fn); - for (size_t i = 0; i < prefix.size(); ++i) { - prefix[i] = tolower(prefix[i]); - } - out << - "\n" - "#ifdef OPENDDS_IDL_FILE_SPECIFIC\n" - "# undef OPENDDS_IDL_FILE_SPECIFIC\n" - "#endif\n" - "#define OPENDDS_IDL_FILE_SPECIFIC(base, index) " << prefix << "##_##base##index\n" - "\n"; - ACE_CString pch = be_global->pch_include(); if (pch.length()) { out << "#include \"" << pch << "\"\n"; @@ -285,6 +271,22 @@ void postprocess(const char* fn, ostringstream& content, out << be_global->get_include_block(which); + if (which == BE_GlobalData::STREAM_CPP) { + // For Unity builds, names in anonymous namespace can clash, so this is used + // to make namespaces with names based on the file instead. + std::string prefix = to_macro(fn); + for (size_t i = 0; i < prefix.size(); ++i) { + prefix[i] = tolower(prefix[i]); + } + out << + "\n" + "#ifdef OPENDDS_IDL_FILE_SPECIFIC\n" + "# undef OPENDDS_IDL_FILE_SPECIFIC\n" + "#endif\n" + "#define OPENDDS_IDL_FILE_SPECIFIC(base, index) " << prefix << "##_##base##index\n" + "\n"; + } + out << content.str(); switch (which) { diff --git a/docs/building/cmake.rst b/docs/building/cmake.rst index 0f00474ed23..1da47c609f5 100644 --- a/docs/building/cmake.rst +++ b/docs/building/cmake.rst @@ -212,7 +212,8 @@ It is possible to install files from the :ref:`OPENDDS_*_INTERFACE_FILES target See the :ghfile:`install Test ` for an example of this. It uses `install(FILES) `__, but there isn't any restriction on what installation method can be used. For example, the `PUBLIC_HEADER `__ target property could be set on target to the desired files from the interface lists. -Then they installed using `install(TARGETS ... PUBLIC_HEADER ...) `__. +Then they can be installed using `install(TARGETS ... PUBLIC_HEADER ...) `__. +Another method is provided by :cmake:func:`opendds_install_interface_files`. Manually Creating config.cmake ============================== @@ -370,9 +371,11 @@ Functions [OPENDDS_IDL_OPTIONS