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
Is it possible to use bin types? #60
Comments
Yep, that's definitely supported! You're going to want to do something like this: add_custom_command(
OUTPUT my_output.txt
COMMAND $<TARGET_PROPERTY:my-bin-crate,IMPORTED_LOCATION> -o my_output.txt
) |
You might not need the generator expression if you're just using it for install, though. The generator expression is mostly to make sure that my-bin-crate is built before trying to build my_output.txt (it sets up the dependencies correctly). To customize install, you'll need to write an install script, which can then use your bin crate after you've built: https://cmake.org/cmake/help/latest/command/install.html?highlight=install#script |
I will have to read up on this (I am not a cmake expert). Typically for C++ projects using catkin this goes something like: cmake_minimum_required(VERSION 3.0.2)
project(publisher_node)
find_package(catkin REQUIRED)
catkin_package()
add_executable(${PROJECT_NAME}_node src/ros_test_node.cpp)
install(TARGETS ${PROJECT_NAME}_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
) I was hoping for a way to just refer to the crate output in |
Oh, I misunderstood. I thought you were trying to use the bin as part of install. You just want to install the bin. Yeah, unfortunately CMake doesn't let you refer to imported targets in The function "signature" for corrosion_install is here: https://github.com/AndrewGaspar/corrosion/blob/master/cmake/Corrosion.cmake#L327 |
Thanks for the advice. |
It's not out of the question, but it's probably not priority for v0.1 - currently libs and bins aren't even copied out of the cargo build directories. I've filed an issue: #65 |
Looks like the original issue was solved, and a separate issue was created for the documentation. Feel free to reopen if I'm missing something. |
I'm looking into building some ROS nodes using a combination of corrosion and https://github.com/adnanademovic/rosrust
The examples show linking cpp and rust together but what I want to do is use corrosion to build my rust binary and then refer to it elsewhere in my cmake file (for instance in an install step).
The text was updated successfully, but these errors were encountered: