-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Generated headers and CMake install #261
Comments
It looks like this is what As for how you can do it in the meantime: I would have a look here: https://cmake.org/cmake/help/latest/command/install.html#installing-files and probably also file-sets if you use at least CMake 3.23: https://cmake.org/cmake/help/latest/command/target_sources.html#file-sets |
On the corrosion side I think it would make sense to define a header fileset on CMake >= 3.23 for the generated headers. |
As far as a user of the The reason why I think we should not add any install rules into @jschwe I think what we should do is set a property on set_target_properties(${cxx_target}
PUBLIC
CORROSION_HEADER_DIR ${generated_dir}/include
) |
@jschwe @msvetkin Thanks so much for the prompt reply.
This is what I was looking for initially, and as you said, the implementation is incomplete yet.
Something like these solutions will be great.
It will be great if we can come up with a canonical solution in corrosion and add some documentation for this kind of usage so that users can simply follow the instructions to do it. CMake is already too hard for many people (at least for me :() and any guess during the process will make this process much harder |
There is another installation related issue which I think might be related with this issue (let me know if I need to open a new issue for it). If I try to use
Here corrosion/cmake/Corrosion.cmake Line 605 in b921fd0
my_cxx_bridge_target , the my_cxx_bridge_target-static will be linked. However, this target may require export/install to be linked.
I am not completely sure what the best approach for addressing this issue, do you think if this should be addressed in corrosion or if this should be done in corrosion users' side? If it should be done by corrosion users, what could be the recommended way to do it? Thanks. |
There probably was a misunderstanding here - I was not proposing to add any install rules directly from corrosion. AS you said this should be up to the user.
In CMake >= 3.23 this is what the For older CMake versions providing a property to read is one solution, but I guess we could also just document where the files are generated too, since the path is pretty simple and unlikely to change.
Definitely - the documentation of corrosion can certainly be improved greatly. I've been wanting to add an mdbook style documentation, so we don't have everything in one long readme and can add more examples without bloating the readme, but haven't had the time.
Please open a new issue for that. It's probably not related to the new cxxbridge integration but rather an existing problem that hasn't surfaced because there are no tests using |
I have a question about the usage of this feature. Suppose I have a C++ library
my_lib
that depends on thecxx_bridge_target
, which uses this feature to generate. Currently, the generated headers are placed under${CMAKE_CURRENT_BINARY_DIR}/corrosion_generated
directory, and with some additional sub directory path likecxxbridge/${cxx_target}
, which I have to read the corrosion code to figure out.If my C++ library
my_lib
needs to be exported and installed for external consumption, I wonder how corrosion users are expected to setup the project formy_lib
so that the generated cxx bridge related headers can be installed and consumed bymy_lib
users. Do you have any guidance on this? Thanks.Originally posted by @niyue in #244 (comment)
The text was updated successfully, but these errors were encountered: