Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
libgz-cmake4-dev
libgz-math8-dev
libgz-cmake5-dev
libgz-math9-dev
libgz-tools2-dev
libgz-utils3-dev
libgz-utils3-cli-dev
libgz-utils4-dev
libgz-utils4-cli-dev
libtinyxml2-dev
liburdfdom-dev
libxml2-utils
python3-dev
python3-gz-math8
python3-gz-math9
python3-psutil
python3-pybind11
python3-pytest
12 changes: 1 addition & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ on:
- 'main'

jobs:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
with:
codecov-enabled: true
noble-ci:
runs-on: ubuntu-latest
name: Ubuntu Noble CI
Expand All @@ -29,6 +18,7 @@ jobs:
id: ci
uses: gazebo-tooling/action-gz-ci@noble
with:
# codecov-enabled: true
cppcheck-enabled: true
cpplint-enabled: true
doxygen-enabled: true
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0004 NEW)
endif(COMMAND CMAKE_POLICY)

project (sdformat16 VERSION 16.0.0)
project (sdformat VERSION 16.0.0)

# The protocol version has nothing to do with the package version.
# It represents the current version of SDFormat implemented by the software
Expand All @@ -18,8 +18,7 @@ set (BUILD_SDF ON CACHE INTERNAL "Build SDF" FORCE)

#################################################
# Find gz-cmake
find_package(gz-cmake4 REQUIRED)
set(GZ_CMAKE_VER ${gz-cmake4_VERSION_MAJOR})
find_package(gz-cmake REQUIRED)

########################################
option(SKIP_PYBIND11
Expand Down Expand Up @@ -128,13 +127,11 @@ if (BUILD_SDF)
########################################
# Find gz math
# Set a variable for generating ProjectConfig.cmake
gz_find_package(gz-math8 VERSION REQUIRED)
set(GZ_MATH_VER ${gz-math8_VERSION_MAJOR})
gz_find_package(gz-math VERSION REQUIRED)

########################################
# Find gz utils
gz_find_package(gz-utils3 REQUIRED COMPONENTS cli)
set(GZ_UTILS_VER ${gz-utils3_VERSION_MAJOR})
gz_find_package(gz-utils REQUIRED COMPONENTS cli)

gz_configure_build(QUIT_IF_BUILD_ERRORS)

Expand Down
8 changes: 4 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ bazel_dep(name = "gz-math")

archive_override(
module_name = "gz-utils",
strip_prefix = "gz-utils-gz-utils3",
urls = ["https://github.com/gazebosim/gz-utils/archive/refs/heads/gz-utils3.tar.gz"],
strip_prefix = "gz-utils-main",
urls = ["https://github.com/gazebosim/gz-utils/archive/refs/heads/main.tar.gz"],
)

archive_override(
module_name = "gz-math",
strip_prefix = "gz-math-gz-math8",
urls = ["https://github.com/gazebosim/gz-math/archive/refs/heads/gz-math8.tar.gz"],
strip_prefix = "gz-math-main",
urls = ["https://github.com/gazebosim/gz-math/archive/refs/heads/main.tar.gz"],
)
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)

find_package(sdformat16 REQUIRED)
find_package(sdformat REQUIRED)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

Expand Down
8 changes: 4 additions & 4 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<package format="2">
<name>sdformat16</name>
<name>sdformat</name>
<version>16.0.0</version>
<description>SDFormat is an XML file format that describes environments, objects, and robots
in a manner suitable for robotic applications</description>
Expand All @@ -13,9 +13,9 @@ in a manner suitable for robotic applications</description>
<url type="website">https://github.com/gazebosim/sdformat</url>

<buildtool_depend>cmake</buildtool_depend>
<build_depend>gz-cmake4</build_depend>
<depend>gz-math8</depend>
<depend>gz-utils3</depend>
<build_depend>gz-cmake</build_depend>
<depend>gz-math</depend>
<depend>gz-utils</depend>
<depend>tinyxml2</depend>
<depend>liburdfdom-dev</depend>
<depend>pybind11-dev</depend>
Expand Down
24 changes: 12 additions & 12 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Detect if we are doing a standalone build of the bindings, using an external sdformat
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.22.1)
find_package(gz-cmake4 4.1.0 REQUIRED)
find_package(gz-cmake REQUIRED)
gz_get_package_xml_version(${CMAKE_SOURCE_DIR}/../package.xml PACKAGE_XML)
project(sdformat${PACKAGE_XML_VERSION_MAJOR}-python VERSION ${PACKAGE_XML_VERSION})
find_package(sdformat${PROJECT_VERSION_MAJOR} REQUIRED)
set(PROJECT_LIBRARY_TARGET_NAME "sdformat${PROJECT_VERSION_MAJOR}::sdformat${PROJECT_VERSION_MAJOR}")
project(sdformat-python VERSION ${PACKAGE_XML_VERSION})
find_package(sdformat REQUIRED)
set(PROJECT_LIBRARY_TARGET_NAME "sdformat::sdformat")
# require python dependencies to be found
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(CMAKE_REQUIRE_FIND_PACKAGE_pybind11 TRUE)
Expand Down Expand Up @@ -54,9 +54,9 @@ function(configure_build_install_location _library_name)
)
endfunction()

# sdformatX target already exists, use pysdformatX + OUTPUT_NAME to get
# sdformatX file name generated and map BINDINGS_MODULE_NAME to sdformatX
set(BINDINGS_MODULE_NAME "pysdformat${PROJECT_VERSION_MAJOR}")
# sdformat target already exists, use pysdformat + OUTPUT_NAME to get
# sdformat file name generated and map BINDINGS_MODULE_NAME to sdformat
set(BINDINGS_MODULE_NAME "pysdformat")
pybind11_add_module(${BINDINGS_MODULE_NAME} MODULE
src/sdf/_gz_sdformat_pybind11.cc
src/sdf/pyAirPressure.cc
Expand Down Expand Up @@ -117,18 +117,18 @@ target_link_libraries(${BINDINGS_MODULE_NAME} PRIVATE
)

# different from the target name since the target name was not able to use
# sdformatX since it conflicts with the project name
# sdformat since it conflicts with the project name
target_compile_definitions(${BINDINGS_MODULE_NAME} PRIVATE
BINDINGS_MODULE_NAME=sdformat${PROJECT_VERSION_MAJOR})
BINDINGS_MODULE_NAME=sdformat)

set_target_properties(${BINDINGS_MODULE_NAME} PROPERTIES
OUTPUT_NAME "sdformat${PROJECT_VERSION_MAJOR}")
OUTPUT_NAME "sdformat")
# Deal with naming collision on Windows. It is caused by the both the import
# library of sdformat library and the import library of the pybind11 bindings
# library are called sdformat13.lib.
# library are called sdformat.lib.
# See https://github.com/gazebosim/sdformat/issues/1150
set_target_properties(${BINDINGS_MODULE_NAME} PROPERTIES
ARCHIVE_OUTPUT_NAME "python_sdformat${PROJECT_VERSION_MAJOR}")
ARCHIVE_OUTPUT_NAME "python_sdformat")

configure_build_install_location(${BINDINGS_MODULE_NAME})

Expand Down
3 changes: 1 addition & 2 deletions python/src/sdf/_gz_sdformat_pybind11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) {

// Import the gz.math library to automatically add the type conversions
// this module requires to pass mathematical types to python code.
std::string gzMathModule =
std::string("gz.math") + std::to_string(GZ_MATH_MAJOR_VERSION);
std::string gzMathModule = std::string("gz.math");
pybind11::module::import(gzMathModule.c_str());

sdf::python::defineAirPressure(m);
Expand Down
4 changes: 2 additions & 2 deletions python/test/gz_test_deps/README
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ bindings such that the version number only has to be changed in this package.
Here's an example of how to use this in a python test:

```python
from gz_test_deps import math # instead of from gz import math8
from gz_test_deps.math import Vector3d # instead of from gz.math8 import Vector3d
from gz_test_deps import math # instead of from gz import math
from gz_test_deps.math import Vector3d # instead of from gz.math import Vector3d
```
2 changes: 1 addition & 1 deletion python/test/gz_test_deps/math.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from gz.math8 import *
from gz.math import *
2 changes: 1 addition & 1 deletion python/test/gz_test_deps/sdformat.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from sdformat16 import *
from sdformat import *
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ set_property(

target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
gz-math::gz-math
gz-utils::gz-utils
PRIVATE
TINYXML2::TINYXML2)

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(sdf_executable gz-sdformat-sdf)
add_executable(${sdf_executable} sdf_main.cc gz.cc ../FrameSemantics.cc)
target_link_libraries(${sdf_executable}
gz-utils${GZ_UTILS_VER}::cli
gz-utils::cli
${PROJECT_LIBRARY_TARGET_NAME}
TINYXML2::TINYXML2
)
Expand All @@ -21,7 +21,7 @@ if(BUILD_TESTING AND GZ_PROGRAM)
TEST_LIST
test_list
LIB_DEPS
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
gz-utils::gz-utils
${EXTRA_TEST_LIB_DEPS}
ENVIRONMENT
SDF_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
Expand Down
Loading