OpenDDS 응용 프로그램 (Simple Publisher/Subscriber)을 빌드하기위한 표준 CMakelist를 찾고 있습니다. 나는 자습서에 익숙하며 예제를 만들기 위해 MPC에서 모든 것이 잘 돌아가고있다. cmake로 프로젝트를 만들어야합니다. OpenDDS 3.9를 사용하고 있습니다. cmake for OpenDDS Project
는 여기에은 StockQuote 예를 들어 CMakelist를 만들려고 다음과 같이 http://opendds.org/about/articles/Article-Intro.html내 CMakelist 보이는 :
cmake_minimum_required (VERSION 3.3.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
project (publisher)
set(DDS_ROOT_DIR "home/ubuntu/OpenDDS-3.9")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
include_directories (${DDS_ROOT_DIR} "${DDS_ROOT_DIR}/ACE_wrappers" "${DDS_ROOT_DIR}/ACE_wrappers/TAO" ${CMAKE_SOURCE_DIR})
file (GLOB_RECURSE PUBLISHER_SRC *.cpp)
file (GLOB_RECURSE IDL_SRC ${CMAKE_SOURCE_DIR} *.cpp)
add_executable (${PROJECT_NAME} ${PUBLISHER_SRC} ${IDL_SRC})
project (subscriber)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
include_directories (${DDS_ROOT_DIR} "${DDS_ROOT_DIR}/ACE_wrappers" "${DDS_ROOT_DIR}/ACE_wrappers/TAO" ${CMAKE_SOURCE_DIR})
file (GLOB_RECURSE SUBSCRIBER_SRC *.cpp)
file (GLOB_RECURSE IDL_SRC ${CMAKE_SOURCE_DIR} *.cpp)
add_executable (${PROJECT_NAME} ${SUBSCRIBER_SRC} ${IDL_SRC})
# Adding DDS link_libraries
if (WIN32)
file (GLOB OpenDDS_LIBS "${DDS_ROOT_DIR}/lib/*d.dll")
foreach (i ${OpenDDS_LIBS})
get_filename_component (BASE_NAME_DLL ${i} NAME_WE)
add_library (${BASE_NAME_DLL} SHARED IMPORTED)
set_property (TARGET ${BASE_NAME_DLL} PROPERTY IMPORTED_LOCATION "${DDS_ROOT_DIR}/lib/${BASE_NAME_DLL}.dll")
set_property (TARGET ${BASE_NAME_DLL} PROPERTY IMPORTED_IMPLIB "${DDS_ROOT_DIR}/lib/${BASE_NAME_DLL}.lib")
target_link_libraries (${PROJECT_NAME} ${BASE_NAME_DLL})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${BASE_NAME_DLL}> $<TARGET_FILE_DIR:${PROJECT_NAME}>)
endforeach()
file (GLOB OpenDDS_LIBS "${DDS_ROOT_DIR}/ACE_wrappers/lib/*d.dll")
foreach (i ${OpenDDS_LIBS})
get_filename_component (BASE_NAME_DLL ${i} NAME_WE)
add_library (${BASE_NAME_DLL} SHARED IMPORTED)
set_property (TARGET ${BASE_NAME_DLL} PROPERTY IMPORTED_LOCATION "${DDS_ROOT_DIR}/ACE_wrappers/lib/${BASE_NAME_DLL}.dll")
set_property (TARGET ${BASE_NAME_DLL} PROPERTY IMPORTED_IMPLIB "${DDS_ROOT_DIR}/ACE_wrappers/lib/${BASE_NAME_DLL}.lib")
target_link_libraries (${PROJECT_NAME} ${BASE_NAME_DLL})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${BASE_NAME_DLL}> $<TARGET_FILE_DIR:${PROJECT_NAME}>)
endforeach()
elseif (UNIX)
file (GLOB OpenDDS_LIBS "${DDS_ROOT_DIR}/lib/*.so")
foreach (i ${OpenDDS_LIBS})
get_filename_component (BASE_NAME_DLL ${i} NAME_WE)
add_library (${BASE_NAME_DLL} SHARED IMPORTED)
set_property (TARGET ${BASE_NAME_DLL} PROPERTY IMPORTED_LOCATION "${DDS_ROOT_DIR}/lib/${BASE_NAME_DLL}.so")
target_link_libraries (${PROJECT_NAME} ${BASE_NAME_DLL})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${BASE_NAME_DLL}> $<TARGET_FILE_DIR:${PROJECT_NAME}>)
endforeach()
file (GLOB OpenDDS_LIBS "${DDS_ROOT_DIR}/ACE_wrappers/lib/*.so")
foreach (i ${OpenDDS_LIBS})
get_filename_component (BASE_NAME_DLL ${i} NAME_WE)
add_library (${BASE_NAME_DLL} SHARED IMPORTED)
set_property (TARGET ${BASE_NAME_DLL} PROPERTY IMPORTED_LOCATION "${DDS_ROOT_DIR}/ACE_wrappers/lib/${BASE_NAME_DLL}.so")
target_link_libraries (${PROJECT_NAME} ${BASE_NAME_DLL})
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${BASE_NAME_DLL}> $<TARGET_FILE_DIR:${PROJECT_NAME}>)
endforeach()
endif()
나는 WTeam 블로그에서 추가 DDS 연결 라이브러리 섹션을 얻었다. 내가 사용하고있는 경우
http://www.wteam.it/index.php/articles/the-hla-series/9-article/15-first-opendds-program 현재이 오류 메시지가 나타납니다 cmake --build :
/usr/local/include/dds/DCPS/DataWriterImpl_T.h: In instantiation of ‘void OpenDDS::DCPS::DataWriterImpl_T::init(DDS::Topic_ptr, OpenDDS::DCPS::TopicImpl*, const DDS::DataWriterQos&, DDS::DataWriterListener_ptr, const StatusMask&, OpenDDS::DCPS::DomainParticipantImpl*, OpenDDS::DCPS::PublisherImpl*, DDS::DataWriter_ptr) [with MessageType = Messenger::Message; DDS::Topic_ptr = DDS::Topic*; DDS::DataWriterListener_ptr = DDS::DataWriterListener*; DDS::StatusMask = unsigned int; DDS::DataWriter_ptr = DDS::DataWriter*]’: /usr/local/include/dds/DCPS/FilterEvaluator.h:142:10: required from here /usr/local/include/dds/DCPS/DataWriterImpl_T.h:317:50: error: incomplete type ‘OpenDDS::DCPS::DataWriterImpl_T::MarshalTraitsType {aka OpenDDS::DCPS::MarshalTraits}’ used in nested name specifier if (MarshalTraitsType::gen_is_bounded_size()) { ^/usr/local/include/dds/DCPS/DataWriterImpl_T.h:323:54: error: incomplete type ‘OpenDDS::DCPS::DataWriterImpl_T::MarshalTraitsType {aka OpenDDS::DCPS::MarshalTraits}’ used in nested name specifier if (MarshalTraitsType::gen_is_bounded_key_size()) { ^/usr/local/include/dds/DCPS/DataWriterImpl_T.h: In instantiation of ‘DDS::ReturnCode_t OpenDDS::DCPS::DataWriterImpl_T::enable_specific() [with MessageType = Messenger::Message; DDS::ReturnCode_t = int]’: /usr/local/include/dds/DCPS/FilterEvaluator.h:142:10: required from here /usr/local/include/dds/DCPS/DataWriterImpl_T.h:338:51: error: incomplete type ‘OpenDDS::DCPS::DataWriterImpl_T::MarshalTraitsType {aka OpenDDS::DCPS::MarshalTraits}’ used in nested name specifier if (MarshalTraitsType::gen_is_bounded_size()) ^
사람이 아이디어가 있습니까 무슨 잘못 또는 OpenDDS 애플리케이션을위한 표준 CMake가있다? 어떤 도움을 주셔서 대단히 감사합니다.
건배, 마르셀