fix wrong FOUND flag on repeated inclusion#146
Conversation
mikaelarguedas
left a comment
There was a problem hiding this comment.
lgtm
Nit: comment L5 should be on L10 shouldn't it ?
|
Can you provide details on what should be tested on the resulting archive ? |
The comment in line 5 covers the whole code block so i think the current position makes sense. |
See ros2/ros2#544. |
|
In the overlay case the variable seems to actually be undefined. So replacing the |
|
Building a new fat archive is in progress: https://ci.ros2.org/job/ci_packaging_linux/127/ |
|
Reproduced the issue with the Bouncy archive and confirmed that the new archive, while printing multiple CMake warnings, can successfully compile and run test from |
Without this patch if a first find of a package sets the
FOUNDflag toFALSEa repeated find would set the flag toTRUE(which happens implicitly by CMake). While setting it explicitly toFALSEin a CMake config file results in a CMake warning that is at least better then setting the wrong flag.The first condition to check if the variable is actually being defined can only fail if the variable was set explicitly manually (which should never be the case) or when the CMake config file is being included recursive (which shouldn't be done, ros2/rmw_implementation#44 fixes that case for the
rmw_implementationpackage).A fat archive with these changes is available from this build: https://ci.ros2.org/job/ci_packaging_linux/126/
Connect to ros2/ros2#544.