diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c914176b6..bddf979c21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,13 +130,15 @@ ign_find_package(ignition-tools #-------------------------------------- # Find protobuf +# Module is needed to use the PROTOBUF_GENERATE_CPP +set(protobuf_MODULE_COMPATIBLE TRUE) set(REQ_PROTOBUF_VER 3) ign_find_package(IgnProtobuf VERSION ${REQ_PROTOBUF_VER} REQUIRED COMPONENTS all PRETTY Protobuf) -set(PROTOBUF_IMPORT_DIRS ${ignition-msgs7_INCLUDE_DIRS}) +set(Protobuf_IMPORT_DIRS ${ignition-msgs7_INCLUDE_DIRS}) # Plugin install dirs set(IGNITION_GAZEBO_PLUGIN_INSTALL_DIR diff --git a/include/ignition/gazebo/EntityComponentManager.hh b/include/ignition/gazebo/EntityComponentManager.hh index 75e883f15a..90816df770 100644 --- a/include/ignition/gazebo/EntityComponentManager.hh +++ b/include/ignition/gazebo/EntityComponentManager.hh @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/include/ignition/gazebo/EventManager.hh b/include/ignition/gazebo/EventManager.hh index 7d466c5b09..0241bae447 100644 --- a/include/ignition/gazebo/EventManager.hh +++ b/include/ignition/gazebo/EventManager.hh @@ -47,13 +47,13 @@ namespace ignition /// occur. /// /// See \ref ignition::gazebo::events for a complete list of events. - class IGNITION_GAZEBO_VISIBLE EventManager + class EventManager { /// \brief Constructor - public: EventManager(); + public: EventManager() = default; /// \brief Destructor - public: ~EventManager(); + public: ~EventManager() = default; /// \brief Add a connection to an event. /// \param[in] _subscriber A std::function callback function. The function diff --git a/include/ignition/gazebo/Server.hh b/include/ignition/gazebo/Server.hh index 8387399ae3..ff8edae5b6 100644 --- a/include/ignition/gazebo/Server.hh +++ b/include/ignition/gazebo/Server.hh @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/include/ignition/gazebo/World.hh b/include/ignition/gazebo/World.hh index 1e902ef169..55d98ea54b 100644 --- a/include/ignition/gazebo/World.hh +++ b/include/ignition/gazebo/World.hh @@ -18,6 +18,7 @@ #define IGNITION_GAZEBO_WORLD_HH_ #include +#include #include #include diff --git a/include/ignition/gazebo/detail/EntityComponentManager.hh b/include/ignition/gazebo/detail/EntityComponentManager.hh index 880dba745c..cb6c2e368f 100644 --- a/include/ignition/gazebo/detail/EntityComponentManager.hh +++ b/include/ignition/gazebo/detail/EntityComponentManager.hh @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/include/ignition/gazebo/gui/GuiRunner.hh b/include/ignition/gazebo/gui/GuiRunner.hh index 12fd1ae74c..8bb2ba7e7f 100644 --- a/include/ignition/gazebo/gui/GuiRunner.hh +++ b/include/ignition/gazebo/gui/GuiRunner.hh @@ -35,6 +35,7 @@ namespace gazebo inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE { /// \brief Responsible for running GUI systems as new states are received from /// the backend. + class IGNITION_GAZEBO_GUI_VISIBLE GuiRunner : public QObject { Q_OBJECT diff --git a/include/ignition/gazebo/gui/GuiSystem.hh b/include/ignition/gazebo/gui/GuiSystem.hh index c031101042..16ecdd1e09 100644 --- a/include/ignition/gazebo/gui/GuiSystem.hh +++ b/include/ignition/gazebo/gui/GuiSystem.hh @@ -41,7 +41,7 @@ namespace gazebo /// GUI systems are different from `ignition::gazebo::System`s because they /// don't run in the same process as the physics. Instead, they run in a /// separate process that is stepped by updates coming through the network - class IGNITION_GAZEBO_VISIBLE GuiSystem : public ignition::gui::Plugin + class GuiSystem : public ignition::gui::Plugin { Q_OBJECT diff --git a/include/ignition/gazebo/gui/TmpIface.hh b/include/ignition/gazebo/gui/TmpIface.hh index 8d339a887d..079b2946a5 100644 --- a/include/ignition/gazebo/gui/TmpIface.hh +++ b/include/ignition/gazebo/gui/TmpIface.hh @@ -36,7 +36,7 @@ namespace ignition /// Move API from here to their appropriate locations once that's known. /// /// This class should be removed before releasing! - class IGNITION_GAZEBO_VISIBLE TmpIface : public QObject + class TmpIface : public QObject { Q_OBJECT diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d529e58d9e..4a87bfad90 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,7 +42,6 @@ set (sources Barrier.cc Conversions.cc EntityComponentManager.cc - EventManager.cc LevelManager.cc Link.cc Model.cc @@ -86,6 +85,15 @@ set (gtest_sources network/NetworkManager_TEST.cc ) +if (MSVC) + # Warning #4251 is the "dll-interface" warning that tells you when types used + # by a class are not being exported. These generated source files have private + # members that don't get exported, so they trigger this warning. However, the + # warning is not important since those members do not need to be interfaced + # with. + set_source_files_properties(${sources} ${gtest_sources} COMPILE_FLAGS "/wd4251 /wd4146") +endif() + # Create the library target ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} @@ -102,7 +110,7 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ignition-plugin${IGN_PLUGIN_VER}::loader ) -if (NOT APPLE) +if (UNIX AND NOT APPLE) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE stdc++fs) endif() diff --git a/src/EventManager.cc b/src/EventManager.cc deleted file mode 100644 index 656c816607..0000000000 --- a/src/EventManager.cc +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2018 Open Source Robotics Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * -*/ -#include "ignition/gazebo/EventManager.hh" - -using namespace ignition; -using namespace gazebo; - -////////////////////////////////////////////////// -EventManager::EventManager() = default; - -////////////////////////////////////////////////// -EventManager::~EventManager() = default; diff --git a/src/SdfGenerator.hh b/src/SdfGenerator.hh index 5e267e9d9b..d0c2744c72 100644 --- a/src/SdfGenerator.hh +++ b/src/SdfGenerator.hh @@ -20,6 +20,7 @@ #include #include +#include #include #include diff --git a/src/Server.cc b/src/Server.cc index bb188ef993..aee4486823 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -15,6 +15,8 @@ * */ +#include + #include #include #include diff --git a/src/ServerPrivate.hh b/src/ServerPrivate.hh index c8980291c4..7aeae8a033 100644 --- a/src/ServerPrivate.hh +++ b/src/ServerPrivate.hh @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/src/SimulationRunner.hh b/src/SimulationRunner.hh index faf8e3518b..8e40106bbd 100644 --- a/src/SimulationRunner.hh +++ b/src/SimulationRunner.hh @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/src/gui/GuiFileHandler.hh b/src/gui/GuiFileHandler.hh index 017a575346..981b9fb769 100644 --- a/src/gui/GuiFileHandler.hh +++ b/src/gui/GuiFileHandler.hh @@ -36,7 +36,7 @@ inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE { namespace gui { /// \brief Class for handling saving and loading of SDFormat files -class IGNITION_GAZEBO_VISIBLE GuiFileHandler : public QObject +class GuiFileHandler : public QObject { Q_OBJECT diff --git a/src/gui/PathManager.hh b/src/gui/PathManager.hh index 2247916a60..341e382cf2 100644 --- a/src/gui/PathManager.hh +++ b/src/gui/PathManager.hh @@ -35,7 +35,7 @@ namespace gui /// \brief Class for handling paths and their environment variables. /// It queries the server for paths at startup, and keeps paths updated /// whenever they change in the server. -class IGNITION_GAZEBO_VISIBLE PathManager : public QObject +class PathManager : public QObject { Q_OBJECT diff --git a/src/gui/plugins/align_tool/AlignTool.cc b/src/gui/plugins/align_tool/AlignTool.cc index e2b7084e8a..e2c41740fb 100644 --- a/src/gui/plugins/align_tool/AlignTool.cc +++ b/src/gui/plugins/align_tool/AlignTool.cc @@ -24,6 +24,7 @@ #include #include #include + #include #include #include diff --git a/src/gui/plugins/resource_spawner/ResourceSpawner.hh b/src/gui/plugins/resource_spawner/ResourceSpawner.hh index d95e5727cb..2dd222534e 100644 --- a/src/gui/plugins/resource_spawner/ResourceSpawner.hh +++ b/src/gui/plugins/resource_spawner/ResourceSpawner.hh @@ -18,6 +18,7 @@ #ifndef IGNITION_GAZEBO_GUI_RESOURCE_SPAWNER_HH_ #define IGNITION_GAZEBO_GUI_RESOURCE_SPAWNER_HH_ +#include #include #include #include diff --git a/src/systems/CMakeLists.txt b/src/systems/CMakeLists.txt index c5eeabe6e7..1427a96125 100644 --- a/src/systems/CMakeLists.txt +++ b/src/systems/CMakeLists.txt @@ -62,12 +62,16 @@ function(gz_add_system system_name) # files, we also install an unversioned symlink into the same versioned folder. set(versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${system_target}${CMAKE_SHARED_LIBRARY_SUFFIX}) set(unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${system_name}${CMAKE_SHARED_LIBRARY_SUFFIX}) - if (WIN32) - # create_symlink requires cmake 3.13 on windows - cmake_minimum_required(VERSION 3.13 FATAL_ERROR) + if(WIN32) + # symlinks on Windows require admin priviledges, fallback to copy + ADD_CUSTOM_COMMAND(TARGET ${system_target} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy + "$" + "$/${unversioned}") + else() + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned}) + INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_GAZEBO_PLUGIN_INSTALL_DIR}) endif() - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned}) - INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_GAZEBO_PLUGIN_INSTALL_DIR}) endfunction() add_subdirectory(air_pressure) diff --git a/test/integration/entity_erase.cc b/test/integration/entity_erase.cc index bb017612a4..24384c1eb1 100644 --- a/test/integration/entity_erase.cc +++ b/test/integration/entity_erase.cc @@ -17,6 +17,8 @@ #include +#include + #include "ignition/gazebo/Server.hh" #include "ignition/gazebo/test_config.hh" // NOLINT(build/include)