diff --git a/CMakeLists.txt b/CMakeLists.txt index de45f0b..64cd35c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ target_link_libraries(OpenDDW Threads::Threads ) -OPENDDS_TARGET_SOURCES(OpenDDW idl/std_qos.idl) +opendds_target_sources(OpenDDW idl/std_qos.idl OPENDDS_IDL_OPTIONS -Gxtypes-complete) INCLUDE(CMakePackageConfigHelpers) diff --git a/idl2library.cmake b/idl2library.cmake index 99b5b6c..38539b4 100644 --- a/idl2library.cmake +++ b/idl2library.cmake @@ -1,5 +1,5 @@ # idl2library(IDLS [BUILD_STATIC]) -# Generate a shared or static library for each IDL in a list. +# Generate a shared or static library for each IDL in a list. # # Example: # idl2library(IDLS idl/example.idl idl/std_doc.idl) @@ -20,12 +20,12 @@ macro(get_idl_target_name idlfile output) endmacro() #Finds all of the input file's (absolute path) dependencies and returns them in IDL_TARGET_DEPENDENCIES -function(find_idl_dependencies input_file) +function(find_idl_dependencies input_file) unset(search_list) unset(return_list) LIST(APPEND current_list ${input_file}) #Files that need to be searched (full path) LIST(APPEND search_list ${input_file}) #Don't search more than once (full path) - + while(current_list) SET(file_list ${current_list}) unset(current_list) @@ -50,7 +50,7 @@ endfunction() function(idl2library) set(options BUILD_STATIC) set(multiValueArgs IDLS) - + cmake_parse_arguments(idl2library "BUILD_STATIC" "" "IDLS" ${ARGN}) if (${idl2library_BUILD_STATIC}) @@ -69,20 +69,20 @@ function(idl2library) endif() list(APPEND IDL_WISHLIST ${IDL_ARG}) endforeach() - - option(OPENDDS_CPP11_IDL_MAPPING "Use C++11 IDL mapping" OFF) + + option(OPENDDS_CPP11_IDL_MAPPING "Use C++11 IDL mapping" OFF) option(OPENDDS_CMAKE_VERBOSE "Print verbose output when loading the OpenDDS Config Package" ON) - + find_package(OpenDDS REQUIRED) if(NOT IDL_WISHLIST) message("No IDLs specified. Update your CMakeLists.txt to include a list of the required IDLs, and pass that list to idl2library()") endif() - + list(REMOVE_DUPLICATES IDL_WISHLIST) message("The following idls are being used: ${IDL_WISHLIST}") - - # For each input idl create the following variables: + + # For each input idl create the following variables: # ${current_idl_target}_ABSPATH, ${current_idl_target}_ABSDIR, ${current_idl_target}_RELPATH, ${current_idl_target}_RELDIR foreach(SINGLE_IDL ${IDL_WISHLIST}) get_idl_target_name(${SINGLE_IDL} current_idl_target) @@ -92,11 +92,11 @@ function(idl2library) unset(${current_idl_target}_RELDIR) cmake_path(IS_ABSOLUTE SINGLE_IDL SINGLE_IDL_IS_ABS) - if(SINGLE_IDL_IS_ABS) + if(SINGLE_IDL_IS_ABS) set(${current_idl_target}_ABSPATH ${SINGLE_IDL}) else() - find_file(${current_idl_target}_ABSPATH - ${SINGLE_IDL} + find_file(${current_idl_target}_ABSPATH + ${SINGLE_IDL} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_CACHE REQUIRED @@ -154,7 +154,7 @@ function(idl2library) unset(current_idl_include_opts) find_idl_dependencies("${${current_idl_target}_ABSPATH}") #Dependencies are returned in IDL_TARGET_DEPENDENCIES - + #Note: current_idl_include_opts needs to be a list. Previously it was a string and that will no longer work correctly. foreach(target_dependency ${IDL_TARGET_DEPENDENCIES}) if(NOT "${${target_dependency}_ABSDIR}" STREQUAL "${${current_idl_target}_ABSDIR}") @@ -162,11 +162,11 @@ function(idl2library) endif() endforeach() list(REMOVE_DUPLICATES current_idl_include_opts) - + if(OPENDDS_CPP11_IDL_MAPPING) list(APPEND current_idl_include_opts "-Lc++11 ") endif() - + message("Adding library: ${current_idl_target}") message("current_idl_include_opts: ${current_idl_include_opts}") message("Dependencies: ${IDL_TARGET_DEPENDENCIES}\n") @@ -178,9 +178,9 @@ function(idl2library) add_library(${current_idl_target} SHARED) endif() - OPENDDS_TARGET_SOURCES(${current_idl_target} + opendds_target_sources(${current_idl_target} ${${current_idl_target}_RELPATH} - OPENDDS_IDL_OPTIONS ${current_idl_include_opts} + OPENDDS_IDL_OPTIONS ${current_idl_include_opts} -Gxtypes-complete TAO_IDL_OPTIONS ${current_idl_include_opts} INCLUDE_BASE ${${current_idl_target}_ABSDIR} ) diff --git a/src/dds_manager.cpp b/src/dds_manager.cpp index 7b97d2b..cccd7c7 100644 --- a/src/dds_manager.cpp +++ b/src/dds_manager.cpp @@ -12,6 +12,9 @@ #include #include #include +#ifdef ACE_AS_STATIC_LIBS +# include +#endif #include #include #include @@ -32,12 +35,6 @@ #include "platformIndependent.h" #include "std_qosC.h" -//For using static open dds these files need to be in some cpp file -#if defined (ACE_AS_STATIC_LIBS) - #include - #include -#endif - //Helper function to get the address list for a sequence std::string GetAddressInfo(const OpenDDS::DCPS::TransportLocatorSeq& info) { @@ -149,14 +146,14 @@ DDSManager::~DDSManager() m_messageHandler(LogMessageType::DDS_INFO, "Deleting DDSManagerImpl"); - if (!CORBA::is_nil(m_domainParticipant.in())) + if (m_domainParticipant) { status = m_domainParticipant->delete_contained_entities(); checkStatus(status, "DDS::DomainParticipant::delete_contained_entities"); } DDS::DomainParticipantFactory_var dpf = TheParticipantFactory; - if (!CORBA::is_nil(dpf.in())) + if (dpf) { status = dpf->delete_participant(m_domainParticipant); checkStatus(status, "DDS::DomainParticipant::delete_participant"); @@ -175,14 +172,13 @@ bool DDSManager::joinDomain(const int& domainID, const std::string& config, std: { // If the domain participant has already been instantiated and it's // connected to a different domain than the request, report an error - if (!CORBA::is_nil(m_domainParticipant.in()) && - domainID != m_domainParticipant->get_domain_id()) + if (m_domainParticipant && domainID != m_domainParticipant->get_domain_id()) { return false; } // If the domain participant has already been instantiated, we're done - if (!CORBA::is_nil(m_domainParticipant.in())) + if (m_domainParticipant) { return true; } @@ -283,7 +279,7 @@ bool DDSManager::joinDomain(const int& domainID, const std::string& config, std: nullptr, OpenDDS::DCPS::DEFAULT_STATUS_MASK); - if (CORBA::is_nil(m_domainParticipant.in())) + if (!m_domainParticipant) { std::cerr << "Error creating participant for domain '" << domainID @@ -439,7 +435,7 @@ bool DDSManager::joinDomain(const int& domainID, const std::string& config, std: //------------------------------------------------------------------------------ bool DDSManager::enableDomain() { - if (CORBA::is_nil(m_domainParticipant.in())) + if (!m_domainParticipant) { return false; }