-
Notifications
You must be signed in to change notification settings - Fork 654
Add the path to the binary include dir #2312
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
base: main
Are you sure you want to change the base?
Add the path to the binary include dir #2312
Conversation
baentsch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @mmarock as well as the explanation of its value. I've got a question though whether the proposed solution is indeed the right one: By changing "target_include_directories" this seems to adapt the "include directories to use when compiling a given target. ". Wouldn't it be more accurate to specify the include directories when using the library instead, i.e., change/set the INCLUDES_DIRECTORIES property here? It may be so that your proposal only works because your proposed addition is getting silently propagated to the exported INCLUDE_DIRECTORIES property, but anyone looking at this in the future may remove it because this is not required during build.
In other words: Could you please try changing the set_target_properties command instead to see whether this solves the problem too? If so, please change this PR to land it. Thanks!
|
Hello @baentsch, I think you have a good point about using and building the library and I can offer two solutions which seem to work and do not pollute the library build: Either: Or: I like using the provided functions a bit more but I'd like to hear you opinion :-) |
|
Thanks for giving this a try @mmarock ! And indeed, you're absolutely right using INTERFACE_INCLUDE_DIRECTORIES. My personal preference would be the first option if that works: Just syntactically, it signals that this is about setting a property for users. The second option --to me personally-- at first glance may look like just a normal build option for the target. |
|
Thanks @mmarock for the update. The code LGTM so I triggered the CI run. If it passes, I'll approve. You might need to re-base before merge, though. |
…nstalled later) Signed-off-by: Marcel Marock <[email protected]>
…lding Signed-off-by: Marcel Marock <[email protected]>
9b9a5d7 to
03cc1f1
Compare
Purpose of this pull request is to allow building/using this library with cmake FetchContent.
FetchContent downloads/builds the given dependency and introduces its targets into the parent project.
In that case custom targets may build custom code and directly link to the liboqs oqs target.
But currently the built include dir is not forwarded in the build interface and it may not be used.
Sample cmake and main.c is included. After applying the change in this pull request this will work.
CMakeLists.txt
main.c
No issue is fixed, I don't know if this is considered an issue?
No change in a cryptographic algorithm.
No AI used.