From 2f1e049bc6937efab3fd7a1d136978fc3339cf30 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 18 Apr 2024 11:14:10 -0700 Subject: [PATCH] Enable 24.04 CI, remove distutils dependency (#587) * Enable GitHub workflow on Ubuntu Noble * Require cmake version 3.22.1 Part of gazebosim/gz-cmake#350. * Remove old ruby cmake code * Remove old python cmake code Also don't need to install python3-distutils anymore. Signed-off-by: Steve Peters --- .github/ci/packages.apt | 1 - .github/workflows/ci.yml | 9 +++++++++ CMakeLists.txt | 2 +- examples/CMakeLists.txt | 2 +- src/python_pybind11/CMakeLists.txt | 15 +++------------ src/ruby/CMakeLists.txt | 6 +----- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/ci/packages.apt b/.github/ci/packages.apt index fbdc0c36d..116b35036 100644 --- a/.github/ci/packages.apt +++ b/.github/ci/packages.apt @@ -2,7 +2,6 @@ libeigen3-dev libgz-cmake4-dev libgz-utils3-dev libpython3-dev -python3-distutils python3-pybind11 python3-pytest ruby-dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab45c9400..1a3c3663a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,3 +17,12 @@ jobs: cppcheck-enabled: true cpplint-enabled: true doxygen-enabled: true + noble-ci: + runs-on: ubuntu-latest + name: Ubuntu Noble CI + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Compile and test + id: ci + uses: gazebo-tooling/action-gz-ci@noble diff --git a/CMakeLists.txt b/CMakeLists.txt index 439088a0b..2526df888 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) #============================================================================ # Initialize the project diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3a532ee2c..c68d89487 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) project(gz-math-examples) diff --git a/src/python_pybind11/CMakeLists.txt b/src/python_pybind11/CMakeLists.txt index 935d34ac6..90d1dcacb 100644 --- a/src/python_pybind11/CMakeLists.txt +++ b/src/python_pybind11/CMakeLists.txt @@ -73,18 +73,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") endif() if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION) - if(${CMAKE_VERSION} VERSION_LESS "3.12.0") - execute_process( - COMMAND "${PYTHON_EXECUTABLE}" -c "if True: - from distutils import sysconfig as sc - print(sc.get_python_lib(plat_specific=True))" - OUTPUT_VARIABLE Python3_SITEARCH - OUTPUT_STRIP_TRAILING_WHITESPACE) - else() - # Get install variable from Python3 module - # Python3_SITEARCH is available from 3.12 on, workaround if needed: - find_package(Python3 COMPONENTS Interpreter) - endif() + # Get install variable from Python3 module + # Python3_SITEARCH is available from 3.12 on, workaround if needed: + find_package(Python3 COMPONENTS Interpreter) if(USE_DIST_PACKAGES_FOR_PYTHON) string(REPLACE "site-packages" "dist-packages" GZ_PYTHON_INSTALL_PATH ${Python3_SITEARCH}) diff --git a/src/ruby/CMakeLists.txt b/src/ruby/CMakeLists.txt index 8ad32202b..7c541051d 100644 --- a/src/ruby/CMakeLists.txt +++ b/src/ruby/CMakeLists.txt @@ -44,11 +44,7 @@ if (RUBY_FOUND) # Create the ruby library set(CMAKE_SWIG_OUTDIR "${CMAKE_BINARY_DIR}/lib/ruby") - if(CMAKE_VERSION VERSION_GREATER 3.8.0) - SWIG_ADD_LIBRARY(${SWIG_RB_LIB} LANGUAGE ruby SOURCES ruby.i ${swig_i_files}) - else() - SWIG_ADD_MODULE(${SWIG_RB_LIB} ruby ruby.i ${swig_i_files}) - endif() + SWIG_ADD_LIBRARY(${SWIG_RB_LIB} LANGUAGE ruby SOURCES ruby.i ${swig_i_files}) # Suppress warnings on SWIG-generated files target_compile_options(${SWIG_RB_LIB} PRIVATE