Skip to content

Commit

Permalink
Added includes to allow for libraries to be linked to out-of-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnlak committed Aug 31, 2023
1 parent 57042bf commit 8a9ef39
Show file tree
Hide file tree
Showing 43 changed files with 326 additions and 52 deletions.
2 changes: 1 addition & 1 deletion drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 4 additions & 0 deletions drivers/inky73/inky73.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions drivers/motor/motor.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions drivers/motor/motor_cluster.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion drivers/rgbled/rgbled.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 4 additions & 0 deletions drivers/servo/servo.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions drivers/servo/servo_cluster.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
26 changes: 14 additions & 12 deletions libraries/automation2040w/automation.cmake
Original file line number Diff line number Diff line change
@@ -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)
34 changes: 23 additions & 11 deletions libraries/badger2040/badger2040.cmake
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 4 additions & 0 deletions libraries/breakout_as7262/breakout_as7262.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_bh1745/breakout_bh1745.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_dotmatrix/breakout_dotmatrix.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_encoder/breakout_encoder.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
8 changes: 8 additions & 0 deletions libraries/breakout_encoder_wheel/breakout_encoder_wheel.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_ioexpander/breakout_ioexpander.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_ltr559/breakout_ltr559.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_matrix11x7/breakout_matrix11x7.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_mics6814/breakout_mics6814.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_msa301/breakout_msa301.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_paa5100/breakout_paa5100.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_pmw3901/breakout_pmw3901.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_potentiometer/breakout_potentiometer.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_rgbmatrix5x5/breakout_rgbmatrix5x5.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_rtc/breakout_rtc.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_sgp30/breakout_sgp30.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/breakout_trackball/breakout_trackball.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions libraries/cosmic_unicorn/cosmic_unicorn.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 4 additions & 0 deletions libraries/galactic_unicorn/galactic_unicorn.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
16 changes: 16 additions & 0 deletions libraries/gfx_pack/gfx_pack.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
46 changes: 35 additions & 11 deletions libraries/inky_frame/inky_frame.cmake
Original file line number Diff line number Diff line change
@@ -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)
52 changes: 40 additions & 12 deletions libraries/inky_frame_7/inky_frame_7.cmake
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit 8a9ef39

Please sign in to comment.