Open Joaliasbarb opened 1 year ago
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, did you have any news here?
Hello, Do not hesitate to open request so we can discuss the changes.
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 :