You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d like to contribute CMake integration for this repository, enabling projects that use CMake to easily consume it as a dependency.
Proposal
Find Package Support
Add support to allow this repository to be discovered via CMake’s find_package() command. This involves providing a Find<package>.cmake module file, where <package> is a name representing this repository.
For example: FindSTM32CubeH7.cmake.
Usage
Fetching the Repository
Consuming projects would include the following in their CMake configuration:
This fetches the repository (including submodules) into the CMake build directory.
The CMAKE_MODULE_PATH is then updated to include the repository path, so CMake can find the custom FindSTM32CubeH7.cmake file during find_package() calls.
Finding the Package
Once fetched, the consuming project would locate and request specific components using:
This locates FindSTM32CubeH7.cmake and triggers additional includes for CMake files within this repository that manage locating source files for the requested components.
In the example above, the consuming project requests the rcc, gpio, i2c, and usb_hid_device drivers. The added CMake support will identify the relevant source files and configure them into a library for the consuming project.
Linking
Finally, the consuming project would link against the created library using:
Where <target> is the name of the executable or library target defined by the consuming project via add_executable() or add_library().
Summary
This proposal improves CMake interoperability for this repository, making it easier to integrate into modern, CMake-based embedded projects via standard tooling like FetchContent and find_package().
The text was updated successfully, but these errors were encountered:
Here is a high-level overview of the CMake infrastructure being considered:
This may change slightly as it's being implemented, but I don't expect it to change too much. Any suggestions or concerns are welcome!
The priority would be to get CMake support implemented for CMSIS and HAL elements as those are necessary for starting a new project with this firmware package, along with a test project to ensure functionality. Afterwards, the priority would shift to the BSP and Components elements, then finally for Middleware elements.
Let me know if anyone has any questions, comments, or concerns. Thank you.
Overview
I’d like to contribute CMake integration for this repository, enabling projects that use CMake to easily consume it as a dependency.
Proposal
Find Package Support
Add support to allow this repository to be discovered via CMake’s
find_package()
command. This involves providing aFind<package>.cmake
module file, where<package>
is a name representing this repository.For example:
FindSTM32CubeH7.cmake
.Usage
Fetching the Repository
Consuming projects would include the following in their CMake configuration:
This fetches the repository (including submodules) into the CMake build directory.
The
CMAKE_MODULE_PATH
is then updated to include the repository path, so CMake can find the customFindSTM32CubeH7.cmake
file duringfind_package()
calls.Finding the Package
Once fetched, the consuming project would locate and request specific components using:
find_package( STM32CubeH7 COMPONENTS rcc gpio i2c usb_hid_device REQUIRED )
This locates
FindSTM32CubeH7.cmake
and triggers additional includes for CMake files within this repository that manage locating source files for the requested components.In the example above, the consuming project requests the
rcc
,gpio
,i2c
, andusb_hid_device
drivers. The added CMake support will identify the relevant source files and configure them into a library for the consuming project.Linking
Finally, the consuming project would link against the created library using:
Where
<target>
is the name of the executable or library target defined by the consuming project viaadd_executable()
oradd_library()
.Summary
This proposal improves CMake interoperability for this repository, making it easier to integrate into modern, CMake-based embedded projects via standard tooling like
FetchContent
andfind_package()
.The text was updated successfully, but these errors were encountered: