Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
39573e7
Standalone gz sim executable (Jetty)
j-rivero Apr 10, 2025
39296e8
Use non-versioned lib names
j-rivero Apr 10, 2025
31bd100
Need to rename gz-sim-gui to gz-sim-gui-client not to conflict with t…
j-rivero Apr 10, 2025
d138d69
Merge branch 'main' into jetty/standalone_execs
j-rivero Apr 15, 2025
a970eeb
Merge branch 'main' into jetty/standalone_execs
j-rivero Apr 17, 2025
f8e74af
Merge branch 'main' into jetty/standalone_execs
j-rivero Apr 21, 2025
43c179a
Make pre-commit happy
j-rivero Apr 24, 2025
b8b022f
Relocate the gui linking
j-rivero Apr 24, 2025
85ff7f3
Merge branch 'main' into jetty/standalone_execs
j-rivero May 5, 2025
3a7fd00
Merge branch 'main' into jetty/standalone_execs
j-rivero May 6, 2025
52d66cc
Run gui_system test only under ENABLE_GUI installations
j-rivero May 6, 2025
465f8e8
Fix UNIT_gz_TEST
j-rivero May 6, 2025
c1016e8
Do not run pre-commit again
j-rivero May 7, 2025
94bffb9
Explicit use of Unicode CreateProcess
j-rivero May 7, 2025
0948663
Right setup for UNIT_gz_TEST on Windows
May 7, 2025
f937aaa
Reduce and fix testSystem plugin
j-rivero May 7, 2025
13a7d46
Remove plugin ALIAS
j-rivero May 7, 2025
fb73007
Fix path test on Windows
j-rivero May 13, 2025
80f7e9a
Apply suggestions from code review
j-rivero May 14, 2025
dc577fb
Merge branch 'main' into jetty/standalone_execs
j-rivero May 14, 2025
c5c40b4
Fail if file is empty
j-rivero May 14, 2025
9dd80aa
Allow output variable to be empty in parseSdfile
j-rivero May 14, 2025
cef74ed
Return -1 on error
j-rivero May 14, 2025
94db746
Add error code return to createServerConfig
j-rivero May 14, 2025
f8d454e
Rework the sdf checking and parsing
j-rivero May 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,18 @@ jobs:
# per bug https://github.com/gazebosim/gz-sim/issues/1409
cmake-args: '-DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOCS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo'
apt-dependencies: libdwarf-dev libdw-dev binutils-dev

noble-ci-disable-gui:
runs-on: ubuntu-latest
name: Ubuntu Noble CI (GUI disabled)
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@noble
with:
# per bug https://github.com/gazebosim/gz-sim/issues/1409
cmake-args: '-DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOCS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_GUI=OFF'
apt-dependencies: libdwarf-dev libdw-dev binutils-dev
44 changes: 23 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,29 +110,31 @@ set(GZ_COMMON_VER ${gz-common6_VERSION_MAJOR})
gz_find_package(gz-fuel_tools10 REQUIRED)
set(GZ_FUEL_TOOLS_VER ${gz-fuel_tools10_VERSION_MAJOR})

#--------------------------------------
# Find gz-gui
gz_find_package(gz-gui REQUIRED)

set(QT_MAJOR_VERSION 6)
set(QT_MINOR_VERSION 4)
gz_find_package (Qt${QT_MAJOR_VERSION}
VERSION ${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}
COMPONENTS
Core
Quick
QuickControls2
REQUIRED
PKGCONFIG "Qt${QT_MAJOR_VERSION}Core Qt${QT_MAJOR_VERSION}Quick Qt${QT_MAJOR_VERSION}QuickControls2")

set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
if(POLICY CMP0100)
cmake_policy(SET CMP0100 NEW)
# Option to build gz-sim with GUI support
option(ENABLE_GUI "Build gz-sim with GUI enabled" ON)

if(ENABLE_GUI)
gz_find_package(gz-gui REQUIRED)

set(QT_MAJOR_VERSION 6)
set(QT_MINOR_VERSION 4)
gz_find_package (Qt${QT_MAJOR_VERSION}
VERSION ${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}
COMPONENTS
Core
Quick
QuickControls2
REQUIRED
PKGCONFIG "Qt${QT_MAJOR_VERSION}Core Qt${QT_MAJOR_VERSION}Quick Qt${QT_MAJOR_VERSION}QuickControls2")

set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
if(POLICY CMP0100)
cmake_policy(SET CMP0100 NEW)
endif()
endif()


#--------------------------------------
# Find gz-physics
gz_find_package(gz-physics8
Expand Down
32 changes: 18 additions & 14 deletions examples/plugin/gui_system_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)

if(POLICY CMP0100)
cmake_policy(SET CMP0100 NEW)
endif()
if(ENABLE_GUI)

if(POLICY CMP0100)
cmake_policy(SET CMP0100 NEW)
endif()

project(GuiSystemPlugin)
project(GuiSystemPlugin)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOMOC ON)

find_package(gz-sim REQUIRED COMPONENTS gui)
find_package(gz-sim REQUIRED COMPONENTS gui)

QT_ADD_RESOURCES(resources_RCC ${PROJECT_NAME}.qrc)
QT_ADD_RESOURCES(resources_RCC ${PROJECT_NAME}.qrc)

add_library(${PROJECT_NAME} SHARED
${PROJECT_NAME}.cc
${resources_RCC}
)
target_link_libraries(${PROJECT_NAME}
PRIVATE gz-sim::gui
)
add_library(${PROJECT_NAME} SHARED
${PROJECT_NAME}.cc
${resources_RCC}
)
target_link_libraries(${PROJECT_NAME}
PRIVATE gz-sim::gui
)

endif()
6 changes: 5 additions & 1 deletion include/gz/sim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
gz_install_all_headers()
if(ENABLE_GUI)
gz_install_all_headers()
else()
gz_install_all_headers(EXCLUDE_DIRS gui)
endif()

add_subdirectory(components)

Expand Down
48 changes: 20 additions & 28 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
add_subdirectory(rendering)
add_subdirectory(gui)

if(ENABLE_GUI)
add_subdirectory(gui)
add_compile_definitions(WITH_GUI)
endif()

add_subdirectory(systems)

file(GLOB gz_msgs_proto_files
Expand Down Expand Up @@ -50,14 +55,12 @@ set(comms_sources
comms/MsgManager.cc
)

set(gui_sources
${gui_sources}
PARENT_SCOPE
)

set(cli_sources
gz.cc
)
if(ENABLE_GUI)
set(gui_sources
${gui_sources}
PARENT_SCOPE
)
endif()

set(material_sources
rendering/MaterialParser/MaterialParser.cc
Expand Down Expand Up @@ -158,26 +161,9 @@ if (MSVC)
# 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} ${cli_sources} COMPILE_FLAGS "/wd4251 /wd4146")
set_source_files_properties(${sources} ${gtest_sources} COMPILE_FLAGS "/wd4251 /wd4146")
endif()

# CLI
gz_add_component(gz
SOURCES
${cli_sources}
GET_TARGET_NAME gz_lib_target)
target_link_libraries(${gz_lib_target}
PUBLIC
${PROJECT_LIBRARY_TARGET_NAME}
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-sim
gz-sim-gui
)

# Executable target that runs the GUI without ruby for debugging purposes.
add_executable(runGui cmd/runGui_main.cc)
target_link_libraries(runGui PRIVATE ${gz_lib_target})

# Create the library target
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
gz_add_get_install_prefix_impl(GET_INSTALL_PREFIX_FUNCTION gz::sim::getInstallPrefix
Expand Down Expand Up @@ -205,7 +191,6 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
gz-common${GZ_COMMON_VER}::graphics
gz-common${GZ_COMMON_VER}::profiler
gz-fuel_tools${GZ_FUEL_TOOLS_VER}::gz-fuel_tools${GZ_FUEL_TOOLS_VER}
gz-gui::gz-gui
gz-physics${GZ_PHYSICS_VER}::core
gz-rendering${GZ_RENDERING_VER}::core
gz-transport::gz-transport
Expand All @@ -216,6 +201,13 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
gz-plugin${GZ_PLUGIN_VER}::loader
)

if(ENABLE_GUI)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-gui::gz-gui
)
endif()

if (pybind11_FOUND)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE pybind11::embed)
target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC -DHAVE_PYBIND11)
Expand Down
6 changes: 4 additions & 2 deletions src/SystemLoader_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ using namespace sim;
#else
constexpr const char *kPluginDir = "lib";
#endif

/////////////////////////////////////////////////
TEST(SystemLoader, Constructor)
{
Expand Down Expand Up @@ -78,6 +79,7 @@ TEST(SystemLoader, FromPluginPathEnv)
</world>
</sdf>)");

// EXPECTED TO FAIL
ASSERT_NE(root.WorldCount(), 0u);
auto world = root.WorldByIndex(0);
ASSERT_TRUE(world != nullptr);
Expand All @@ -90,8 +92,8 @@ TEST(SystemLoader, FromPluginPathEnv)
EXPECT_FALSE(system.has_value());
}

const auto libPath = common::joinPaths(PROJECT_BINARY_PATH, kPluginDir);

// Add test plugin to path (referenced in config)
auto libPath = std::string(CMAKE_LIBRARY_OUTPUT_DIRECTORY);
{
common::setenv("GZ_SIM_SYSTEM_PLUGIN_PATH", libPath.c_str());

Expand Down
Loading