summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2024-10-16 13:12:56 +1100
committerDamien George <damien@micropython.org>2024-11-20 17:38:39 +1100
commit78d017fc4e70bf21b7c53f193550d220f8959e38 (patch)
tree79db7badf0c5ded717f6728eaf6a3c2eb5c2202e /py
parentdccd206f4cbbf7c15e1a5721ec5ab830d92ffa8e (diff)
py/usermod.cmake: If USER_C_MODULES is a folder add micropython.cmake.
This mirrors how it works when using a Makefile. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Diffstat (limited to 'py')
-rw-r--r--py/usermod.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/usermod.cmake b/py/usermod.cmake
index 93fce13b3..4a8b99ff3 100644
--- a/py/usermod.cmake
+++ b/py/usermod.cmake
@@ -42,6 +42,10 @@ endfunction()
# Include CMake files for user modules.
if (USER_C_MODULES)
foreach(USER_C_MODULE_PATH ${USER_C_MODULES})
+ # If a directory is given, append the micropython.cmake to it.
+ if (IS_DIRECTORY ${USER_C_MODULE_PATH})
+ set(USER_C_MODULE_PATH "${USER_C_MODULE_PATH}/micropython.cmake")
+ endif()
# Confirm the provided path exists, show abspath if not to make it clearer to fix.
if (NOT EXISTS ${USER_C_MODULE_PATH})
get_filename_component(USER_C_MODULES_ABS "${USER_C_MODULE_PATH}" ABSOLUTE)