Skip to content

Commit

Permalink
Merge branch 'ign-math6' into cmake_python3_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters committed May 9, 2023
2 parents 6b4ee27 + d0b6179 commit 2b82268
Show file tree
Hide file tree
Showing 11 changed files with 318 additions and 245 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Ubuntu Bionic CI
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@bionic
Expand All @@ -20,7 +20,7 @@ jobs:
name: Ubuntu Focal CI
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
Expand All @@ -29,7 +29,7 @@ jobs:
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@jammy
110 changes: 66 additions & 44 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-math6 VERSION 6.13.0)
project(ignition-math6 VERSION 6.14.0)

#============================================================================
# Find ignition-cmake
Expand All @@ -25,17 +25,31 @@ ign_configure_project(
# Set project-specific options
#============================================================================

option(USE_SYSTEM_PATHS_FOR_RUBY_INSTALLATION
"Install ruby modules in standard system paths in the system"
option(SKIP_SWIG
"Skip generating ruby bindings via Swig"
OFF)

option(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION
set(skip_pybind11_default_value OFF)
if (MSVC)
set(skip_pybind11_default_value ON)
endif()

option(SKIP_PYBIND11
"Skip generating Python bindings via pybind11"
${skip_pybind11_default_value})

include(CMakeDependentOption)
cmake_dependent_option(USE_SYSTEM_PATHS_FOR_RUBY_INSTALLATION
"Install ruby modules in standard system paths in the system"
OFF "NOT SKIP_SWIG" OFF)

cmake_dependent_option(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION
"Install python modules in standard system paths in the system"
OFF)
OFF "NOT SKIP_PYBIND11" OFF)

option(USE_DIST_PACKAGES_FOR_PYTHON
cmake_dependent_option(USE_DIST_PACKAGES_FOR_PYTHON
"Use dist-packages instead of site-package to install python modules"
OFF)
OFF "NOT SKIP_PYBIND11" OFF)

#============================================================================
# Search for project-specific dependencies
Expand All @@ -51,54 +65,62 @@ ign_find_package(

########################################
# Include swig
find_package(SWIG QUIET)
if (NOT SWIG_FOUND)
IGN_BUILD_WARNING("Swig is missing: Language interfaces are disabled.")
message (STATUS "Searching for swig - not found.")
if (SKIP_SWIG)
message(STATUS "SKIP_SWIG set - disabling SWIG Ruby support")
else()
message (STATUS "Searching for swig - found version ${SWIG_VERSION}.")
endif()

# Include other languages if swig was found
if (SWIG_FOUND)
########################################
# Include ruby
find_package(Ruby 1.9 QUIET)
if (NOT RUBY_FOUND)
IGN_BUILD_WARNING("Ruby is missing: Install ruby-dev to enable ruby interface to ignition math.")
message (STATUS "Searching for Ruby - not found.")
find_package(SWIG QUIET)
if (NOT SWIG_FOUND)
IGN_BUILD_WARNING("Swig is missing: Language interfaces are disabled.")
message (STATUS "Searching for swig - not found.")
else()
message (STATUS "Searching for Ruby - found version ${RUBY_VERSION}.")
message (STATUS "Searching for swig - found version ${SWIG_VERSION}.")
endif()

# Include other languages if swig was found
if (SWIG_FOUND)
########################################
# Include ruby
find_package(Ruby 1.9 QUIET)
if (NOT RUBY_FOUND)
IGN_BUILD_WARNING("Ruby is missing: Install ruby-dev to enable ruby interface to ignition math.")
message (STATUS "Searching for Ruby - not found.")
else()
message (STATUS "Searching for Ruby - found version ${RUBY_VERSION}.")
endif()
endif()
endif()

########################################
# Python bindings
#include(IgnPython) TODO: allow to specify for what it should search and then
# the code below can be removed; e.g. pybind needs Interpreter and Development components
# see https://pybind11.readthedocs.io/en/stable/cmake/index.html#new-findpython-mode
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonLibs QUIET)
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_VERSION ${PYTHONLIBS_VERSION_STRING})
if (SKIP_PYBIND11)
message(STATUS "SKIP_PYBIND11 set - disabling python bindings")
else()
find_package(Python3 QUIET COMPONENTS Interpreter Development)
endif()
#include(IgnPython) TODO: allow to specify for what it should search and then
# the code below can be removed; e.g. pybind needs Interpreter and Development components
# see https://pybind11.readthedocs.io/en/stable/cmake/index.html#new-findpython-mode
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonLibs QUIET)
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_VERSION ${PYTHONLIBS_VERSION_STRING})
else()
find_package(Python3 QUIET COMPONENTS Interpreter Development)
endif()

if (NOT Python3_FOUND)
IGN_BUILD_WARNING("Python3 is missing: Python interfaces are disabled.")
message (STATUS "Searching for Python3 - not found.")
else()
message (STATUS "Searching for Python3 - found version ${Python3_VERSION}.")
if (NOT Python3_FOUND)
IGN_BUILD_WARNING("Python3 is missing: Python interfaces are disabled.")
message (STATUS "Searching for Python3 - not found.")
else()
message (STATUS "Searching for Python3 - found version ${Python3_VERSION}.")

set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.2 QUIET)
set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.2 QUIET)

if (${pybind11_FOUND})
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
else()
IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
if (${pybind11_FOUND})
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
else()
IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
endif()
endif()
endif()

Expand Down
178 changes: 0 additions & 178 deletions COPYING

This file was deleted.

15 changes: 15 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
## Gazebo Math 6.x

## Gazebo Math 6.14.0 (2023-04-14)

1. Disable pybind11 on windows by default
* [Pull request #529](https://github.com/gazebosim/gz-math/pull/529)

1. Add option to skip pybind11 and SWIG
* [Pull request #480](https://github.com/gazebosim/gz-math/pull/480)

1. Custom PID error rate
* [Pull request #525](https://github.com/gazebosim/gz-math/pull/525)

1. Infrastructure
* [Pull request #521](https://github.com/gazebosim/gz-math/pull/521)
* [Pull request #519](https://github.com/gazebosim/gz-math/pull/519)

## Gazebo Math 6.13.0 (2022-08-31)

1. Support migration and migrate headers
Expand Down
Loading

0 comments on commit 2b82268

Please sign in to comment.