From 91fd8feb62df8a23b1d1b7413668dd86cb370a48 Mon Sep 17 00:00:00 2001 From: Sebastian Klose Date: Wed, 12 Dec 2018 09:27:30 +0100 Subject: [PATCH] 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. --- cartographer_rviz/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cartographer_rviz/CMakeLists.txt b/cartographer_rviz/CMakeLists.txt index 84c73c9..24bbdd7 100644 --- a/cartographer_rviz/CMakeLists.txt +++ b/cartographer_rviz/CMakeLists.txt @@ -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.