Bash cmake command not found pi4/1/2023 ![]() ![]() The EXPORT notation of the install call requires additional attention: This is done by copying the headers via install(DIRECTORY DESTINATION ) as described above. Regarding the include directory, the install command only adds information to CMake, it does not actually install the includes folder. It is therefore advised to not leave out the RUNTIME install even when developing libraries on Unix based systems. Windows DLLs are treated as runtime artifacts and installed into the RUNTIME DESTINATION folder. The first install commands installs the header files which should be available to clients. This is necessary so that the user of the library does not have to call find_package for those dependencies, too. The ament_export_dependencies exports dependencies to downstream packages. This is necessary to allow your library’s clients to use the target_link_libraries(client my_library::my_library) syntax.Īment_export_targets can take an arbitrary list of targets named as EXPORT in an install call and an additional option HAS_LIBRARY_TARGET, which adds potential libraries to environment variables. The ament_export_targets macro exports the targets for CMake. Here is what’s happening in the snippet above: Note that it is not necessary to put all headers into a separate folder, only those that should be included by clients. Here, we assume that the folder include contains the headers which need to be exported. Instead of adding to ament_package, you can also add to the variable $_CONFIG_EXTRAS_POSTĪment_export_targets ( my_libraryTargets HAS_LIBRARY_TARGET ) ament_export_dependencies ( some_dependency ) install ( DIRECTORY include/ DESTINATION include ) install ( TARGETS my_library EXPORT my_libraryTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) While CONFIG_EXTRAS files are included before the files generated for the ament_export_* calls the files from CONFIG_EXTRAS_POST are included afterwards. cmake.in templates expanded by configure_file()) which should be available to clients of the package.įor an example of when to use these arguments, see the discussion in Adding resources.įor more information on how to use template files, see the official documentation.ĬONFIG_EXTRAS_POST: same as CONFIG_EXTRAS, but the order in which the files are added differs. Since ament_package() gathers a lot of information from the CMakeLists.txt it should be the last call in your CMakeLists.txt.Īlthough it is possible to follow calls to ament_package() by calls to install functions copying files and directories, it is simpler to just keep ament_package() the last call.Īment_package can be given additional arguments:ĬONFIG_EXTRAS: a list of CMake files (. The project setup is done by ament_package() and this call must occur exactly once per package.Īment_package() installs the package.xml, registers the package with the ament index, and installs config (and possibly target) files for CMake so that it can be found by other packages using find_package. The argument to project will be the package name and must be identical to the package name in the package.xml.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |