From 7acbbd179f6835fd55610c94e062a3fb31b2ddf6 Mon Sep 17 00:00:00 2001 From: Jonas Vautherin Date: Wed, 15 Nov 2023 23:59:10 +0100 Subject: [PATCH] [v1.4] fix mavlink build in macOS CI --- third_party/mavlink/CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/third_party/mavlink/CMakeLists.txt b/third_party/mavlink/CMakeLists.txt index 18759d7137..2fce8f4867 100644 --- a/third_party/mavlink/CMakeLists.txt +++ b/third_party/mavlink/CMakeLists.txt @@ -11,9 +11,18 @@ list(APPEND CMAKE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" ) -# Without this GitHub actions picks the wrong python3 executable. -set(Python3_FIND_REGISTRY "NEVER") -set(Python3_FIND_FRAMEWORK "NEVER") +if (POLICY CMP0094) + cmake_policy(SET CMP0094 NEW) # FindPython should return the first matching Python +endif () + +# Needed to find the right Python on macOS +if (NOT DEFINED Python_FIND_FRAMEWORK) + set(Python_FIND_FRAMEWORK "LAST") +endif() + +# Needed to find the right Python on Windows +set(Python_FIND_REGISTRY "LAST") + find_package(Python3 COMPONENTS Interpreter REQUIRED) ExternalProject_add(