From cd39a9fec764b11fbd0943937f75bc61309ed81b Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 28 May 2024 09:35:26 -0700 Subject: [PATCH] Enable 24.04 CI, require cmake 3.22.1 (#444) * Only run workflows on pull requests or release / main branches. * Use checkout@v4. * Require cmake version 3.22.1, remove old cmake code Part of gazebosim/gz-cmake#350. Signed-off-by: Steve Peters --- .github/workflows/ci.yml | 19 +++++++++++++++++-- CMakeLists.txt | 2 +- .../generating_custom_msgs/CMakeLists.txt | 2 +- examples/using_gz_msgs/CMakeLists.txt | 2 +- gz-msgs-extras.cmake.in | 9 +-------- tutorials/cppgetstarted.md | 2 +- tutorials/message_generation.md | 2 +- 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab45c940..d707b847 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@ name: Ubuntu CI -on: [push, pull_request] +on: + pull_request: + push: + branches: + - 'ign-msgs[0-9]?' + - 'gz-msgs[0-9]?' + - 'main' jobs: jammy-ci: @@ -8,7 +14,7 @@ jobs: name: Ubuntu Jammy CI steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile and test id: ci uses: gazebo-tooling/action-gz-ci@jammy @@ -17,3 +23,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@v4 + - name: Compile and test + id: ci + uses: gazebo-tooling/action-gz-ci@noble diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b79a04d..7e0d9b63 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/generating_custom_msgs/CMakeLists.txt b/examples/generating_custom_msgs/CMakeLists.txt index eb34f1c1..3716df8f 100644 --- a/examples/generating_custom_msgs/CMakeLists.txt +++ b/examples/generating_custom_msgs/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/using_gz_msgs/CMakeLists.txt b/examples/using_gz_msgs/CMakeLists.txt index 63d2a39b..44b3dde0 100644 --- a/examples/using_gz_msgs/CMakeLists.txt +++ b/examples/using_gz_msgs/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/gz-msgs-extras.cmake.in b/gz-msgs-extras.cmake.in index 8bbdbe5a..39936b57 100644 --- a/gz-msgs-extras.cmake.in +++ b/gz-msgs-extras.cmake.in @@ -22,14 +22,7 @@ include(${@PROJECT_NAME@_DIR}/gz_msgs_factory.cmake) include(${@PROJECT_NAME@_DIR}/gz_msgs_generate.cmake) set(@PROJECT_NAME@_INSTALL_PATH "${@PROJECT_NAME@_DIR}/@PROJECT_CMAKE_EXTRAS_PATH_TO_PREFIX@") - -if(CMAKE_VERSION VERSION_LESS "3.20.0") - file(TO_CMAKE_PATH @PROJECT_NAME@_INSTALL_PATH NORMALIZED_PATH) # Converts native path to CMake style with forward slashes. - get_filename_component(ABSOLUTE_PATH "${NORMALIZED_PATH}" ABSOLUTE) # Extracts the absolute path component. - set(@PROJECT_NAME@_INSTALL_PATH "${ABSOLUTE_PATH}") # Stores the normalized absolute path back to the original variable. -else() - cmake_path(NORMAL_PATH @PROJECT_NAME@_INSTALL_PATH OUTPUT_VARIABLE @PROJECT_NAME@_INSTALL_PATH) -endif() +cmake_path(NORMAL_PATH @PROJECT_NAME@_INSTALL_PATH OUTPUT_VARIABLE @PROJECT_NAME@_INSTALL_PATH) set(PROTOC_NAME "$") set(PROTO_SCRIPT_NAME "@PROJECT_NAME@_generate.py") diff --git a/tutorials/cppgetstarted.md b/tutorials/cppgetstarted.md index b7d48044..4bb734a9 100644 --- a/tutorials/cppgetstarted.md +++ b/tutorials/cppgetstarted.md @@ -59,7 +59,7 @@ int main() To compile the code create a `CMakeLists.txt`: ``` -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) # Find the Gazebo msgs library find_package(gz-msgs11 QUIET REQUIRED) diff --git a/tutorials/message_generation.md b/tutorials/message_generation.md index ffab1054..1505e1ce 100644 --- a/tutorials/message_generation.md +++ b/tutorials/message_generation.md @@ -127,7 +127,7 @@ The `cmake` functionality is exported from the `gz-msgs` library, via the `gz-cm To make the functions available, simply `find_package(gz-msgs11)` in your `CMakeLists.txt`: ```cmake -cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) project(my_custom_package VERSION 0.0.1) find_package(gz-cmake4 REQUIRED) find_package(gz-msgs11 REQUIRED)