Skip to content

Commit

Permalink
Rename CMake project to gz
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored and methylDragon committed Jun 20, 2022
1 parent a950315 commit 487915e
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 85 deletions.
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-physics6 VERSION 6.0.0)
project(gz-physics6 VERSION 6.0.0)

#============================================================================
# Find ignition-cmake
# Find gz-cmake
#============================================================================
find_package(ignition-cmake3 REQUIRED)
find_package(gz-cmake3 REQUIRED)

#============================================================================
# Configure the project
Expand All @@ -35,26 +35,26 @@ endif()
message(STATUS "\n\n-- ====== Finding Dependencies ======")

#--------------------------------------
# Find ignition-common
gz_find_package(ignition-common5
# Find gz-common
gz_find_package(gz-common5
COMPONENTS geospatial graphics profiler
REQUIRED_BY heightmap mesh dartsim tpe tpelib bullet)
set(IGN_COMMON_VER ${ignition-common5_VERSION_MAJOR})
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})

#--------------------------------------
# Find ignition-math
gz_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)
set(IGN_MATH_VER ${ignition-math7_VERSION_MAJOR})
# Find gz-math
gz_find_package(gz-math7 REQUIRED COMPONENTS eigen3)
set(GZ_MATH_VER ${gz-math7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-plugin
gz_find_package(ignition-plugin2 REQUIRED COMPONENTS all)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})
# Find gz-plugin
gz_find_package(gz-plugin2 REQUIRED COMPONENTS all)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

#--------------------------------------
# Find ignition-utils
gz_find_package(ignition-utils2 REQUIRED COMPONENTS cli)
set(IGN_UTILS_VER ${ignition-utils2_VERSION_MAJOR})
# Find gz-utils
gz_find_package(gz-utils2 REQUIRED COMPONENTS cli)
set(GZ_UTILS_VER ${gz-utils2_VERSION_MAJOR})

#--------------------------------------
# Find Eigen
Expand Down
8 changes: 4 additions & 4 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
1. Ignore invalid joint commands
* [Pull request #137](https://github.com/gazebosim/gz-physics/pull/137)

1. Fix CONFIG arg in ign_find_package(DART) call
1. Fix CONFIG arg in gz_find_package(DART) call
* [Pull request #119](https://github.com/gazebosim/gz-physics/pull/119)

### Gazebo Physics 3.1.0 (2020-10-18)
Expand All @@ -297,7 +297,7 @@
1. Support nested models in TPE
* [Pull request 86](https://github.com/gazebosim/gz-physics/pull/86)

1. Fix CONFIG arg in ign_find_package(DART) call
1. Fix CONFIG arg in gz_find_package(DART) call
* [Pull request 119](https://github.com/gazebosim/gz-physics/pull/119)

1. Fix getting model bounding box in world frame in TPE
Expand Down Expand Up @@ -388,7 +388,7 @@
1. Support getting shape AABB in world frame
* [Pull request #127](https://github.com/gazebosim/gz-physics/pull/127)

1. Fix CONFIG arg in `ign_find_package(DART)` call
1. Fix CONFIG arg in `gz_find_package(DART)` call
* [Pull request #119](https://github.com/gazebosim/gz-physics/pull/119)

### Gazebo Physics 2.3.0 (2020-09-29)
Expand Down Expand Up @@ -512,7 +512,7 @@
1. Ignore invalid joint commands in the dartsim-plugin
* [Pull request 137](https://github.com/gazebosim/gz-physics/pull/137)

1. Fix CONFIG arg in ign_find_package(DART) call
1. Fix CONFIG arg in gz_find_package(DART) call
* [Pull request 119](https://github.com/gazebosim/gz-physics/pull/119)

### Gazebo Physics 1.9.0 (2020-09-17)
Expand Down
10 changes: 5 additions & 5 deletions bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ target_link_libraries(${bullet_plugin}
${features}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-mesh
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
ignition-math${IGN_MATH_VER}::eigen3)
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-math${GZ_MATH_VER}::eigen3)

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${bullet_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})
Expand All @@ -33,7 +33,7 @@ install(
DESTINATION "${IGN_INCLUDE_INSTALL_DIR_FULL}")

# The library created by `gz_add_component` includes the ign-physics version
# (i.e. libignition-physics1-name-plugin.so), but for portability,
# (i.e. libgz-physics1-name-plugin.so), but for portability,
# we also install an unversioned symlink into the same versioned folder.
set(versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${bullet_plugin}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand All @@ -56,8 +56,8 @@ gz_build_tests(
SOURCES ${test_sources}
LIB_DEPS
${features}
ignition-plugin${IGN_PLUGIN_VER}::loader
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
gz-plugin${GZ_PLUGIN_VER}::loader
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-mesh
TEST_LIST tests)
Expand Down
18 changes: 9 additions & 9 deletions dartsim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ target_link_libraries(${dartsim_plugin}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-heightmap
${PROJECT_LIBRARY_TARGET_NAME}-mesh
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
ignition-common${IGN_COMMON_VER}::geospatial
ignition-math${IGN_MATH_VER}::eigen3
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-common${GZ_COMMON_VER}::geospatial
gz-math${GZ_MATH_VER}::eigen3
PRIVATE
# We need to link this, even when the profiler isn't used to get headers.
ignition-common${IGN_COMMON_VER}::profiler
gz-common${GZ_COMMON_VER}::profiler
)

# The ignition fork of DART contains additional code that allows customizing
# The Gazebo fork of DART contains additional code that allows customizing
# contact constraints. We check for the presence of "ContactSurface.hpp", which
# was added to enable these customizations, to detect if the feature is
# available.
Expand All @@ -62,7 +62,7 @@ endif()
install(TARGETS ${dartsim_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# The library created by `gz_add_component` includes the ign-physics version
# (i.e. libignition-physics1-name-plugin.so), but for portability,
# (i.e. libgz-physics1-name-plugin.so), but for portability,
# we also install an unversioned symlink into the same versioned folder.
set(versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${dartsim_plugin}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand All @@ -83,9 +83,9 @@ gz_build_tests(
SOURCES ${test_sources}
LIB_DEPS
${features}
ignition-plugin${IGN_PLUGIN_VER}::loader
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
ignition-common${IGN_COMMON_VER}::geospatial
gz-plugin${GZ_PLUGIN_VER}::loader
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-common${GZ_COMMON_VER}::geospatial
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-heightmap
${PROJECT_LIBRARY_TARGET_NAME}-mesh
Expand Down
12 changes: 6 additions & 6 deletions examples/hello_world_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(ign-physics-hello-world-loader)

find_package(ignition-plugin2 REQUIRED COMPONENTS all)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})
find_package(gz-plugin2 REQUIRED COMPONENTS all)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

find_package(ignition-physics6 REQUIRED)
set(IGN_PHYSICS_VER ${ignition-physics6_VERSION_MAJOR})
find_package(gz-physics6 REQUIRED)
set(GZ_PHYSICS_VER ${gz-physics6_VERSION_MAJOR})

add_executable(hello_world_loader hello_world_loader.cc)
target_link_libraries(hello_world_loader
ignition-plugin${IGN_PLUGIN_VER}::loader
ignition-physics${IGN_PHYSICS_VER}::ignition-physics${IGN_PHYSICS_VER})
gz-plugin${GZ_PLUGIN_VER}::loader
gz-physics${GZ_PHYSICS_VER}::gz-physics${GZ_PHYSICS_VER})
4 changes: 2 additions & 2 deletions examples/hello_world_loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ For example, if you have the Gazebo Physics plugin for DART compiled, find
where it's installed with:

~~~
find / | grep libignition-physics-dartsim-plugin.so
find / | grep libgz-physics-dartsim-plugin.so
~~~

You may find more than one file. Choose one of them, and load it with
the example loader like this:

~~~
cd examples/hello_world_loader/build
./hello_world_loader <path_to>/libignition-physics-dartsim-plugin.so
./hello_world_loader <path_to>/libgz-physics-dartsim-plugin.so
~~~

And you'll see the engine info:
Expand Down
10 changes: 5 additions & 5 deletions examples/hello_world_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(ign-physics-hello-world-plugin)

find_package(ignition-plugin2 REQUIRED COMPONENTS all)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})
find_package(gz-plugin2 REQUIRED COMPONENTS all)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

find_package(ignition-physics6 REQUIRED)
set(IGN_PHYSICS_VER ${ignition-physics6_VERSION_MAJOR})
find_package(gz-physics6 REQUIRED)
set(GZ_PHYSICS_VER ${gz-physics6_VERSION_MAJOR})

add_library(HelloWorldPlugin SHARED HelloWorldPlugin.cc)
target_link_libraries(HelloWorldPlugin
PRIVATE
ignition-physics${IGN_PHYSICS_VER}::ignition-physics${IGN_PHYSICS_VER})
gz-physics${GZ_PHYSICS_VER}::gz-physics${GZ_PHYSICS_VER})
14 changes: 7 additions & 7 deletions examples/simple_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(ign-physics-simple-plugin)

find_package(ignition-plugin2 REQUIRED COMPONENTS all)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})
find_package(gz-plugin2 REQUIRED COMPONENTS all)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

find_package(ignition-physics6 REQUIRED)
set(IGN_PHYSICS_VER ${ignition-physics6_VERSION_MAJOR})
find_package(gz-physics6 REQUIRED)
set(GZ_PHYSICS_VER ${gz-physics6_VERSION_MAJOR})

add_library(SimplePlugin SHARED plugin.cc EntityManagementFeatures.cc)
target_link_libraries(SimplePlugin
PRIVATE
ignition-physics${IGN_PHYSICS_VER}::ignition-physics${IGN_PHYSICS_VER})
gz-physics${GZ_PHYSICS_VER}::gz-physics${GZ_PHYSICS_VER})

add_executable(PluginTest EntityManagementFeatures_TEST.cc)
target_link_libraries(PluginTest
ignition-plugin${IGN_PLUGIN_VER}::loader
ignition-physics${IGN_PHYSICS_VER}::ignition-physics${IGN_PHYSICS_VER})
gz-plugin${GZ_PLUGIN_VER}::loader
gz-physics${GZ_PHYSICS_VER}::gz-physics${GZ_PHYSICS_VER})

target_compile_definitions(PluginTest PRIVATE
"simple_plugin_LIB=\"$<TARGET_FILE:SimplePlugin>\"")
2 changes: 1 addition & 1 deletion heightmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ gz_add_component(heightmap INTERFACE

target_link_libraries(${heightmap}
INTERFACE
ignition-common${IGN_COMMON_VER}::geospatial)
gz-common${GZ_COMMON_VER}::geospatial)

install(
DIRECTORY include/
Expand Down
2 changes: 1 addition & 1 deletion mesh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ gz_add_component(mesh INTERFACE

target_link_libraries(${mesh}
INTERFACE
ignition-common${IGN_COMMON_VER}::graphics)
gz-common${GZ_COMMON_VER}::graphics)

install(
DIRECTORY include/
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ gz_create_core_library(SOURCES ${sources} CXX_STANDARD 17)

target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
${ignition-math${IGN_MATH_VER}_LIBRARIES}
ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER}
ignition-plugin${IGN_PLUGIN_VER}::register
${gz-math${GZ_MATH_VER}_LIBRARIES}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
gz-plugin${GZ_PLUGIN_VER}::register
Eigen3::Eigen)

gz_build_tests(
Expand All @@ -15,5 +15,5 @@ gz_build_tests(

if(TARGET UNIT_FindFeatures_TEST)
target_link_libraries(UNIT_FindFeatures_TEST
ignition-plugin${IGN_PLUGIN_VER}::loader)
gz-plugin${GZ_PLUGIN_VER}::loader)
endif()
2 changes: 1 addition & 1 deletion test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gz_build_tests(
SOURCES ${tests}
LIB_DEPS
Eigen3::Eigen
ignition-plugin${IGN_PLUGIN_VER}::loader
gz-plugin${GZ_PLUGIN_VER}::loader
TEST_LIST list)

if (BUILD_TESTING)
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (DART_FOUND)
add_library(MockDoublePendulum SHARED DARTDoublePendulum.cc)
target_link_libraries(MockDoublePendulum PRIVATE ignition-common${IGN_COMMON_VER}::core)
target_link_libraries(MockDoublePendulum PRIVATE gz-common${GZ_COMMON_VER}::core)
endif()
add_library(MockEntities SHARED MockEntities.cc)
add_library(MockFrames SHARED frames.cc)
Expand Down
8 changes: 4 additions & 4 deletions tpe/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ gz_add_component(tpelib
target_link_libraries(${tpelib_target}
PUBLIC
PRIVATE
ignition-common${IGN_COMMON_VER}::requested
ignition-math${IGN_MATH_VER}::eigen3
gz-common${GZ_COMMON_VER}::requested
gz-math${GZ_MATH_VER}::eigen3
)

gz_build_tests(
TYPE UNIT_tpelib
SOURCES ${test_sources}
LIB_DEPS
ignition-plugin${IGN_PLUGIN_VER}::loader
ignition-common${IGN_COMMON_VER}::requested
gz-plugin${GZ_PLUGIN_VER}::loader
gz-common${GZ_COMMON_VER}::requested
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-mesh
${tpelib_target}
Expand Down
12 changes: 6 additions & 6 deletions tpe/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ target_link_libraries(${tpe_plugin}
${features}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-mesh
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
ignition-math${IGN_MATH_VER}::eigen3
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-math${GZ_MATH_VER}::eigen3
PRIVATE
# We need to link this, even when the profiler isn't used to get headers.
ignition-common${IGN_COMMON_VER}::profiler
gz-common${GZ_COMMON_VER}::profiler
)

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${tpe_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# The library created by `gz_add_component` includes the ign-physics version
# (i.e. libignition-physics1-name-plugin.so), but for portability,
# (i.e. libgz-physics1-name-plugin.so), but for portability,
# we also install an unversioned symlink into the same versioned folder.
set(versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${tpe_plugin}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand All @@ -55,8 +55,8 @@ gz_build_tests(
SOURCES ${test_sources}
LIB_DEPS
${features}
ignition-plugin${IGN_PLUGIN_VER}::loader
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
gz-plugin${GZ_PLUGIN_VER}::loader
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-mesh
TEST_LIST tests)
Expand Down
12 changes: 6 additions & 6 deletions tutorials/04-switching-physics-engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Gazebo automatically looks for all physics engine plugins that are
installed with Gazebo Physics.
At the time of writing, there are two physics engines available (more detail
in \ref physicsplugin "Physics plugin tutorial"):
- **DART**: `ignition-physics-dartsim-plugin`.
- **TPE**: `ignition-physics-tpe-plugin`.
- **DART**: `gz-physics-dartsim-plugin`.
- **TPE**: `gz-physics-tpe-plugin`.

If you've created a custom engine plugin, you can tell Gazebo where to
find it by setting the `GZ_SIM_PHYSICS_ENGINE_PATH` environment variable to
Expand Down Expand Up @@ -66,8 +66,8 @@ For the example above, you can load it like this:

```{.xml}
<plugin
filename="ignition-gazebo-physics-system"
name="gz::gazebo::systems::Physics">
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
<engine>
<filename>CustomEngine</filename>
</engine>
Expand All @@ -91,10 +91,10 @@ When instantiating a server programmatically, a physics engine can be passed to
the constructor, for example:

```
gz::gazebo::ServerConfig serverConfig;
gz::sim::ServerConfig serverConfig;
serverConfig.SetPhysicsEngine("CustomEngine");
gz::gazebo::Server server(serverConfig);
gz::sim::Server server(serverConfig);
```

## Troubleshooting
Expand Down
Loading

0 comments on commit 487915e

Please sign in to comment.