-
Notifications
You must be signed in to change notification settings - Fork 76
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
fix: export targets and cmake files, add BUILD_TESTING check #18
Conversation
CMakeLists.txt
Outdated
|
||
add_subdirectory(test) | ||
add_subdirectory(third_party) | ||
find_package(fmt REQUIRED) |
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.
github ci can't find the fmt package, is this line still needed?
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.
Ah, I had fmt in my build environment already so I didn't need to check out the submodules.
Having a look at the code, it can be removed as a dependency from the core library quite easily as it's only called in two or three places for trivial things. Do you think this is suitable?
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.
I have added libfmt-dev in ci, but it reports error:
install(EXPORT "asyncioTargets" ...) includes target "asyncio" which requires target "fmt" that is not in any export set.
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.
Took a second to figure out what was going on there, but because this is EXPORTing the asyncio target, any dependencies to that target need to be EXPORTed as well (which we can't do for fmt
as it's a dependency). CMake stuff is always annoying, the simplest fix is to use the system fmt lib (because that has been properly exported) or remove the fmt lib dep altogether as per my above suggestion.
9889781
to
a064faa
Compare
I was unable to use the cmake project in my build environment because it was using non-standard variables for INSTALL paths and included cmake files. I was also unable to use the
asyncio
target when adding it as a dependency to my project's link_libraries.This fixes the cmake to be more standard.