Fix small bug in finding mlpack if downloaded as dependency#3900
Merged
shrit merged 2 commits intomlpack:masterfrom Feb 28, 2025
Merged
Fix small bug in finding mlpack if downloaded as dependency#3900shrit merged 2 commits intomlpack:masterfrom
shrit merged 2 commits intomlpack:masterfrom
Conversation
Since mlpack include is inside a `src/` directory, this is make it more complicated for CMake to find mlpack path if it is pulled as a dependency by the user. Therefore, to fix this we are setting directly the INCLUDE_PATH as the SEARCH_PATH as long as mlpack.hpp is found. Other minor fixes are related to if /else logic. This will allow to set the directories when we find the library in a second round. Signed-off-by: Omar Shrit <omar@avontech.fr>
rcurtin
reviewed
Feb 26, 2025
Member
rcurtin
left a comment
There was a problem hiding this comment.
I think I may have found a bug or two in the fix, let me know what you think. 👍
| endif() | ||
| endif() | ||
| if (CEREAL_FOUND) | ||
| set(MLPACK_INCLUDE_DIRS ${MLPACK_INCLUDE_DIRS} ${CEREAL_INCLUDE_DIR}) |
Member
There was a problem hiding this comment.
Ah, I missed this on the initial review! It seems so obvious to see now. Anyway, glad to have it fixed 😄
Signed-off-by: Omar Shrit <omar@avontech.fr>
rcurtin
approved these changes
Feb 27, 2025
Member
rcurtin
left a comment
There was a problem hiding this comment.
Thanks for the fix. Looks good to me now 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since mlpack include is inside a
src/directory, this is make it more complicated for CMake to find mlpack path if it is pulled as a dependency by the user. Therefore, to fix this we are setting directly the INCLUDE_PATH as the SEARCH_PATH as long as mlpack.hpp is found.Other minor fixes are related to if /else logic. This will allow to set the directories when we find the library in a second round.