Skip to content

Commit

Permalink
Fix Windows build when using vcpkg (#3132)
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
Ace314159 and scpeters authored Dec 14, 2021
1 parent 505297a commit adb0834
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ else()
set(GAZEBO_SETUP_SH_PLUGIN_PATH ${GAZEBO_SETUP_SH_PLUGIN_LIB_INSTALL_DIR})
set(GAZEBO_PLUGIN_PATH ${GAZEBO_PLUGIN_LIB_INSTALL_DIR})
endif()
FILE(TO_NATIVE_PATH "${GAZEBO_PLUGIN_PATH}" GAZEBO_PLUGIN_PATH)
FILE(TO_CMAKE_PATH "${GAZEBO_PLUGIN_PATH}" GAZEBO_PLUGIN_PATH)
join_paths(GAZEBO_SETUP_SH_MODEL_PATH "\${installPrefix}" ${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/models)
set(GAZEBO_MODEL_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/models)
FILE(TO_NATIVE_PATH "${GAZEBO_MODEL_PATH}" GAZEBO_MODEL_PATH)
FILE(TO_CMAKE_PATH "${GAZEBO_MODEL_PATH}" GAZEBO_MODEL_PATH)
join_paths(GAZEBO_SETUP_SH_RESOURCE_PATH "\${installPrefix}" ${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION})
set(GAZEBO_RESOURCE_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION})
FILE(TO_NATIVE_PATH "${GAZEBO_RESOURCE_PATH}" GAZEBO_RESOURCE_PATH)
FILE(TO_CMAKE_PATH "${GAZEBO_RESOURCE_PATH}" GAZEBO_RESOURCE_PATH)
set(GAZEBO_MODEL_DATABASE_URI http://models.gazebosim.org)
set(OGRE_RESOURCE_PATH ${OGRE_PLUGINDIR})
# Seems that OGRE_PLUGINDIR can end in a newline, which will cause problems when
Expand Down
6 changes: 3 additions & 3 deletions cmake/FindGraphviz.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ endif ( GRAPHVIZ_CGRAPH_LIBRARY )

# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if( NOT WIN32 )
find_package(PkgConfig)
find_package(PkgConfig)
if( PkgConfig_FOUND )

pkg_check_modules(GRAPHVIZ_GVC_PKG libgvc)
pkg_check_modules(GRAPHVIZ_CGRAPH_PKG libcgraph)
pkg_check_modules(GRAPHVIZ_CDT_PKG libcdt)
endif( NOT WIN32 )
endif()

FIND_LIBRARY(GRAPHVIZ_GVC_LIBRARY NAMES gvc libgvc
PATHS
Expand Down
2 changes: 1 addition & 1 deletion cmake/GazeboUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ macro (gz_setup_windows)
endif()

if (MSVC)
add_compile_options(/Zc:__cplusplus)
add_compile_options(/Zc:__cplusplus /permissive- /Zc:strictStrings- /Zc:externC-)
endif()
endmacro()

Expand Down
4 changes: 4 additions & 0 deletions gazebo/common/MeshCSG.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ typedef _GtsSurface GtsSurface;
struct _GPtrArray;
typedef _GPtrArray GPtrArray;

#ifdef DIFFERENCE
#undef DIFFERENCE
#endif

namespace gazebo
{
namespace common
Expand Down

0 comments on commit adb0834

Please sign in to comment.