Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.
Merged
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
21 changes: 21 additions & 0 deletions cmake/Platform/System/PlatformElementsManager.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
function(find_platform_cores)

# Avoid searching system's PATH as the SDK's general `Libraries` directory
# may be used instead of the platform's directory
find_file(ARDUINO_CMAKE_PLATFORM_CORES_PATH
NAMES cores
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
DOC "Path to directory containing the Platform's core sources"
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH)

set(core_list "")
Expand All @@ -24,10 +27,13 @@ endfunction()

function(find_platform_variants)

# Avoid searching system's PATH as the SDK's general `Libraries` directory
# may be used instead of the platform's directory
find_file(ARDUINO_CMAKE_PLATFORM_VARIANTS_PATH
NAMES variants
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
DOC "Path to directory containing the Platform's variant sources"
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH)
file(GLOB sub-dir ${ARDUINO_CMAKE_PLATFORM_VARIANTS_PATH}/*)

Expand All @@ -50,50 +56,65 @@ endfunction()

function(find_platform_bootloaders)

# Avoid searching system's PATH as the SDK's general `Libraries` directory
# may be used instead of the platform's directory
find_file(ARDUINO_CMAKE_PLATFORM_BOOTLOADERS_PATH
NAMES bootloaders
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
DOC "Path to directory containing the Platform's bootloader images and sources"
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH)

endfunction()

function(find_platform_programmers)

# Avoid searching system's PATH as the SDK's general `Libraries` directory
# may be used instead of the platform's directory
find_file(ARDUINO_CMAKE_PLATFORM_PROGRAMMERS_PATH
NAMES programmers.txt
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
DOC "Path to Platform's programmers definition file"
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH)

endfunction()

function(find_platform_boards)

# Avoid searching system's PATH as the SDK's general `Libraries` directory
# may be used instead of the platform's directory
find_file(ARDUINO_CMAKE_PLATFORM_BOARDS_PATH
NAMES boards.txt
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
DOC "Path to Platform's boards definition file"
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH)

endfunction()

function(find_platform_properties_file)

# Avoid searching system's PATH as the SDK's general `Libraries` directory
# may be used instead of the platform's directory
find_file(ARDUINO_CMAKE_PLATFORM_PROPERTIES_FILE_PATH
NAMES platform.txt
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
DOC "Path to Platform's properties file"
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH)

endfunction()

function(find_platform_libraries)

# Avoid searching system's PATH as the SDK's general `Libraries` directory
# may be used instead of the platform's directory
find_file(ARDUINO_CMAKE_PLATFORM_LIBRARIES_PATH
NAMES libraries
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
DOC "Path to platform directory containing the Arduino libraries"
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH)

file(GLOB sub-dir "${ARDUINO_CMAKE_PLATFORM_LIBRARIES_PATH}/*")
Expand Down