From d5d678a8f96071544944696f62cfe7c239a73984 Mon Sep 17 00:00:00 2001 From: ty Date: Mon, 17 Sep 2018 23:28:44 +0800 Subject: [PATCH 1/2] Fix arduino sdk path finding issue --- cmake/Platform/Other/FindArduinoSDK.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/Platform/Other/FindArduinoSDK.cmake b/cmake/Platform/Other/FindArduinoSDK.cmake index bcf3363..1b85980 100644 --- a/cmake/Platform/Other/FindArduinoSDK.cmake +++ b/cmake/Platform/Other/FindArduinoSDK.cmake @@ -19,6 +19,11 @@ function(find_arduino_sdk _return_var) NO_CMAKE_FIND_ROOT_PATH) get_filename_component(sdk_path "${arduino_program_path}" DIRECTORY) + if (${CMAKE_HOST_APPLE}) + get_filename_component(sdk_path "${sdk_path}" DIRECTORY) + string(APPEND sdk_path "/Java") + endif() + if (NOT sdk_path OR "${sdk_path}" MATCHES "NOTFOUND") string(CONCAT error_message "Couldn't find Arduino SDK path - Is it in a non-standard location?" "\n" From 0cdc53f1776057943d1a08542ec0e426ff5eecc7 Mon Sep 17 00:00:00 2001 From: ty Date: Tue, 18 Sep 2018 08:34:01 +0800 Subject: [PATCH 2/2] Skip sdk path fixing if no arduino installation found on MacOS --- cmake/Platform/Other/FindArduinoSDK.cmake | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake/Platform/Other/FindArduinoSDK.cmake b/cmake/Platform/Other/FindArduinoSDK.cmake index 1b85980..564d69f 100644 --- a/cmake/Platform/Other/FindArduinoSDK.cmake +++ b/cmake/Platform/Other/FindArduinoSDK.cmake @@ -19,17 +19,16 @@ function(find_arduino_sdk _return_var) NO_CMAKE_FIND_ROOT_PATH) get_filename_component(sdk_path "${arduino_program_path}" DIRECTORY) - if (${CMAKE_HOST_APPLE}) - get_filename_component(sdk_path "${sdk_path}" DIRECTORY) - string(APPEND sdk_path "/Java") - endif() - if (NOT sdk_path OR "${sdk_path}" MATCHES "NOTFOUND") string(CONCAT error_message "Couldn't find Arduino SDK path - Is it in a non-standard location?" "\n" "If so, please set the ARDUINO_SDK_PATH CMake-Variable") message(FATAL_ERROR ${error_message}) else () + if (${CMAKE_HOST_APPLE}) + get_filename_component(sdk_path "${sdk_path}" DIRECTORY) + string(APPEND sdk_path "/Java") + endif() set(${_return_var} "${sdk_path}" PARENT_SCOPE) endif ()