-
Notifications
You must be signed in to change notification settings - Fork 321
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
Consuming Bond with FindPackage (and using modern CMake) #1013
Comments
Yes, please submit PRs for these. No one who works on Bond is a CMake expert, so we're happy to have help! For the |
Thank you for the feedback! The options that you currently provide for "add_bond_codegen" make a lot of sense, though I don't really get the Also I'd prefer to add another function, maybe called Also are you set on the bond generation functions to be called Also, do you have any requirements on the Also I can just see how far I get, create a PR and we can discuss the changes. |
I have made a first draft which allows installation / consumption of Bond via CMake.
|
Thank you for your patience. I've been traveling for the Thanksgiving holiday in the United States and am just catching up on things now.
The
That makes sense to me. The pattern would be something like this, I assume: add_library(foo source1.cpp source2.cpp)
bond_target_cpp(foo source3.bond)
add_executable(bar source3.cpp)
target_link_libraries(bar foo)
bond_target_cpp(bar source4.bond) Would
The name can be changed.
We still need to stay compatible with Ubuntu 16.04. Raising the minimum to CMake 3.5.1 is fine, but beyond that is a larger discussion where we'd need to weigh pros and cons.
Bond requires Boost to be findable on the system both to build Bond and to consume Bond. A CMake install of Bond should not install Boost. Similarly for RapidJSON. However, historically, RapidJSON has been provided by Bond via a submodule and its headers have been installed by a CMake install, unless
None of the examples rely on Bond internals. The import example's The C# MSBuild code generation targets have a similar pattern using a MSBuild variable |
I am trying to integrate Bond with our buildsystem to evaluate it properly, but I am running into various problems:
BondConfig.cmake
file, which can be consumed by other projectscmake/Bond.cmake
, like theadd_bond_codegen
function.bond.cmake
(which is good), but they include absolute paths to the boost library. Hence, the bond package is not relocatable, and I cannot distribute a bond package build by a CI server to be consumed by the users.If bond used modern CMake, imported targets for libraries, code generation functions and provided a
BondConfig.cmake
file, it would be much easier to integrate.Would you be interested for me to work on a PR to address this issues? I am not quite sure how much work it will be, I have not yet looked at all of the CMake files for this project yet.
The text was updated successfully, but these errors were encountered: