pimoroni-pico/micropython/modules_py/modules_py.cmake

25 lines
1014 B
CMake
Raw Normal View History

2022-03-11 09:21:09 +00:00
function (copy_module TARGET SRC DST)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/../modules/${DST}.py
COMMAND
cp ${SRC} ${CMAKE_CURRENT_BINARY_DIR}/../modules/${DST}.py
DEPENDS ${src}
)
target_sources(${TARGET} INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/../modules/${DST}.py)
endfunction()
# Create a dummy usermod to hang our .py copies from
add_library(usermod_modules_py INTERFACE)
target_link_libraries(usermod INTERFACE usermod_modules_py)
# .py files to copy from modules_py to ports/rp2/modules
#copy_module(usermod_modules_py ${CMAKE_CURRENT_LIST_DIR}/picosystem.py picosystem)
2022-03-11 09:21:09 +00:00
copy_module(usermod_modules_py ${CMAKE_CURRENT_LIST_DIR}/pimoroni.py pimoroni)
2022-11-04 17:23:30 +00:00
copy_module(usermod_modules_py ${CMAKE_CURRENT_LIST_DIR}/gfx_pack.py gfx_pack)
if(PICO_BOARD STREQUAL "pico_w")
copy_module(usermod_modules_py ${CMAKE_CURRENT_LIST_DIR}/automation.py automation)
copy_module(usermod_modules_py ${CMAKE_CURRENT_LIST_DIR}/inventor.py inventor)
endif()