From 8a9ef39158ca831c9057af4677ed17f2e2f7ccb9 Mon Sep 17 00:00:00 2001 From: Pete Favelle Date: Thu, 31 Aug 2023 10:05:08 +0100 Subject: [PATCH] Added includes to allow for libraries to be linked to out-of-tree --- drivers/CMakeLists.txt | 2 +- drivers/inky73/inky73.cmake | 4 ++ drivers/motor/motor.cmake | 4 ++ drivers/motor/motor_cluster.cmake | 4 ++ drivers/rgbled/rgbled.cmake | 2 +- drivers/servo/servo.cmake | 4 ++ drivers/servo/servo_cluster.cmake | 4 ++ libraries/automation2040w/automation.cmake | 26 +++++----- libraries/badger2040/badger2040.cmake | 34 ++++++++---- .../breakout_as7262/breakout_as7262.cmake | 4 ++ .../breakout_bh1745/breakout_bh1745.cmake | 4 ++ .../breakout_dotmatrix.cmake | 4 ++ .../breakout_encoder/breakout_encoder.cmake | 4 ++ .../breakout_encoder_wheel.cmake | 8 +++ .../breakout_ioexpander.cmake | 4 ++ .../breakout_ltr559/breakout_ltr559.cmake | 4 ++ .../breakout_matrix11x7.cmake | 4 ++ .../breakout_mics6814/breakout_mics6814.cmake | 4 ++ .../breakout_msa301/breakout_msa301.cmake | 4 ++ .../breakout_paa5100/breakout_paa5100.cmake | 4 ++ .../breakout_pmw3901/breakout_pmw3901.cmake | 4 ++ .../breakout_potentiometer.cmake | 4 ++ .../breakout_rgbmatrix5x5.cmake | 4 ++ libraries/breakout_rtc/breakout_rtc.cmake | 4 ++ libraries/breakout_sgp30/breakout_sgp30.cmake | 4 ++ .../breakout_trackball.cmake | 4 ++ libraries/cosmic_unicorn/cosmic_unicorn.cmake | 4 ++ .../galactic_unicorn/galactic_unicorn.cmake | 4 ++ libraries/gfx_pack/gfx_pack.cmake | 16 ++++++ libraries/inky_frame/inky_frame.cmake | 46 ++++++++++++---- libraries/inky_frame_7/inky_frame_7.cmake | 52 ++++++++++++++----- libraries/interstate75/interstate75.cmake | 16 ++++++ libraries/inventor2040w/inventor.cmake | 18 ++++++- libraries/motor2040/motor2040.cmake | 16 ++++++ libraries/pico_explorer/pico_explorer.cmake | 9 +++- .../pico_motor_shim/pico_motor_shim.cmake | 4 ++ libraries/pico_scroll/pico_scroll.cmake | 4 ++ libraries/pico_unicorn/pico_unicorn.cmake | 4 ++ libraries/pico_wireless/pico_wireless.cmake | 5 +- libraries/plasma2040/plasma2040.cmake | 4 ++ libraries/plasma_stick/plasma_stick.cmake | 4 ++ libraries/servo2040/servo2040.cmake | 12 +++++ .../stellar_unicorn/stellar_unicorn.cmake | 4 ++ 43 files changed, 326 insertions(+), 52 deletions(-) diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index e712eae82..d5c9a5583 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -41,6 +41,6 @@ add_subdirectory(pms5003) add_subdirectory(sh1107) add_subdirectory(st7567) add_subdirectory(psram_display) -add_subdirectory(inky73) add_subdirectory(shiftregister) +add_subdirectory(inky73) add_subdirectory(mlx90640) \ No newline at end of file diff --git a/drivers/inky73/inky73.cmake b/drivers/inky73/inky73.cmake index 0489400e7..7c84668f6 100644 --- a/drivers/inky73/inky73.cmake +++ b/drivers/inky73/inky73.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET shiftregister) + include(${CMAKE_CURRENT_LIST_DIR}/../shiftregister/shiftregister.cmake) +endif() + set(DRIVER_NAME inky73) add_library(${DRIVER_NAME} INTERFACE) diff --git a/drivers/motor/motor.cmake b/drivers/motor/motor.cmake index 38001cf88..eb41f9095 100644 --- a/drivers/motor/motor.cmake +++ b/drivers/motor/motor.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pwm) + include(${CMAKE_CURRENT_LIST_DIR}/../pwm/pwm.cmake) +endif() + set(DRIVER_NAME motor) add_library(${DRIVER_NAME} INTERFACE) diff --git a/drivers/motor/motor_cluster.cmake b/drivers/motor/motor_cluster.cmake index 1bdd04633..1b69da42b 100644 --- a/drivers/motor/motor_cluster.cmake +++ b/drivers/motor/motor_cluster.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pwm_cluster) + include(${CMAKE_CURRENT_LIST_DIR}/../pwm/pwm_cluster.cmake) +endif() + set(DRIVER_NAME motor_cluster) add_library(${DRIVER_NAME} INTERFACE) diff --git a/drivers/rgbled/rgbled.cmake b/drivers/rgbled/rgbled.cmake index 65e7ea15c..a78e1a882 100644 --- a/drivers/rgbled/rgbled.cmake +++ b/drivers/rgbled/rgbled.cmake @@ -7,4 +7,4 @@ target_sources(rgbled INTERFACE target_include_directories(rgbled INTERFACE ${CMAKE_CURRENT_LIST_DIR}) # Pull in pico libraries that we need -target_link_libraries(rgbled INTERFACE pico_stdlib hardware_pwm) +target_link_libraries(rgbled INTERFACE pico_stdlib hardware_pwm) \ No newline at end of file diff --git a/drivers/servo/servo.cmake b/drivers/servo/servo.cmake index 9eeec2cb3..20c0b87c0 100644 --- a/drivers/servo/servo.cmake +++ b/drivers/servo/servo.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pwm) + include(${CMAKE_CURRENT_LIST_DIR}/../pwm/pwm.cmake) +endif() + set(DRIVER_NAME servo) add_library(${DRIVER_NAME} INTERFACE) diff --git a/drivers/servo/servo_cluster.cmake b/drivers/servo/servo_cluster.cmake index fdf90165a..71e2b38f2 100644 --- a/drivers/servo/servo_cluster.cmake +++ b/drivers/servo/servo_cluster.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pwm_cluster) + include(${CMAKE_CURRENT_LIST_DIR}/../pwm/pwm_cluster.cmake) +endif() + set(DRIVER_NAME servo_cluster) add_library(${DRIVER_NAME} INTERFACE) diff --git a/libraries/automation2040w/automation.cmake b/libraries/automation2040w/automation.cmake index 62c808acb..3d360c851 100644 --- a/libraries/automation2040w/automation.cmake +++ b/libraries/automation2040w/automation.cmake @@ -1,12 +1,14 @@ -add_library(automation INTERFACE) - -target_sources(automation INTERFACE - ${CMAKE_CURRENT_LIST_DIR}/automation.cpp -) - -target_include_directories(automation INTERFACE ${CMAKE_CURRENT_LIST_DIR}) - -#include(${PIMORONI_PICO_PATH}/drivers/analog/analog.cmake) - -# Pull in pico libraries that we need -target_link_libraries(automation INTERFACE pico_stdlib hardware_pwm hardware_i2c pimoroni_i2c analog) +if(NOT TARGET analog) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/analog/analog.cmake) +endif() + +add_library(automation INTERFACE) + +target_sources(automation INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/automation.cpp +) + +target_include_directories(automation INTERFACE ${CMAKE_CURRENT_LIST_DIR}) + +# Pull in pico libraries that we need +target_link_libraries(automation INTERFACE pico_stdlib hardware_pwm hardware_i2c pimoroni_i2c analog) diff --git a/libraries/badger2040/badger2040.cmake b/libraries/badger2040/badger2040.cmake index 6d8df34b0..2c97b22cb 100644 --- a/libraries/badger2040/badger2040.cmake +++ b/libraries/badger2040/badger2040.cmake @@ -1,11 +1,23 @@ -set(LIB_NAME badger2040) -add_library(${LIB_NAME} INTERFACE) - -target_sources(${LIB_NAME} INTERFACE - ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp -) - -target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}) - -# Pull in pico libraries that we need -target_link_libraries(${LIB_NAME} INTERFACE bitmap_fonts hershey_fonts pico_stdlib hardware_pwm uc8151_legacy) +if(NOT TARGET uc8151_legacy) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/uc8151_legacy/uc8151_legacy.cmake) +endif() + +if(NOT TARGET bitmap_fonts) + include(${CMAKE_CURRENT_LIST_DIR}/../bitmap_fonts/bitmap_fonts.cmake) +endif() + +if(NOT TARGET hershey_fonts) + include(${CMAKE_CURRENT_LIST_DIR}/../hershey_fonts/hershey_fonts.cmake) +endif() + +set(LIB_NAME badger2040) +add_library(${LIB_NAME} INTERFACE) + +target_sources(${LIB_NAME} INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp +) + +target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}) + +# Pull in pico libraries that we need +target_link_libraries(${LIB_NAME} INTERFACE bitmap_fonts hershey_fonts uc8151_legacy pico_stdlib hardware_pwm) diff --git a/libraries/breakout_as7262/breakout_as7262.cmake b/libraries/breakout_as7262/breakout_as7262.cmake index 37696acda..8df91c607 100644 --- a/libraries/breakout_as7262/breakout_as7262.cmake +++ b/libraries/breakout_as7262/breakout_as7262.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET as7262) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/as7262/as7262.cmake) +endif() + set(LIB_NAME breakout_as7262) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_bh1745/breakout_bh1745.cmake b/libraries/breakout_bh1745/breakout_bh1745.cmake index de5e7e484..fcce93c18 100644 --- a/libraries/breakout_bh1745/breakout_bh1745.cmake +++ b/libraries/breakout_bh1745/breakout_bh1745.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET bh1745) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/bh1745/bh1745.cmake) +endif() + set(LIB_NAME breakout_bh1745) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_dotmatrix/breakout_dotmatrix.cmake b/libraries/breakout_dotmatrix/breakout_dotmatrix.cmake index a5e297f8d..d42ca60eb 100644 --- a/libraries/breakout_dotmatrix/breakout_dotmatrix.cmake +++ b/libraries/breakout_dotmatrix/breakout_dotmatrix.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET ltp305) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/ltp305/ltp305.cmake) +endif() + set(LIB_NAME breakout_dotmatrix) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_encoder/breakout_encoder.cmake b/libraries/breakout_encoder/breakout_encoder.cmake index 765e58ab7..ac2148097 100644 --- a/libraries/breakout_encoder/breakout_encoder.cmake +++ b/libraries/breakout_encoder/breakout_encoder.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET ioexpander) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/ioexpander/ioexpander.cmake) +endif() + set(LIB_NAME breakout_encoder) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_encoder_wheel/breakout_encoder_wheel.cmake b/libraries/breakout_encoder_wheel/breakout_encoder_wheel.cmake index 73d9e8aed..2fe815fe3 100644 --- a/libraries/breakout_encoder_wheel/breakout_encoder_wheel.cmake +++ b/libraries/breakout_encoder_wheel/breakout_encoder_wheel.cmake @@ -1,3 +1,11 @@ +if(NOT TARGET ioexpander) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/ioexpander/ioexpander.cmake) +endif() + +if(NOT TARGET is31fl3731) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/is31fl3731/is31fl3731.cmake) +endif() + set(LIB_NAME breakout_encoder_wheel) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_ioexpander/breakout_ioexpander.cmake b/libraries/breakout_ioexpander/breakout_ioexpander.cmake index d2a20c358..38102ea71 100644 --- a/libraries/breakout_ioexpander/breakout_ioexpander.cmake +++ b/libraries/breakout_ioexpander/breakout_ioexpander.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET ioexpander) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/ioexpander/ioexpander.cmake) +endif() + set(LIB_NAME breakout_ioexpander) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_ltr559/breakout_ltr559.cmake b/libraries/breakout_ltr559/breakout_ltr559.cmake index a79c2830e..a361e753c 100644 --- a/libraries/breakout_ltr559/breakout_ltr559.cmake +++ b/libraries/breakout_ltr559/breakout_ltr559.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET ltr559) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/ltr559/ltr559.cmake) +endif() + set(LIB_NAME breakout_ltr559) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_matrix11x7/breakout_matrix11x7.cmake b/libraries/breakout_matrix11x7/breakout_matrix11x7.cmake index 94895bba2..4823c6833 100644 --- a/libraries/breakout_matrix11x7/breakout_matrix11x7.cmake +++ b/libraries/breakout_matrix11x7/breakout_matrix11x7.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET is31fl3731) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/is31fl3731/is31fl3731.cmake) +endif() + set(LIB_NAME breakout_matrix11x7) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_mics6814/breakout_mics6814.cmake b/libraries/breakout_mics6814/breakout_mics6814.cmake index 31b28c2e1..1be96f9ee 100644 --- a/libraries/breakout_mics6814/breakout_mics6814.cmake +++ b/libraries/breakout_mics6814/breakout_mics6814.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET ioexpander) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/ioexpander/ioexpander.cmake) +endif() + set(LIB_NAME breakout_mics6814) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_msa301/breakout_msa301.cmake b/libraries/breakout_msa301/breakout_msa301.cmake index f7f24a6d6..7ed612d9f 100644 --- a/libraries/breakout_msa301/breakout_msa301.cmake +++ b/libraries/breakout_msa301/breakout_msa301.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET msa301) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/msa301/msa301.cmake) +endif() + set(LIB_NAME breakout_msa301) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_paa5100/breakout_paa5100.cmake b/libraries/breakout_paa5100/breakout_paa5100.cmake index 75562cc98..ba496e50d 100644 --- a/libraries/breakout_paa5100/breakout_paa5100.cmake +++ b/libraries/breakout_paa5100/breakout_paa5100.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pmw3901) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/pmw3901/pmw3901.cmake) +endif() + set(LIB_NAME breakout_paa5100) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_pmw3901/breakout_pmw3901.cmake b/libraries/breakout_pmw3901/breakout_pmw3901.cmake index 8eb82ed2b..8da54a5b1 100644 --- a/libraries/breakout_pmw3901/breakout_pmw3901.cmake +++ b/libraries/breakout_pmw3901/breakout_pmw3901.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pmw3901) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/pmw3901/pmw3901.cmake) +endif() + set(LIB_NAME breakout_pmw3901) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_potentiometer/breakout_potentiometer.cmake b/libraries/breakout_potentiometer/breakout_potentiometer.cmake index 434970ce9..2910d99be 100644 --- a/libraries/breakout_potentiometer/breakout_potentiometer.cmake +++ b/libraries/breakout_potentiometer/breakout_potentiometer.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET ioexpander) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/ioexpander/ioexpander.cmake) +endif() + set(LIB_NAME breakout_potentiometer) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_rgbmatrix5x5/breakout_rgbmatrix5x5.cmake b/libraries/breakout_rgbmatrix5x5/breakout_rgbmatrix5x5.cmake index daae1b7bd..901da34a1 100644 --- a/libraries/breakout_rgbmatrix5x5/breakout_rgbmatrix5x5.cmake +++ b/libraries/breakout_rgbmatrix5x5/breakout_rgbmatrix5x5.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET is31fl3731) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/is31fl3731/is31fl3731.cmake) +endif() + set(LIB_NAME breakout_rgbmatrix5x5) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_rtc/breakout_rtc.cmake b/libraries/breakout_rtc/breakout_rtc.cmake index 3752f4213..5031cd82e 100644 --- a/libraries/breakout_rtc/breakout_rtc.cmake +++ b/libraries/breakout_rtc/breakout_rtc.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET rv3028) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/rv3028/rv3028.cmake) +endif() + set(LIB_NAME breakout_rtc) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_sgp30/breakout_sgp30.cmake b/libraries/breakout_sgp30/breakout_sgp30.cmake index 874689d9c..a9750443d 100644 --- a/libraries/breakout_sgp30/breakout_sgp30.cmake +++ b/libraries/breakout_sgp30/breakout_sgp30.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET sgp30) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/sgp30/sgp30.cmake) +endif() + set(LIB_NAME breakout_sgp30) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/breakout_trackball/breakout_trackball.cmake b/libraries/breakout_trackball/breakout_trackball.cmake index ea8f8f176..8bdf98c6f 100644 --- a/libraries/breakout_trackball/breakout_trackball.cmake +++ b/libraries/breakout_trackball/breakout_trackball.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET trackball) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/trackball/trackball.cmake) +endif() + set(LIB_NAME breakout_trackball) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/cosmic_unicorn/cosmic_unicorn.cmake b/libraries/cosmic_unicorn/cosmic_unicorn.cmake index 50aa5e091..69138ffd7 100644 --- a/libraries/cosmic_unicorn/cosmic_unicorn.cmake +++ b/libraries/cosmic_unicorn/cosmic_unicorn.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + add_library(cosmic_unicorn INTERFACE) pico_generate_pio_header(cosmic_unicorn ${CMAKE_CURRENT_LIST_DIR}/cosmic_unicorn.pio) diff --git a/libraries/galactic_unicorn/galactic_unicorn.cmake b/libraries/galactic_unicorn/galactic_unicorn.cmake index e6ff85a85..1fbcfe3a1 100644 --- a/libraries/galactic_unicorn/galactic_unicorn.cmake +++ b/libraries/galactic_unicorn/galactic_unicorn.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + add_library(galactic_unicorn INTERFACE) pico_generate_pio_header(galactic_unicorn ${CMAKE_CURRENT_LIST_DIR}/galactic_unicorn.pio) diff --git a/libraries/gfx_pack/gfx_pack.cmake b/libraries/gfx_pack/gfx_pack.cmake index dcba5dad7..626d7ca26 100644 --- a/libraries/gfx_pack/gfx_pack.cmake +++ b/libraries/gfx_pack/gfx_pack.cmake @@ -1,3 +1,19 @@ +if(NOT TARGET st7567) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/st7567/st7567.cmake) +endif() + +if(NOT TARGET button) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/button/button.cmake) +endif() + +if(NOT TARGET rgbled) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/rgbled/rgbled.cmake) +endif() + +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + set(LIB_NAME gfx_pack) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/inky_frame/inky_frame.cmake b/libraries/inky_frame/inky_frame.cmake index 1e522065f..e5644103d 100644 --- a/libraries/inky_frame/inky_frame.cmake +++ b/libraries/inky_frame/inky_frame.cmake @@ -1,11 +1,35 @@ -set(LIB_NAME inky_frame) -add_library(${LIB_NAME} INTERFACE) - -target_sources(${LIB_NAME} INTERFACE - ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp -) - -target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}) - -# Pull in pico libraries that we need -target_link_libraries(${LIB_NAME} INTERFACE hardware_i2c pico_graphics hardware_spi hardware_pwm bitmap_fonts hershey_fonts pico_stdlib sdcard fatfs pcf85063a uc8159 jpegdec) +if(NOT TARGET sdcard) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/sdcard/sdcard.cmake) +endif() + +if(NOT TARGET fatfs) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/fatfs/fatfs.cmake) +endif() + +if(NOT TARGET pcf85063a) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/pcf85063a/pcf85063a.cmake) +endif() + +if(NOT TARGET uc8159) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/uc8159/uc8159.cmake) +endif() + +if(NOT TARGET jpegdec) + include(${CMAKE_CURRENT_LIST_DIR}/../jpegdec/jpegdec.cmake) +endif() + +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + +set(LIB_NAME inky_frame) +add_library(${LIB_NAME} INTERFACE) + +target_sources(${LIB_NAME} INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp +) + +target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}) + +# Pull in pico libraries that we need +target_link_libraries(${LIB_NAME} INTERFACE hardware_i2c pico_graphics hardware_spi hardware_pwm bitmap_fonts hershey_fonts pico_stdlib sdcard fatfs pcf85063a uc8159 jpegdec) diff --git a/libraries/inky_frame_7/inky_frame_7.cmake b/libraries/inky_frame_7/inky_frame_7.cmake index e06cde18c..c5f49ea33 100644 --- a/libraries/inky_frame_7/inky_frame_7.cmake +++ b/libraries/inky_frame_7/inky_frame_7.cmake @@ -1,13 +1,41 @@ -set(LIB_NAME inky_frame_7) -add_library(${LIB_NAME} INTERFACE) - -target_sources(${LIB_NAME} INTERFACE - ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp -) - -target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}) - -# Pull in pico libraries that we need -target_link_libraries(${LIB_NAME} INTERFACE hardware_i2c pico_graphics hardware_spi hardware_pwm bitmap_fonts hershey_fonts pico_stdlib sdcard fatfs pcf85063a psram_display inky73 jpegdec) - +if(NOT TARGET sdcard) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/sdcard/sdcard.cmake) +endif() + +if(NOT TARGET fatfs) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/fatfs/fatfs.cmake) +endif() + +if(NOT TARGET pcf85063a) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/pcf85063a/pcf85063a.cmake) +endif() + +if(NOT TARGET psram_display) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/psram_display/psram_display.cmake) +endif() + +if(NOT TARGET inky73) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/inky73/inky73.cmake) +endif() + +if(NOT TARGET jpegdec) + include(${CMAKE_CURRENT_LIST_DIR}/../jpegdec/jpegdec.cmake) +endif() + +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + +set(LIB_NAME inky_frame_7) +add_library(${LIB_NAME} INTERFACE) + +target_sources(${LIB_NAME} INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}.cpp +) + +target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}) + +# Pull in pico libraries that we need +target_link_libraries(${LIB_NAME} INTERFACE hardware_i2c pico_graphics hardware_spi hardware_pwm bitmap_fonts hershey_fonts pico_stdlib sdcard fatfs pcf85063a psram_display inky73 jpegdec) + target_compile_options(${LIB_NAME} INTERFACE -Wno-error=reorder) \ No newline at end of file diff --git a/libraries/interstate75/interstate75.cmake b/libraries/interstate75/interstate75.cmake index 959e3c2f6..3b439cc48 100644 --- a/libraries/interstate75/interstate75.cmake +++ b/libraries/interstate75/interstate75.cmake @@ -1,3 +1,19 @@ +if(NOT TARGET hub75) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/hub75/hub75.cmake) +endif() + +if(NOT TARGET button) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/button/button.cmake) +endif() + +if(NOT TARGET rgbled) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/rgbled/rgbled.cmake) +endif() + +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + set(LIB_NAME interstate75) add_library(${LIB_NAME} INTERFACE) diff --git a/libraries/inventor2040w/inventor.cmake b/libraries/inventor2040w/inventor.cmake index d2826cfaf..9bcafb446 100644 --- a/libraries/inventor2040w/inventor.cmake +++ b/libraries/inventor2040w/inventor.cmake @@ -1,3 +1,19 @@ +if(NOT TARGET motor) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/motor/motor.cmake) +endif() + +if(NOT TARGET servo) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/servo/servo.cmake) +endif() + +if(NOT TARGET encoder) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/encoder/encoder.cmake) +endif() + +if(NOT TARGET plasma) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/plasma/plasma.cmake) +endif() + add_library(inventor INTERFACE) target_sources(inventor INTERFACE @@ -7,4 +23,4 @@ target_sources(inventor INTERFACE target_include_directories(inventor INTERFACE ${CMAKE_CURRENT_LIST_DIR}) # Pull in pico libraries that we need -target_link_libraries(inventor INTERFACE pico_stdlib hardware_pwm hardware_pio hardware_i2c pimoroni_i2c motor servo encoder plasma pimoroni_i2c) \ No newline at end of file +target_link_libraries(inventor INTERFACE pico_stdlib hardware_pwm hardware_pio hardware_i2c pimoroni_i2c motor servo encoder plasma) \ No newline at end of file diff --git a/libraries/motor2040/motor2040.cmake b/libraries/motor2040/motor2040.cmake index 647c53c78..abf375073 100644 --- a/libraries/motor2040/motor2040.cmake +++ b/libraries/motor2040/motor2040.cmake @@ -1,3 +1,19 @@ +if(NOT TARGET plasma) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/plasma/plasma.cmake) +endif() + +if(NOT TARGET motor) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/motor/motor.cmake) +endif() + +if(NOT TARGET motor_cluster) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/motor/motor_cluster.cmake) +endif() + +if(NOT TARGET encoder) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/encoder/encoder.cmake) +endif() + add_library(motor2040 INTERFACE) target_include_directories(motor2040 INTERFACE ${CMAKE_CURRENT_LIST_DIR}) diff --git a/libraries/pico_explorer/pico_explorer.cmake b/libraries/pico_explorer/pico_explorer.cmake index cece91744..ce1f2283e 100644 --- a/libraries/pico_explorer/pico_explorer.cmake +++ b/libraries/pico_explorer/pico_explorer.cmake @@ -1,5 +1,10 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/st7789/st7789.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +if(NOT TARGET st7789) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/st7789/st7789.cmake) +endif() + +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() add_library(pico_explorer INTERFACE) diff --git a/libraries/pico_motor_shim/pico_motor_shim.cmake b/libraries/pico_motor_shim/pico_motor_shim.cmake index 19b089358..5acd174ca 100644 --- a/libraries/pico_motor_shim/pico_motor_shim.cmake +++ b/libraries/pico_motor_shim/pico_motor_shim.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET motor) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/motor/motor.cmake) +endif() + add_library(pico_motor_shim INTERFACE) target_include_directories(pico_motor_shim INTERFACE ${CMAKE_CURRENT_LIST_DIR}) diff --git a/libraries/pico_scroll/pico_scroll.cmake b/libraries/pico_scroll/pico_scroll.cmake index dbbfc94d6..9838b0b91 100644 --- a/libraries/pico_scroll/pico_scroll.cmake +++ b/libraries/pico_scroll/pico_scroll.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + add_library(pico_scroll INTERFACE) set(PICO_SCROLL_SOURCES diff --git a/libraries/pico_unicorn/pico_unicorn.cmake b/libraries/pico_unicorn/pico_unicorn.cmake index ab622d8b2..a22be1ba6 100644 --- a/libraries/pico_unicorn/pico_unicorn.cmake +++ b/libraries/pico_unicorn/pico_unicorn.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + add_library(pico_unicorn INTERFACE) pico_generate_pio_header(pico_unicorn ${CMAKE_CURRENT_LIST_DIR}/pico_unicorn.pio) diff --git a/libraries/pico_wireless/pico_wireless.cmake b/libraries/pico_wireless/pico_wireless.cmake index 1a1f88d20..7881e10ed 100644 --- a/libraries/pico_wireless/pico_wireless.cmake +++ b/libraries/pico_wireless/pico_wireless.cmake @@ -1,4 +1,7 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/esp32spi/esp32spi.cmake) +if(NOT TARGET esp32spi) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/esp32spi/esp32spi.cmake) +endif() + add_library(pico_wireless INTERFACE) target_sources(pico_wireless INTERFACE diff --git a/libraries/plasma2040/plasma2040.cmake b/libraries/plasma2040/plasma2040.cmake index cebcfe6d9..de4b9e1fd 100644 --- a/libraries/plasma2040/plasma2040.cmake +++ b/libraries/plasma2040/plasma2040.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET plasma) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/plasma/plasma.cmake) +endif() + add_library(plasma2040 INTERFACE) target_include_directories(plasma2040 INTERFACE ${CMAKE_CURRENT_LIST_DIR}) diff --git a/libraries/plasma_stick/plasma_stick.cmake b/libraries/plasma_stick/plasma_stick.cmake index dbf1900f3..06d08e1ee 100644 --- a/libraries/plasma_stick/plasma_stick.cmake +++ b/libraries/plasma_stick/plasma_stick.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET plasma) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/plasma/plasma.cmake) +endif() + add_library(plasma_stick INTERFACE) target_include_directories(plasma_stick INTERFACE ${CMAKE_CURRENT_LIST_DIR}) diff --git a/libraries/servo2040/servo2040.cmake b/libraries/servo2040/servo2040.cmake index d9d409e11..17263088d 100644 --- a/libraries/servo2040/servo2040.cmake +++ b/libraries/servo2040/servo2040.cmake @@ -1,3 +1,15 @@ +if(NOT TARGET plasma) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/plasma/plasma.cmake) +endif() + +if(NOT TARGET servo) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/servo/servo.cmake) +endif() + +if(NOT TARGET servo_cluster) + include(${CMAKE_CURRENT_LIST_DIR}/../../drivers/servo/servo_cluster.cmake) +endif() + add_library(servo2040 INTERFACE) target_include_directories(servo2040 INTERFACE ${CMAKE_CURRENT_LIST_DIR}) diff --git a/libraries/stellar_unicorn/stellar_unicorn.cmake b/libraries/stellar_unicorn/stellar_unicorn.cmake index 1cce9ef5a..cb8107471 100644 --- a/libraries/stellar_unicorn/stellar_unicorn.cmake +++ b/libraries/stellar_unicorn/stellar_unicorn.cmake @@ -1,3 +1,7 @@ +if(NOT TARGET pico_graphics) + include(${CMAKE_CURRENT_LIST_DIR}/../pico_graphics/pico_graphics.cmake) +endif() + add_library(stellar_unicorn INTERFACE) pico_generate_pio_header(stellar_unicorn ${CMAKE_CURRENT_LIST_DIR}/stellar_unicorn.pio)