# Proper runtime executable install location

I thought I'd ask for official clarification here because I've seen conflicting information from different sources. Until recently, I understood that we should be placing node executables under lib/${PROJECT_NAME} via the RUNTIME category of the CMake install command. This seems like the only place ros2 run and ros2 launch find them. However, after doing some Windows development, I discovered shared libraries (.dlls) have to go under bin/ in the install space, and they also fall under the RUNTIME category. This is also recommended by the current ament_cmake documentation. So what is the proper thing to do here? Is everything shifting to being installed under bin/ and the ros2 commands need to be updated to see those files? Or is the expectation now that executable and library targets should always be installed with separate install() commands into the two different places? edit retag close merge delete ## 1 Answer Sort by » oldest newest most voted The recommended best practice is still to have your executables in lib/${PROJECT_NAME}, so as to not pollute the PATH and to reduce the chances of file collisions from different packages.

Your second guess it what I think you need to do, have separate install() commands for libraries and executables. I don't think we have any good examples of packages that have both executables and libraries in them, but we have examples of packages that install executables and others that install libraries, e.g.:

Also, when using the install statement that the ament documentation suggests (the one you linked to) it will handle installing .dll files to bin for you, placing the .lib files in lib instead. So you shouldn't need to do anything else for Windows.

more

Thanks for explaining the rationale. I'll probably switch to a style of a separate install command per target now, since I always sort-of felt that would be cleaner way of organizing the CMake code anyways.

( 2020-12-18 19:34:00 -0500 )edit

## Stats

Seen: 75 times

Last updated: Dec 18 '20