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

Commit c2e4cd1

Browse files
authored
Merge pull request #59 from glowmouse/bug/path-lib-fix
Do not look at the system PATH variable when looking for libraries.
2 parents 3dbc53f + ede3902 commit c2e4cd1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cmake/Platform/System/PlatformElementsManager.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
function(find_platform_cores)
22

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

912
set(core_list "")
@@ -24,10 +27,13 @@ endfunction()
2427

2528
function(find_platform_variants)
2629

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

@@ -50,50 +56,65 @@ endfunction()
5056

5157
function(find_platform_bootloaders)
5258

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

5968
endfunction()
6069

6170
function(find_platform_programmers)
6271

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

6981
endfunction()
7082

7183
function(find_platform_boards)
7284

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

7994
endfunction()
8095

8196
function(find_platform_properties_file)
8297

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

89107
endfunction()
90108

91109
function(find_platform_libraries)
92110

111+
# Avoid searching system's PATH as the SDK's general `Libraries` directory
112+
# may be used instead of the platform's directory
93113
find_file(ARDUINO_CMAKE_PLATFORM_LIBRARIES_PATH
94114
NAMES libraries
95115
PATHS ${ARDUINO_CMAKE_PLATFORM_PATH}
96116
DOC "Path to platform directory containing the Arduino libraries"
117+
NO_SYSTEM_ENVIRONMENT_PATH
97118
NO_CMAKE_FIND_ROOT_PATH)
98119

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

0 commit comments

Comments
 (0)