Use imported targets. (#246)

master
Damon Kohler 2017-01-09 14:22:20 +01:00 committed by Holger Rapp
parent 6d61394c3c
commit e6e3730dde
2 changed files with 6 additions and 11 deletions

View File

@ -89,19 +89,17 @@ list(REMOVE_ITEM ALL_SRCS ${ALL_EXECUTABLES})
add_library(${PROJECT_NAME} ${ALL_SRCS}) add_library(${PROJECT_NAME} ${ALL_SRCS})
add_subdirectory("cartographer_ros") add_subdirectory("cartographer_ros")
target_include_directories(${PROJECT_NAME} PUBLIC ${CARTOGRAPHER_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} PUBLIC cartographer)
target_link_libraries(${PROJECT_NAME} PUBLIC ${CARTOGRAPHER_LIBRARIES})
# YAML # YAML
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${YAMLCPP_INCLUDE_DIRS}") target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${YAMLCPP_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${YAMLCPP_LIBRARIES}) target_link_libraries(${PROJECT_NAME} PUBLIC ${YAMLCPP_LIBRARIES})
# Lua # Lua
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${LUA_INCLUDE_DIR}) target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${LUA_INCLUDE_DIR})
# PCL # PCL
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${PCL_INCLUDE_DIRS})
"${PCL_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${PCL_LIBRARIES}) target_link_libraries(${PROJECT_NAME} PUBLIC ${PCL_LIBRARIES})
foreach(DEFINITION ${PCL_DEFINITIONS}) foreach(DEFINITION ${PCL_DEFINITIONS})
set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${DEFINITION}") set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${DEFINITION}")
@ -142,8 +140,7 @@ if (CATKIN_ENABLE_TESTING)
target_include_directories(configuration_files_test SYSTEM PUBLIC ${catkin_INCLUDE_DIRS}) target_include_directories(configuration_files_test SYSTEM PUBLIC ${catkin_INCLUDE_DIRS})
target_link_libraries(configuration_files_test ${catkin_LIBRARIES}) target_link_libraries(configuration_files_test ${catkin_LIBRARIES})
add_dependencies(configuration_files_test ${catkin_EXPORTED_TARGETS}) add_dependencies(configuration_files_test ${catkin_EXPORTED_TARGETS})
target_include_directories(configuration_files_test SYSTEM PUBLIC ${CARTOGRAPHER_INCLUDE_DIRS}) target_link_libraries(configuration_files_test cartographer)
target_link_libraries(configuration_files_test ${CARTOGRAPHER_LIBRARIES})
target_link_libraries(configuration_files_test ${PROJECT_NAME}) target_link_libraries(configuration_files_test ${PROJECT_NAME})
set_target_properties(configuration_files_test PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS}) set_target_properties(configuration_files_test PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
@ -155,8 +152,7 @@ if (CATKIN_ENABLE_TESTING)
target_include_directories(time_conversion_test SYSTEM PUBLIC ${catkin_INCLUDE_DIRS}) target_include_directories(time_conversion_test SYSTEM PUBLIC ${catkin_INCLUDE_DIRS})
target_link_libraries(time_conversion_test ${catkin_LIBRARIES}) target_link_libraries(time_conversion_test ${catkin_LIBRARIES})
add_dependencies(time_conversion_test ${catkin_EXPORTED_TARGETS}) add_dependencies(time_conversion_test ${catkin_EXPORTED_TARGETS})
target_include_directories(time_conversion_test SYSTEM PUBLIC ${CARTOGRAPHER_INCLUDE_DIRS}) target_link_libraries(time_conversion_test cartographer)
target_link_libraries(time_conversion_test ${CARTOGRAPHER_LIBRARIES})
target_link_libraries(time_conversion_test ${PROJECT_NAME}) target_link_libraries(time_conversion_test ${PROJECT_NAME})
set_target_properties(time_conversion_test PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS}) set_target_properties(time_conversion_test PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
endif() endif()

View File

@ -68,8 +68,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
$<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
) )
target_include_directories(${PROJECT_NAME} PUBLIC ${CARTOGRAPHER_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} PUBLIC cartographer)
target_link_libraries(${PROJECT_NAME} PUBLIC ${CARTOGRAPHER_LIBRARIES})
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
"${EIGEN3_INCLUDE_DIR}") "${EIGEN3_INCLUDE_DIR}")