Skip to content

Commit

Permalink
Merge pull request #5 from mwcondino/feature-export-qcgaugewidget
Browse files Browse the repository at this point in the history
Add export of qcgaugewidget Library
  • Loading branch information
AndyZe authored Apr 9, 2020
2 parents fe590fb + 9848dd7 commit b8a3263
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ find_package(catkin REQUIRED COMPONENTS

catkin_package(
INCLUDE_DIRS include ${rqt_gauges_INCLUDE_DIRECTORIES}
LIBRARIES ${PROJECT_NAME}
LIBRARIES ${PROJECT_NAME} qcgaugewidget
CATKIN_DEPENDS roscpp rqt_gui rqt_gui_cpp std_msgs
# DEPENDS system_lib
)
Expand All @@ -30,9 +30,16 @@ set (rqt_gauges_SRCS
src/rqt_gauges/my_plugin.cpp
)

# Don't need this plugin's header to export
# the generic qcgaugewidget library
set(rqt_qcgauge_HDRS
include/rqt_gauges/qcgaugewidget.h
)

# For compiling our plugin, only need the my_plugin header,
# since we'll link to `qcgaugewidget`
set(rqt_gauges_HDRS
include/rqt_gauges/my_plugin.h
include/rqt_gauges/qcgaugewidget.h
)

set(rqt_gauges_UIS
Expand All @@ -51,12 +58,14 @@ set(rqt_gauges_INCLUDE_DIRECTORIES

if("${qt_gui_cpp_USE_QT_MAJOR_VERSION} " STREQUAL "5 ")
find_package(Qt5Widgets REQUIRED)
qt5_wrap_cpp(rqt_qcgauge_MOCS ${rqt_qcgauge_HDRS})
qt5_wrap_cpp(rqt_gauges_MOCS ${rqt_gauges_HDRS})
qt5_wrap_ui(rqt_gauges_UIS_H ${rqt_gauges_UIS})
set(qt_LIBRARIES Qt5::Widgets)
else()
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
include(${QT_USE_FILE})
qt4_wrap_cpp(rqt_qcgauge_MOCS ${rqt_qcgauge_HDRS})
qt4_wrap_cpp(rqt_gauges_MOCS ${rqt_gauges_HDRS})
qt4_wrap_ui(rqt_gauges_UIS_H ${rqt_gauges_UIS})
set(qt_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
Expand All @@ -76,7 +85,10 @@ include_directories(
)

## The library that defines the Qt stuff
add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)
add_library(qcgaugewidget SHARED
src/rqt_gauges/qcgaugewidget.cpp
${rqt_qcgauge_MOCS}
)

## Specify libraries to link a library or executable target against
target_link_libraries(qcgaugewidget
Expand Down

0 comments on commit b8a3263

Please sign in to comment.