Skip to content

Commit

Permalink
Merge pull request #15 from doug1234/BuildUpdate
Browse files Browse the repository at this point in the history
Fixed build issues on Windows
  • Loading branch information
iguessthislldo authored Jul 8, 2023
2 parents 176e19f + 69defea commit 2c8a66f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
29 changes: 18 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.20)

project(opendds-monitor VERSION 0.0.1 LANGUAGES CXX)
project(monitor VERSION 0.0.1 LANGUAGES CXX)

find_package(OpenDDS REQUIRED)

Expand All @@ -23,8 +23,6 @@ else()
find_package(Qwt MODULE REQUIRED)
endif()

set(CMAKE_AUTOMOC FALSE)

set(HEADER
src/dds_data.h
src/dynamic_meta_struct.h
Expand Down Expand Up @@ -95,8 +93,6 @@ qt5_wrap_cpp(MOC_SOURCE
src/topic_table_model.h
)

qt5_wrap_ui(UI_SOURCE ${UI})

add_executable(monitor
${SOURCE}
${HEADER}
Expand All @@ -105,10 +101,22 @@ add_executable(monitor
${UI_SOURCE}
)

if (MSVC)
target_compile_definitions(monitor PRIVATE _CRT_SECURE_NO_WARNINGS)
else()
target_compile_features(monitor PRIVATE cxx_std_17)
set_property(TARGET monitor PROPERTY AUTOUIC TRUE)
set_property(TARGET monitor APPEND PROPERTY AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui")

target_compile_features(monitor PRIVATE cxx_std_17)

if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_definitions(monitor PRIVATE _CRT_SECURE_NO_WARNINGS _HAS_AUTO_PTR_ETC=1)

target_compile_options(monitor PRIVATE
/W4 # Set the warning level to "Level4"
/wd4251 #Must have dll-interface to be used by clients of struct.
/wd4244 #Conversion warning from ACE.
/wd4250 #inherits via dominance
/wd4275 #non dll-interface class used as base for dll-interface class
/WX # Warnings are errors!!!!
)
endif()

target_compile_options(monitor PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>: -Wall -Wextra -Wpedantic -Wno-unused -Wunused-parameter> $<$<CXX_COMPILER_ID:MSVC>: /W4>)
Expand All @@ -129,7 +137,6 @@ target_link_libraries(monitor

target_include_directories(monitor PRIVATE
${QWT_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
)

configure_file(opendds.ini . COPYONLY)
Expand Down
2 changes: 1 addition & 1 deletion src/topic_table_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ void TopicTableModel::parseAggregated(const DDS::DynamicData_var& data, const st
case OpenDDS::XTypes::TK_STRUCTURE:
case OpenDDS::XTypes::TK_UNION: {
DDS::DynamicData_var nested_data;
DDS::ReturnCode_t ret = data->get_complex_value(nested_data, id);
ret = data->get_complex_value(nested_data, id);
if (ret != DDS::RETCODE_OK) {
std::cerr << "get_complex_value for member Id " << id << " failed" << std::endl;
} else {
Expand Down

0 comments on commit 2c8a66f

Please sign in to comment.