-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling find_package() to find CMSIS multiple times leads to errors #326
Comments
Here's a fix proposition (not sure if this is correct though). |
It's weird to call the find_package command twice. We can hide the error but consider this : find_package(CMSIS v1.0.0 COMPONENTS STM32F4 REQUIRED)
.
.
.
#With you proposal this will fail silently (not retrieving the v2.0.0 version)
find_package(CMSIS v2.0.0 COMPONENTS STM32F4 REQUIRED) |
Of course, if we look at the modified blinky example, this may seem weird to call find_package twice. I stumbled upon this error because I have a repo for a project where multiple executables are compiled and sometime, for the same platform. For each executable, I would like to find the required CMSIS + HAL components. The error is actually located in the cmsis_generate_default_linker_script function. Maybe it would be better to place the if statement in there to avoid creating the custom targets multiple time. |
Ok, do open a PR so we can see :) |
Hi, |
Hello, |
I open a pull request with a little fix. That works for me at the moment but i dont know if anything other is broken now :-D (Think i make something wrong while linking of pullrequest and issue) Pullrequest: #343 |
Describe the bug
CMake errors are popping up when calling find_package multiple times.
Sources to reproduce
Please provide link to repository showing the problem.
link to the commit causing an issue
Steps to reproduce
Expected behavior
On the first find_package call, the behavior shall not change. On subsequent calls, already existing custom targets shall not be created again.
Environment :
The text was updated successfully, but these errors were encountered: