Build statically but position independent code

- This is necessary to link against shared libraries on Linux
This commit is contained in:
Alessandro Bottero 2018-03-13 16:04:54 +01:00 committed by Martin Idel
parent 8fb9c51bf8
commit c6c6e833fe

View File

@ -26,13 +26,15 @@ include_directories(include
) )
add_library(laser_geometry src/laser_geometry.cpp) add_library(laser_geometry src/laser_geometry.cpp)
target_link_libraries(laser_geometry target_link_libraries(laser_geometry
${angles_LIBRARIES} ${angles_LIBRARIES}
${rclcpp_LIBRARIES} ${rclcpp_LIBRARIES}
${sensor_msgs_LIBRARIES} ${sensor_msgs_LIBRARIES}
${tf2_LIBRARIES} ${tf2_LIBRARIES}
) )
set_property(TARGET laser_geometry PROPERTY POSITION_INDEPENDENT_CODE ON)
ament_export_include_directories(include) ament_export_include_directories(include)
ament_export_interfaces(laser_geometry) ament_export_interfaces(laser_geometry)
ament_export_libraries(laser_geometry) ament_export_libraries(laser_geometry)