fixing compilation under OSX (#1126)

Surprising that this has not lead to any issues yet. 
This just works by chance on other systems if QT has been find_packaged before.
master
Sebastian Klose 2018-12-12 09:27:30 +01:00 committed by Wally B. Feed
parent 72949a7153
commit 91fd8feb62
1 changed files with 2 additions and 2 deletions

View File

@ -44,8 +44,6 @@ catkin_package(
file(GLOB_RECURSE ALL_SRCS "cartographer_rviz/*.cc" "cartographer_rviz/*.h")
set(CMAKE_AUTOMOC ON)
add_library(${PROJECT_NAME} ${ALL_SRCS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_LIBRARIES})
if(rviz_QT_VERSION VERSION_LESS "5")
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
@ -58,6 +56,8 @@ else()
include_directories(${Qt5Widgets_INCLUDE_DIRS})
endif()
add_definitions(-DQT_NO_KEYWORDS)
add_library(${PROJECT_NAME} ${ALL_SRCS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_LIBRARIES})
# Add the binary directory first, so that port.h is included after it has
# been generated.