From cfbab29f44cd48fc7a921d7c88aecd6a35d2f036 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 22 Jan 2025 14:11:23 -0800 Subject: [PATCH 1/5] Remove major version from package name * Update cmake project name, package.xml name * Remove version from cmake target names * Change examples to find_package(gz-sim) and update target names. Signed-off-by: Steve Peters --- CMakeLists.txt | 2 +- examples/plugin/command_actor/CMakeLists.txt | 4 ++-- examples/plugin/custom_component/CMakeLists.txt | 4 ++-- examples/plugin/custom_sensor_system/CMakeLists.txt | 5 ++--- examples/plugin/gui_system_plugin/CMakeLists.txt | 4 ++-- examples/plugin/hello_world/CMakeLists.txt | 5 ++--- examples/plugin/priority_printer_plugin/CMakeLists.txt | 5 ++--- examples/plugin/rendering_plugins/CMakeLists.txt | 4 ++-- examples/plugin/reset_plugin/CMakeLists.txt | 5 ++--- examples/plugin/system_plugin/CMakeLists.txt | 4 ++-- examples/standalone/acoustic_comms_demo/CMakeLists.txt | 5 ++--- examples/standalone/custom_server/CMakeLists.txt | 5 ++--- examples/standalone/each_performance/CMakeLists.txt | 4 ++-- examples/standalone/external_ecm/CMakeLists.txt | 4 ++-- examples/standalone/gtest_setup/CMakeLists.txt | 5 ++--- examples/standalone/light_control/CMakeLists.txt | 5 ++--- examples/standalone/lrauv_control/CMakeLists.txt | 5 ++--- examples/standalone/multi_lrauv_race/CMakeLists.txt | 5 ++--- package.xml | 2 +- src/CMakeLists.txt | 6 +++--- src/gui/CMakeLists.txt | 2 +- src/gui/plugins/CMakeLists.txt | 4 ++-- src/systems/camera_video_recorder/CMakeLists.txt | 2 +- src/systems/lens_flare/CMakeLists.txt | 2 +- test/performance/CMakeLists.txt | 4 ++-- test/plugins/CMakeLists.txt | 2 +- tutorials/create_system_plugins.md | 2 +- tutorials/migrating_ardupilot_plugin.md | 2 +- 28 files changed, 49 insertions(+), 59 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ba16308f5..cbfa5dd73d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) #============================================================================ # Initialize the project #============================================================================ -project(gz-sim10 VERSION 10.0.0) +project(gz-sim VERSION 10.0.0) set (GZ_DISTRIBUTION "Ionic") #============================================================================ diff --git a/examples/plugin/command_actor/CMakeLists.txt b/examples/plugin/command_actor/CMakeLists.txt index c70ec71a84..fb14428437 100644 --- a/examples/plugin/command_actor/CMakeLists.txt +++ b/examples/plugin/command_actor/CMakeLists.txt @@ -7,9 +7,9 @@ project(CommandActor) find_package(gz-plugin3 REQUIRED COMPONENTS register) set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) +find_package(gz-sim REQUIRED) add_library(CommandActor SHARED CommandActor.cc) set_property(TARGET CommandActor PROPERTY CXX_STANDARD 17) target_link_libraries(CommandActor PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - PRIVATE gz-sim10::gz-sim10) + PRIVATE gz-sim::gz-sim) diff --git a/examples/plugin/custom_component/CMakeLists.txt b/examples/plugin/custom_component/CMakeLists.txt index e2bf50a8dd..f19607af3b 100644 --- a/examples/plugin/custom_component/CMakeLists.txt +++ b/examples/plugin/custom_component/CMakeLists.txt @@ -7,11 +7,11 @@ project(CustomComponentPlugin) find_package(gz-plugin3 REQUIRED COMPONENTS register) set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) +find_package(gz-sim REQUIRED) add_library(CustomComponentPlugin SHARED CustomComponentPlugin.cc ) set_property(TARGET CustomComponentPlugin PROPERTY CXX_STANDARD 17) target_link_libraries(CustomComponentPlugin PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - PRIVATE gz-sim10::gz-sim10) + PRIVATE gz-sim::gz-sim) diff --git a/examples/plugin/custom_sensor_system/CMakeLists.txt b/examples/plugin/custom_sensor_system/CMakeLists.txt index 58fd5050ba..aa276bc7f4 100644 --- a/examples/plugin/custom_sensor_system/CMakeLists.txt +++ b/examples/plugin/custom_sensor_system/CMakeLists.txt @@ -7,8 +7,7 @@ project(OdometerSystem) gz_find_package(gz-plugin3 REQUIRED COMPONENTS register) set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR}) -gz_find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +gz_find_package(gz-sim REQUIRED) find_package(gz-sensors9 REQUIRED) set(GZ_SENSORS_VER ${gz-sensors9_VERSION_MAJOR}) @@ -29,7 +28,7 @@ add_library(${PROJECT_NAME} SHARED ${PROJECT_NAME}.cc) target_link_libraries(${PROJECT_NAME} PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} + gz-sim::gz-sim gz-sensors${GZ_SENSORS_VER}::gz-sensors${GZ_SENSORS_VER} odometer ) diff --git a/examples/plugin/gui_system_plugin/CMakeLists.txt b/examples/plugin/gui_system_plugin/CMakeLists.txt index 1393f60017..d067d42de6 100644 --- a/examples/plugin/gui_system_plugin/CMakeLists.txt +++ b/examples/plugin/gui_system_plugin/CMakeLists.txt @@ -8,7 +8,7 @@ project(GuiSystemPlugin) set(CMAKE_AUTOMOC ON) -find_package(gz-sim10 REQUIRED COMPONENTS gui) +find_package(gz-sim REQUIRED COMPONENTS gui) QT5_ADD_RESOURCES(resources_RCC ${PROJECT_NAME}.qrc) @@ -17,5 +17,5 @@ add_library(${PROJECT_NAME} SHARED ${resources_RCC} ) target_link_libraries(${PROJECT_NAME} - PRIVATE gz-sim10::gui + PRIVATE gz-sim::gui ) diff --git a/examples/plugin/hello_world/CMakeLists.txt b/examples/plugin/hello_world/CMakeLists.txt index 116a37718c..7953d2d19b 100644 --- a/examples/plugin/hello_world/CMakeLists.txt +++ b/examples/plugin/hello_world/CMakeLists.txt @@ -7,11 +7,10 @@ project(Hello_world) gz_find_package(gz-plugin3 REQUIRED COMPONENTS register) set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR}) -gz_find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +gz_find_package(gz-sim REQUIRED) add_library(HelloWorld SHARED HelloWorld.cc) set_property(TARGET HelloWorld PROPERTY CXX_STANDARD 17) target_link_libraries(HelloWorld PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - PRIVATE gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}) + PRIVATE gz-sim::gz-sim) diff --git a/examples/plugin/priority_printer_plugin/CMakeLists.txt b/examples/plugin/priority_printer_plugin/CMakeLists.txt index 64dd17a8c1..ab211a54a7 100644 --- a/examples/plugin/priority_printer_plugin/CMakeLists.txt +++ b/examples/plugin/priority_printer_plugin/CMakeLists.txt @@ -7,11 +7,10 @@ project(Priority_printer) gz_find_package(gz-plugin3 REQUIRED COMPONENTS register) set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR}) -gz_find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +gz_find_package(gz-sim REQUIRED) add_library(PriorityPrinter SHARED PriorityPrinter.cc) set_property(TARGET PriorityPrinter PROPERTY CXX_STANDARD 17) target_link_libraries(PriorityPrinter PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - PRIVATE gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}) + PRIVATE gz-sim::gz-sim) diff --git a/examples/plugin/rendering_plugins/CMakeLists.txt b/examples/plugin/rendering_plugins/CMakeLists.txt index 16c453296f..115d5c3622 100644 --- a/examples/plugin/rendering_plugins/CMakeLists.txt +++ b/examples/plugin/rendering_plugins/CMakeLists.txt @@ -32,13 +32,13 @@ target_link_libraries(${GUI_PLUGIN} set(SERVER_PLUGIN RenderingServerPlugin) find_package(gz-plugin3 REQUIRED COMPONENTS register) -find_package(gz-sim10 REQUIRED) +find_package(gz-sim REQUIRED) add_library(${SERVER_PLUGIN} SHARED ${SERVER_PLUGIN}.cc) set_property(TARGET ${SERVER_PLUGIN} PROPERTY CXX_STANDARD 17) target_link_libraries(${SERVER_PLUGIN} PRIVATE gz-plugin3::gz-plugin3 - gz-sim10::gz-sim10 + gz-sim::gz-sim gz-rendering9::gz-rendering9 ) diff --git a/examples/plugin/reset_plugin/CMakeLists.txt b/examples/plugin/reset_plugin/CMakeLists.txt index e295db9980..59759a413a 100644 --- a/examples/plugin/reset_plugin/CMakeLists.txt +++ b/examples/plugin/reset_plugin/CMakeLists.txt @@ -5,10 +5,9 @@ project(ResetPlugins) find_package(gz-plugin3 REQUIRED COMPONENTS register) set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +find_package(gz-sim REQUIRED) add_library(JointPositionRandomizer SHARED JointPositionRandomizer.cc) target_link_libraries(JointPositionRandomizer PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - PRIVATE gz-sim${GZ_SIM_VER}::core) + PRIVATE gz-sim::core) diff --git a/examples/plugin/system_plugin/CMakeLists.txt b/examples/plugin/system_plugin/CMakeLists.txt index 06995a3e97..89086b1b89 100644 --- a/examples/plugin/system_plugin/CMakeLists.txt +++ b/examples/plugin/system_plugin/CMakeLists.txt @@ -7,9 +7,9 @@ project(SampleSystem) find_package(gz-plugin3 REQUIRED COMPONENTS register) set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) +find_package(gz-sim REQUIRED) add_library(SampleSystem SHARED SampleSystem.cc SampleSystem2.cc) set_property(TARGET SampleSystem PROPERTY CXX_STANDARD 17) target_link_libraries(SampleSystem PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - PRIVATE gz-sim10::gz-sim10) + PRIVATE gz-sim::gz-sim) diff --git a/examples/standalone/acoustic_comms_demo/CMakeLists.txt b/examples/standalone/acoustic_comms_demo/CMakeLists.txt index 644eb41a68..209da9efa7 100644 --- a/examples/standalone/acoustic_comms_demo/CMakeLists.txt +++ b/examples/standalone/acoustic_comms_demo/CMakeLists.txt @@ -5,10 +5,9 @@ project(gz-sim-acoustic-comms-demo) find_package(gz-transport14 QUIET REQUIRED OPTIONAL_COMPONENTS log) set(GZ_TRANSPORT_VER ${gz-transport14_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +find_package(gz-sim REQUIRED) add_executable(acoustic_comms_demo acoustic_comms_demo.cc) target_link_libraries(acoustic_comms_demo gz-transport${GZ_TRANSPORT_VER}::core - gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}) + gz-sim::gz-sim) diff --git a/examples/standalone/custom_server/CMakeLists.txt b/examples/standalone/custom_server/CMakeLists.txt index a4371deb7d..3c987b9c5f 100644 --- a/examples/standalone/custom_server/CMakeLists.txt +++ b/examples/standalone/custom_server/CMakeLists.txt @@ -3,11 +3,10 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) project(gz-sim-custom-server) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - find_package(gz-sim10 REQUIRED) - set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) + find_package(gz-sim REQUIRED) add_executable(custom_server custom_server.cc) target_link_libraries(custom_server - gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} + gz-sim::gz-sim ) endif() diff --git a/examples/standalone/each_performance/CMakeLists.txt b/examples/standalone/each_performance/CMakeLists.txt index dd890ac103..5231a6a6ea 100644 --- a/examples/standalone/each_performance/CMakeLists.txt +++ b/examples/standalone/each_performance/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) project(gz-sim-each-performance) -find_package(gz-sim10 QUIET REQUIRED) +find_package(gz-sim QUIET REQUIRED) add_executable(each each.cc) target_link_libraries(each - gz-sim10::core) + gz-sim::core) diff --git a/examples/standalone/external_ecm/CMakeLists.txt b/examples/standalone/external_ecm/CMakeLists.txt index ce219def74..39beb8a964 100644 --- a/examples/standalone/external_ecm/CMakeLists.txt +++ b/examples/standalone/external_ecm/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) project(gz-sim-external-ecm) -find_package(gz-sim10 REQUIRED) +find_package(gz-sim REQUIRED) add_executable(external_ecm external_ecm.cc) target_link_libraries(external_ecm - gz-sim10::core) + gz-sim::core) diff --git a/examples/standalone/gtest_setup/CMakeLists.txt b/examples/standalone/gtest_setup/CMakeLists.txt index b4231d3157..c1c6164f27 100644 --- a/examples/standalone/gtest_setup/CMakeLists.txt +++ b/examples/standalone/gtest_setup/CMakeLists.txt @@ -3,8 +3,7 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) project(GTestSetup) # Find Gazebo -find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +find_package(gz-sim REQUIRED) # Fetch and configure GTest include(FetchContent) @@ -30,7 +29,7 @@ foreach(TEST_TARGET ) target_link_libraries(${TEST_TARGET} gtest_main - gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} + gz-sim::gz-sim ) include(GoogleTest) gtest_discover_tests(${TEST_TARGET}) diff --git a/examples/standalone/light_control/CMakeLists.txt b/examples/standalone/light_control/CMakeLists.txt index 22e6172238..6fbb34f805 100644 --- a/examples/standalone/light_control/CMakeLists.txt +++ b/examples/standalone/light_control/CMakeLists.txt @@ -5,10 +5,9 @@ project(gz-sim-light-control) find_package(gz-transport14 QUIET REQUIRED OPTIONAL_COMPONENTS log) set(GZ_TRANSPORT_VER ${gz-transport14_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +find_package(gz-sim REQUIRED) add_executable(light_control light_control.cc) target_link_libraries(light_control gz-transport${GZ_TRANSPORT_VER}::core - gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}) + gz-sim::gz-sim) diff --git a/examples/standalone/lrauv_control/CMakeLists.txt b/examples/standalone/lrauv_control/CMakeLists.txt index 937b550657..e0116a318c 100644 --- a/examples/standalone/lrauv_control/CMakeLists.txt +++ b/examples/standalone/lrauv_control/CMakeLists.txt @@ -5,10 +5,9 @@ project(gz-sim-lrauv-control) find_package(gz-transport14 QUIET REQUIRED OPTIONAL_COMPONENTS log) set(GZ_TRANSPORT_VER ${gz-transport14_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +find_package(gz-sim REQUIRED) add_executable(lrauv_control lrauv_control.cc) target_link_libraries(lrauv_control gz-transport${GZ_TRANSPORT_VER}::core - gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}) + gz-sim::gz-sim) diff --git a/examples/standalone/multi_lrauv_race/CMakeLists.txt b/examples/standalone/multi_lrauv_race/CMakeLists.txt index 4f060705ba..c37eecc940 100644 --- a/examples/standalone/multi_lrauv_race/CMakeLists.txt +++ b/examples/standalone/multi_lrauv_race/CMakeLists.txt @@ -5,10 +5,9 @@ project(gz-sim-multi-lrauv-race) find_package(gz-transport14 QUIET REQUIRED OPTIONAL_COMPONENTS log) set(GZ_TRANSPORT_VER ${gz-transport14_VERSION_MAJOR}) -find_package(gz-sim10 REQUIRED) -set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR}) +find_package(gz-sim REQUIRED) add_executable(multi_lrauv_race multi_lrauv_race.cc) target_link_libraries(multi_lrauv_race gz-transport${GZ_TRANSPORT_VER}::core - gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}) + gz-sim::gz-sim) diff --git a/package.xml b/package.xml index 6d6bfa8ddb..af725902d5 100644 --- a/package.xml +++ b/package.xml @@ -1,7 +1,7 @@ - gz-sim10 + gz-sim 10.0.0 Gazebo Sim : A Robotic Simulator Michael Carroll diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d4a5589b19..d8fd7ede7d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -182,8 +182,8 @@ target_link_libraries(${gz_lib_target} PUBLIC ${PROJECT_LIBRARY_TARGET_NAME} gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER} - gz-sim${PROJECT_VERSION_MAJOR} - gz-sim${PROJECT_VERSION_MAJOR}-gui + gz-sim + gz-sim-gui ) # Executable target that runs the GUI without ruby for debugging purposes. @@ -253,7 +253,7 @@ gz_build_tests(TYPE UNIT LIB_DEPS ${PROJECT_LIBRARY_TARGET_NAME} ${EXTRA_TEST_LIB_DEPS} - gz-sim${PROJECT_VERSION_MAJOR} + gz-sim ENVIRONMENT GZ_SIM_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 472eba232d..0c2fb61292 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -72,7 +72,7 @@ gz_build_tests(TYPE UNIT ${PROJECT_LIBRARY_TARGET_NAME} ${gui_target} ${EXTRA_TEST_LIB_DEPS} - gz-sim${PROJECT_VERSION_MAJOR} + gz-sim gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER} gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER} ENVIRONMENT diff --git a/src/gui/plugins/CMakeLists.txt b/src/gui/plugins/CMakeLists.txt index 837f929c7a..6560e8ff92 100644 --- a/src/gui/plugins/CMakeLists.txt +++ b/src/gui/plugins/CMakeLists.txt @@ -47,7 +47,7 @@ function(gz_add_gui_library library_name) TINYXML2::TINYXML2 ${gz_add_gui_library_PUBLIC_LINK_LIBS} PRIVATE - gz-sim${PROJECT_VERSION_MAJOR}-gui + gz-sim-gui ${gz_add_gui_library_PRIVATE_LINK_LIBS} ) endfunction() @@ -110,7 +110,7 @@ function(gz_add_gui_plugin plugin_name) SOURCES ${gz_add_gui_plugin_TEST_SOURCES} LIB_DEPS - gz-sim${PROJECT_VERSION_MAJOR}-gui + gz-sim-gui ${plugin_name} INCLUDE_DIRS # Used to make internal source file headers visible to the unit tests diff --git a/src/systems/camera_video_recorder/CMakeLists.txt b/src/systems/camera_video_recorder/CMakeLists.txt index a8e19ebc59..7eaaf91e03 100644 --- a/src/systems/camera_video_recorder/CMakeLists.txt +++ b/src/systems/camera_video_recorder/CMakeLists.txt @@ -4,5 +4,5 @@ gz_add_system(camera-video-recorder PUBLIC_LINK_LIBS gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER} gz-rendering${GZ_RENDERING_VER}::gz-rendering${GZ_RENDERING_VER} - gz-sim${PROJECT_VERSION_MAJOR}-rendering + gz-sim-rendering ) diff --git a/src/systems/lens_flare/CMakeLists.txt b/src/systems/lens_flare/CMakeLists.txt index 5c64a4cf83..7e3f6b71be 100644 --- a/src/systems/lens_flare/CMakeLists.txt +++ b/src/systems/lens_flare/CMakeLists.txt @@ -4,5 +4,5 @@ gz_add_system(lens-flare PUBLIC_LINK_LIBS gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER} gz-rendering${GZ_RENDERING_VER}::gz-rendering${GZ_RENDERING_VER} - gz-sim${PROJECT_VERSION_MAJOR}-rendering + gz-sim-rendering ) diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index b43c3cba4f..2fb8f69cac 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -53,8 +53,8 @@ add_executable( target_link_libraries( PERFORMANCE_${exec} gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER} - gz-sim${PROJECT_VERSION_MAJOR} - gz-sim${PROJECT_VERSION_MAJOR}-gui + gz-sim + gz-sim-gui ) if(VALID_DISPLAY AND VALID_DRI_DISPLAY AND TARGET PERFORMANCE_sensors_system) diff --git a/test/plugins/CMakeLists.txt b/test/plugins/CMakeLists.txt index f2cbb55595..b8e8888412 100644 --- a/test/plugins/CMakeLists.txt +++ b/test/plugins/CMakeLists.txt @@ -36,7 +36,7 @@ if(BUILD_TESTING) PRIVATE gz-plugin${GZ_PLUGIN_VER}::register gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER} - gz-sim${PROJECT_VERSION_MAJOR} + gz-sim ) if (MSVC) diff --git a/tutorials/create_system_plugins.md b/tutorials/create_system_plugins.md index 411e42ca20..fd01a79dca 100644 --- a/tutorials/create_system_plugins.md +++ b/tutorials/create_system_plugins.md @@ -93,7 +93,7 @@ add_library(SampleSystem SHARED SampleSystem.cc SampleSystem2.cc) set_property(TARGET SampleSystem PROPERTY CXX_STANDARD 17) target_link_libraries(SampleSystem PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} - PRIVATE gz-sim10::gz-sim10) + PRIVATE gz-sim::gz-sim) ``` ## Loading your plugin diff --git a/tutorials/migrating_ardupilot_plugin.md b/tutorials/migrating_ardupilot_plugin.md index 8341077ed2..6f7306073f 100644 --- a/tutorials/migrating_ardupilot_plugin.md +++ b/tutorials/migrating_ardupilot_plugin.md @@ -729,7 +729,7 @@ In the new code we explicitly reference each Gazebo package that we use: # NEW find_package(sdformat15 REQUIRED) find_package(gz-common6-all REQUIRED) -find_package(gz-sim10-all REQUIRED) +find_package(gz-sim-all REQUIRED) find_package(gz-math8-all REQUIRED) find_package(gz-msgs11-all REQUIRED) find_package(gz-physics8-all REQUIRED) From 40320529d906790379709835e5df8f44fce31c53 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 22 Jan 2025 14:15:10 -0800 Subject: [PATCH 2/5] Remove major version from python module Update tests and examples to import gz.sim Signed-off-by: Steve Peters --- examples/scripts/python_api/systems/test_system.py | 2 +- examples/scripts/python_api/testFixture.py | 2 +- python/CMakeLists.txt | 2 +- python/test/actor_TEST.py | 4 ++-- python/test/gz_test_deps/sim.py | 1 - python/test/joint_TEST.py | 4 ++-- python/test/light_TEST.py | 4 ++-- python/test/link_TEST.py | 2 +- python/test/model_TEST.py | 2 +- python/test/plugins/test_model_system.py | 2 +- python/test/sensor_TEST.py | 4 ++-- python/test/testFixture_TEST.py | 2 +- python/test/world_TEST.py | 2 +- tutorials/python_interfaces.md | 2 +- 14 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 python/test/gz_test_deps/sim.py diff --git a/examples/scripts/python_api/systems/test_system.py b/examples/scripts/python_api/systems/test_system.py index 1b227d68fc..7a7f033397 100644 --- a/examples/scripts/python_api/systems/test_system.py +++ b/examples/scripts/python_api/systems/test_system.py @@ -13,7 +13,7 @@ # limitations under the License. from gz.math8 import Vector3d -from gz.sim10 import Model, Link +from gz.sim import Model, Link import random diff --git a/examples/scripts/python_api/testFixture.py b/examples/scripts/python_api/testFixture.py index 65736cf80a..33146f7b9a 100755 --- a/examples/scripts/python_api/testFixture.py +++ b/examples/scripts/python_api/testFixture.py @@ -25,7 +25,7 @@ import os from gz.common6 import set_verbosity -from gz.sim10 import TestFixture, World, world_entity +from gz.sim import TestFixture, World, world_entity from gz.math8 import Vector3d set_verbosity(4) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index f7228de0a1..1f7c9e3fe9 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -25,7 +25,7 @@ function(configure_build_install_location _library_name) ) endfunction() -set(BINDINGS_MODULE_NAME "sim${PROJECT_VERSION_MAJOR}") +set(BINDINGS_MODULE_NAME "sim") pybind11_add_module(${BINDINGS_MODULE_NAME} MODULE src/gz/sim/_gz_sim_pybind11.cc src/gz/sim/Actor.cc diff --git a/python/test/actor_TEST.py b/python/test/actor_TEST.py index 8a8f76f1d8..9e375ed9be 100755 --- a/python/test/actor_TEST.py +++ b/python/test/actor_TEST.py @@ -18,8 +18,8 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import (Actor, K_NULL_ENTITY, - TestFixture, World, world_entity) +from gz.sim import (Actor, K_NULL_ENTITY, + TestFixture, World, world_entity) from gz_test_deps.math import Pose3d diff --git a/python/test/gz_test_deps/sim.py b/python/test/gz_test_deps/sim.py deleted file mode 100644 index 0d89f74ed5..0000000000 --- a/python/test/gz_test_deps/sim.py +++ /dev/null @@ -1 +0,0 @@ -from gz.sim10 import * diff --git a/python/test/joint_TEST.py b/python/test/joint_TEST.py index 5b01515615..6967f66cdc 100755 --- a/python/test/joint_TEST.py +++ b/python/test/joint_TEST.py @@ -17,8 +17,8 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import (K_NULL_ENTITY, TestFixture, - Joint, Model, World, world_entity) +from gz.sim import (K_NULL_ENTITY, TestFixture, + Joint, Model, World, world_entity) from gz_test_deps.math import Pose3d from gz_test_deps.sdformat import JointAxis, JointType diff --git a/python/test/light_TEST.py b/python/test/light_TEST.py index ec1c4f6493..77928265b7 100755 --- a/python/test/light_TEST.py +++ b/python/test/light_TEST.py @@ -17,8 +17,8 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import (K_NULL_ENTITY, Light, - TestFixture, World, world_entity) +from gz.sim import (K_NULL_ENTITY, Light, + TestFixture, World, world_entity) from gz_test_deps.math import Angle, Color, Pose3d, Vector3d diff --git a/python/test/link_TEST.py b/python/test/link_TEST.py index 4d6be57631..aed56dbf18 100755 --- a/python/test/link_TEST.py +++ b/python/test/link_TEST.py @@ -17,7 +17,7 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import K_NULL_ENTITY, TestFixture, Link, Model, World, world_entity +from gz.sim import K_NULL_ENTITY, TestFixture, Link, Model, World, world_entity from gz_test_deps.math import Inertiald, Matrix3d, Vector3d, Pose3d class TestModel(unittest.TestCase): diff --git a/python/test/model_TEST.py b/python/test/model_TEST.py index 5a450c7848..af15c39145 100755 --- a/python/test/model_TEST.py +++ b/python/test/model_TEST.py @@ -17,7 +17,7 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import K_NULL_ENTITY, TestFixture, Model, World, world_entity +from gz.sim import K_NULL_ENTITY, TestFixture, Model, World, world_entity class TestModel(unittest.TestCase): post_iterations = 0 diff --git a/python/test/plugins/test_model_system.py b/python/test/plugins/test_model_system.py index d390022537..2ae307887d 100644 --- a/python/test/plugins/test_model_system.py +++ b/python/test/plugins/test_model_system.py @@ -19,7 +19,7 @@ # Add "../__file__" to sys.path to get gz_test_deps sys.path.append(dirname(dirname(realpath(__file__)))) -from gz_test_deps.sim import Model +from gz.sim import Model from gz_test_deps.transport import Node from gz_test_deps.msgs.pose_pb2 import Pose from gz_test_deps.msgs.clock_pb2 import Clock diff --git a/python/test/sensor_TEST.py b/python/test/sensor_TEST.py index 61068c3fa3..32354450d6 100755 --- a/python/test/sensor_TEST.py +++ b/python/test/sensor_TEST.py @@ -17,8 +17,8 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import (K_NULL_ENTITY, TestFixture, - Joint, Model, Sensor, World, world_entity) +from gz.sim import (K_NULL_ENTITY, TestFixture, + Joint, Model, Sensor, World, world_entity) from gz_test_deps.math import Pose3d diff --git a/python/test/testFixture_TEST.py b/python/test/testFixture_TEST.py index 18f549bb6f..934b58b2b6 100755 --- a/python/test/testFixture_TEST.py +++ b/python/test/testFixture_TEST.py @@ -17,7 +17,7 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import TestFixture, World, world_entity +from gz.sim import TestFixture, World, world_entity from gz_test_deps.math import Vector3d post_iterations = 0 diff --git a/python/test/world_TEST.py b/python/test/world_TEST.py index d44d80b9f8..f0ddba9c1b 100755 --- a/python/test/world_TEST.py +++ b/python/test/world_TEST.py @@ -17,7 +17,7 @@ import unittest from gz_test_deps.common import set_verbosity -from gz_test_deps.sim import K_NULL_ENTITY, TestFixture, World, world_entity +from gz.sim import K_NULL_ENTITY, TestFixture, World, world_entity from gz_test_deps.math import SphericalCoordinates, Vector3d from gz_test_deps.sdformat import Atmosphere diff --git a/tutorials/python_interfaces.md b/tutorials/python_interfaces.md index c92e241804..8f809a0b6b 100644 --- a/tutorials/python_interfaces.md +++ b/tutorials/python_interfaces.md @@ -97,7 +97,7 @@ Example python system: ```python from gz.math8 import Vector3d -from gz.sim10 import Model, Link +from gz.sim import Model, Link import random From 81c364c6921fdcf57fa031a0bf46b921bab29a1b Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 22 Jan 2025 17:59:35 -0800 Subject: [PATCH 3/5] Don't install unversioned symlinks of plugins Signed-off-by: Steve Peters --- src/systems/CMakeLists.txt | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/systems/CMakeLists.txt b/src/systems/CMakeLists.txt index 1ec6aa8d7e..1cdc1b3cf5 100644 --- a/src/systems/CMakeLists.txt +++ b/src/systems/CMakeLists.txt @@ -73,25 +73,6 @@ function(gz_add_system system_name) # Note that plugins are currently being installed in 2 places. /lib and the plugin dir install(TARGETS ${system_target} DESTINATION ${GZ_SIM_PLUGIN_RELATIVE_INSTALL_DIR}) - - # The library created by `gz_add_component` includes the gz-sim version - # (i.e. libgz-sim1-name-system.so), but for portability of SDF - # files, we also install an unversioned symlink into the same versioned folder. - # - # NOTE(CH3): On migration of the CMake project name, ignition-gazebo -> gz-sim - # so the generated library target WILL CHANGE - 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) - # symlinks on Windows require admin priviledges, fallback to copy - INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy - ${GZ_SIM_PLUGIN_INSTALL_DIR}\/${versioned} - ${GZ_SIM_PLUGIN_INSTALL_DIR}\/${unversioned})") - else() - file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/lib") - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned} WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/lib") - INSTALL(FILES ${PROJECT_BINARY_DIR}/lib/${unversioned} DESTINATION ${GZ_SIM_PLUGIN_RELATIVE_INSTALL_DIR}) - endif() endfunction() add_subdirectory(ackermann_steering) From 55294063630d2446fd014eb21eba137f43609cd3 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 22 Jan 2025 21:31:19 -0800 Subject: [PATCH 4/5] PythonSystemLoader: fix import statement Signed-off-by: Steve Peters --- src/systems/python_system_loader/PythonSystemLoader.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/systems/python_system_loader/PythonSystemLoader.cc b/src/systems/python_system_loader/PythonSystemLoader.cc index d9dcdb0547..e61be0124e 100644 --- a/src/systems/python_system_loader/PythonSystemLoader.cc +++ b/src/systems/python_system_loader/PythonSystemLoader.cc @@ -64,8 +64,7 @@ void PythonSystemLoader::Configure( // Load the `gz.sim` and sdformat modules to register all pybind bindings // necessary for System interface functions - const auto gzSimModule = - std::string("gz.sim") + std::to_string(GZ_SIM_MAJOR_VERSION); + const std::string gzSimModule = "gz.sim"; const auto sdformatModule = std::string("sdformat") + std::to_string(SDF_MAJOR_VERSION); py::module_ sysModule; From 9cfe82945517ec6f50387861f3b84921e5e7bd7a Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 22 Jan 2025 21:32:10 -0800 Subject: [PATCH 5/5] Remove major version from plugin name references Signed-off-by: Steve Peters --- src/ServerPrivate.cc | 4 +--- src/SystemLoader_TEST.cc | 11 ++++------- test/test_config.hh.in | 8 +++----- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/ServerPrivate.cc b/src/ServerPrivate.cc index 83b97363e6..a5edc23f40 100644 --- a/src/ServerPrivate.cc +++ b/src/ServerPrivate.cc @@ -47,9 +47,7 @@ struct LoggingPlugin /// \return A string that contains the record plugin file name. public: static std::string &LoggingPluginFileName() { - static std::string recordPluginFileName = - std::string("gz-sim") + - GZ_SIM_MAJOR_VERSION_STR + "-log-system"; + static std::string recordPluginFileName = "gz-sim-log-system"; return recordPluginFileName; } diff --git a/src/SystemLoader_TEST.cc b/src/SystemLoader_TEST.cc index 6550e2b233..189dab3286 100644 --- a/src/SystemLoader_TEST.cc +++ b/src/SystemLoader_TEST.cc @@ -44,11 +44,9 @@ TEST(SystemLoader, Constructor) sdf::Root root; root.LoadSdfString(std::string("" "") + - "" - "" "" @@ -198,10 +196,9 @@ TEST(SystemLoader, BadPluginName) sdf::Root root; root.LoadSdfString(std::string("" "" - "" - ""); + "")); auto worldElem = root.WorldByIndex(0)->Element(); if (worldElem->HasElement("plugin")) { diff --git a/test/test_config.hh.in b/test/test_config.hh.in index 89118966c9..9c04235e98 100644 --- a/test/test_config.hh.in +++ b/test/test_config.hh.in @@ -51,17 +51,15 @@ struct TestWorldSansPhysics "" " false" "" - "" "" "" "" "" - ""; + ""); return world; } };