Skip to content

Split build process to also generate a static library#15

Open
cmair wants to merge 2 commits into
JuPfu:mainfrom
cmair:cm/hub75_library
Open

Split build process to also generate a static library#15
cmair wants to merge 2 commits into
JuPfu:mainfrom
cmair:cm/hub75_library

Conversation

@cmair
Copy link
Copy Markdown
Contributor

@cmair cmair commented May 31, 2026

To be used as a library within other CMake base projects, split the build into a static library and the demo application.
The hub75.hpp file is moved into a new include directory to provide a defined public interface to library users.
Where necessary, relative include paths including the library directory are changed just use the name of the file in question. The specific file will be found via the configured search path.

With those changes, the library can be used within another project by specifying:

# The hub75 library can be found in here
add_subdirectory(
    libraries
)

target_link_libraries(${PROJECT_NAME} hub75)

target_compile_definitions(hub75 PUBLIC
    USE_PICO_GRAPHICS=false      # set to false if you use hub75 as a library - any reference to pico_graphics is removed
    MATRIX_PANEL_WIDTH=64       # your matrix panel width
    MATRIX_PANEL_HEIGHT=32      # your matrix panel height
)

@cmair
Copy link
Copy Markdown
Contributor Author

cmair commented May 31, 2026

There are a lot of changes and I'm not sure if I got the CMake code right. "It works on my device/project". 😆
Feel free to request changes or discard the PR entirely.

@JuPfu
Copy link
Copy Markdown
Owner

JuPfu commented Jun 3, 2026

Hi Christoph,

I would like to follow your example to make the integration of LVGL more flexible, simpler, and streamlined. You wrote:

For my LVGL integration I'm using a git submodule referencing the 9.3 branch as I prefer having the upstream reference instead of a snapshot This makes it easier to switch between versions, if neccessary. I might explore CMakes FetchContent as well at some point.
Similarly, I'm using the hub75 repository as a git submodule.

I'm going to start by trying this approach with hub75_lvgl to get some initial experience with it.
Do you perhaps have any examples or recommendations for resources or ways to build my knowledge of this functionality ?

Kind regards,
Jürgen

P.S.:

I have now integrated the latest hub75 driver into hub75_lvgl.
Here are two examples of the bounce demo using two daisy-chained 64x64 matrix panels. The panels are from different manufacturers and have different chipsets, so the colors vary slightly. The video quality has been reduced so they can be uploaded here. Colours look much better viewed directly.

hub75_lvgl_9_4_0_chained_2_cols_1_row.mp4

Chained with settings CHAIN_COLS=2 and CHAIN_ROWS=1

hub75_lvgl_9_4_0_chained_1_col_2_rows.mp4

Chained with settings CHAIN_COLS=1 and CHAIN_ROWS=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants