Skip to content

Commit

Permalink
ignition-math6: fix build
Browse files Browse the repository at this point in the history
Building the ignition-math6 formula currently fails with:

    CMake Error at /home/linuxbrew/.linuxbrew/share/cmake/pybind11/pybind11NewTools.cmake:207 (python3_add_library):
      Unknown CMake command "python3_add_library".

This adds a patch that is a mini version of an upstream PR that fixes
the build.

Fixes: osrf#1872
  • Loading branch information
dlech committed May 1, 2022
1 parent f0a2592 commit dcf5c60
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Formula/ignition-math6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class IgnitionMath6 < Formula
depends_on "ignition-cmake2"
depends_on "ruby"

# needed to fix build
# see https://github.com/ignitionrobotics/ign-math/pull/402
patch :DATA

def install
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=Off"
Expand Down Expand Up @@ -62,3 +66,26 @@ def install
system cmd_not_grep_xcode
end
end

__END__
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f8ed5f..6403a71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,13 +71,12 @@ endif()

########################################
# Python bindings
-include(IgnPython)
-find_package(PythonLibs QUIET)
-if (NOT PYTHONLIBS_FOUND)
+find_package(Python3 COMPONENTS Interpreter Development)
+if (NOT Python3_FOUND)
IGN_BUILD_WARNING("Python is missing: Python interfaces are disabled.")
message (STATUS "Searching for Python - not found.")
else()
- message (STATUS "Searching for Python - found version ${PYTHONLIBS_VERSION_STRING}.")
+ message (STATUS "Searching for Python - found version ${Python3_VERSION}.")

set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.2 QUIET)

0 comments on commit dcf5c60

Please sign in to comment.