Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 5728639

Browse files
committed
Moved setting of all internal SDK paths to a single function.
1 parent 7258bd8 commit 5728639

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

cmake/Arduino-Toolchain.cmake

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include(${CMAKE_CURRENT_LIST_DIR}/Platform/Other/FindArduinoSDK.cmake)
2+
13
function(_find_required_programs)
24

35
# Find ASM compiler
@@ -27,17 +29,19 @@ function(_find_required_programs)
2729

2830
endfunction()
2931

30-
function(_setup_remaining_sdk_paths)
32+
function(_setup_sdk_internal_paths)
3133

34+
set(ARDUINO_SDK_BIN_PATH "${ARDUINO_SDK_PATH}/hardware/tools/avr/bin" CACHE PATH
35+
"Path to Arduino SDK's binaries folder")
36+
set(ARDUINO_SDK_ROOT_PATH "${ARDUINO_SDK_PATH}/hardware/tools/avr" CACHE PATH
37+
"Path to Arduino SDK's sys-root folder")
3238
set(ARDUINO_SDK_LIBRARIES_PATH "${ARDUINO_SDK_PATH}/libraries" CACHE PATH
3339
"Path to SDK's libraries directory")
3440
set(ARDUINO_SDK_EXAMPLES_PATH "${ARDUINO_SDK_PATH}/examples" CACHE PATH
3541
"Path to SDK's examples directory")
3642

3743
endfunction()
3844

39-
include(${CMAKE_CURRENT_LIST_DIR}/Platform/Other/FindArduinoSDK.cmake)
40-
4145
set(CMAKE_SYSTEM_NAME Arduino)
4246

4347
# Add current directory to CMake Module path automatically
@@ -54,12 +58,7 @@ if (NOT ARDUINO_SDK_PATH)
5458
set(ARDUINO_SDK_PATH "${arduino_sdk_path}" CACHE PATH "Arduino SDK Path")
5559
endif ()
5660

57-
set(ARDUINO_SDK_BIN_PATH "${ARDUINO_SDK_PATH}/hardware/tools/avr/bin" CACHE PATH
58-
"Path to Arduino SDK's binaries folder")
59-
set(ARDUINO_SDK_ROOT_PATH "${ARDUINO_SDK_PATH}/hardware/tools/avr" CACHE PATH
60-
"Path to Arduino SDK's sys-root folder")
61-
62-
_setup_remaining_sdk_paths()
61+
_setup_sdk_internal_paths()
6362
_find_required_programs()
6463

6564
# where is the target environment

0 commit comments

Comments
 (0)