File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,28 @@ ament_export_dependencies(ament_index_cpp class_loader rcutils rcpputils tinyxml
2727ament_export_include_directories (include )
2828ament_export_targets (${PROJECT_NAME} )
2929
30+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\ +\\ +" )
31+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
32+ # Before LLVM 7.0, filesystem is part of experimental
33+ set (FILESYSTEM_LIB c++experimental)
34+ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
35+ # Before LLVM 9.0 you have to manually link the fs library
36+ set (FILESYSTEM_LIB c++fs)
37+ else ()
38+ # Starting at LLVM 9.0 filesystem is built in
39+ set (FILESYSTEM_LIB)
40+ endif ()
41+ else ()
42+ set (FILESYSTEM_LIB stdc++fs)
43+ endif ()
44+
45+ if (UNIX AND NOT APPLE )
46+ # this is needed to use the experimental/filesystem on Linux, but cannot be passed with
47+ # ament_export_libraries() because it is not absolute and cannot be found with find_library
48+ target_link_libraries (${PROJECT_NAME}
49+ INTERFACE ${FILESYSTEM_LIB} )
50+ endif ()
51+
3052install (
3153 TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
3254)
Original file line number Diff line number Diff line change @@ -44,3 +44,10 @@ endif()
4444find_package (tinyxml2_vendor REQUIRED )
4545find_package (TinyXML2 REQUIRED )
4646list (APPEND pluginlib_LIBRARIES ${TinyXML2_LIBRARIES} )
47+
48+ add_library (tinyxml2_vendor INTERFACE )
49+ target_include_directories (tinyxml2_vendor INTERFACE
50+ ${TinyXML2_INCLUDE_DIRS} )
51+ target_link_libraries (tinyxml2_vendor INTERFACE
52+ ${TinyXML2_LIBRARIES} )
53+ list (APPEND pluginlib_TARGETS tinyxml2_vendor)
You can’t perform that action at this time.
0 commit comments