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
4 changes: 4 additions & 0 deletions .github/workflows/cmake_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ jobs:
INSTALL_TEST_DIR: '/Users/runner/install_test'
CXX_STANDARD: '17'
CMAKE_TOOLCHAIN_FILE: '/Users/runner/conan/build/Debug/generators/conan_toolchain.cmake'
CMAKE_VERSION: 3.31.0 # building the conan "stable" versions requires CMake 3.x
Copy link
Member Author

@dbarker dbarker Sep 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrading is the most direct and stable solution to fix the CMake 4.x build issue. Many of the dependencies in this "stable" version set depend on CMake versions < 3.5. Later versions of the dependencies (with the exception of opentracing has a minimum of 3.1) build with CMake 4.x.

BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -272,6 +273,9 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: 'recursive'
- name: Install CMake
run: |
./ci/setup_cmake_macos.sh
- name: Install Conan and tools
run: |
brew install conan autoconf automake libtool coreutils
Expand Down
12 changes: 12 additions & 0 deletions cmake/opentracing-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ if(NOT OpenTracing_FOUND)
set(_SAVED_BUILD_TESTING ${BUILD_TESTING})
endif()

if(DEFINED CMAKE_POLICY_VERSION_MINIMUM)
set(_SAVED_CMAKE_POLICY_VERSION_MINIMUM ${CMAKE_POLICY_VERSION_MINIMUM})
endif()

# Set the cache variables for the opentracing build
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
set(BUILD_MOCKTRACER OFF CACHE BOOL "" FORCE)
set(CMAKE_POLICY_VERSION_MINIMUM "3.5" CACHE STRING "" FORCE)

FetchContent_MakeAvailable(opentracing)

Expand All @@ -40,6 +45,13 @@ if(NOT OpenTracing_FOUND)
unset(BUILD_TESTING CACHE)
endif()

# Restore the saved state of CMAKE_POLICY_VERSION_MINIMUM
if(DEFINED _SAVED_CMAKE_POLICY_VERSION_MINIMUM)
set(CMAKE_POLICY_VERSION_MINIMUM ${_SAVED_CMAKE_POLICY_VERSION_MINIMUM} CACHE STRING "" FORCE)
else()
unset(CMAKE_POLICY_VERSION_MINIMUM CACHE)
endif()

# Patch the opentracing targets to set missing includes, add namespaced alias targets, disable iwyu and clang-tidy.
foreach(_target opentracing opentracing-static)
if(TARGET ${_target})
Expand Down
Loading