Skip to content

Commit 09bc9ad

Browse files
authored
Merge pull request #34 from isys-vision/cmake-automoc
use automoc feature of CMake
2 parents 4d7ecec + bbf658b commit 09bc9ad

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ find_package(Boost REQUIRED COMPONENTS thread )
1313
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
1414
set(QT_LIBRARIES Qt5::Widgets)
1515

16+
set(CMAKE_AUTOMOC ON)
17+
1618
add_definitions(-DQT_NO_KEYWORDS)
1719

1820
catkin_package(
@@ -35,19 +37,17 @@ link_directories(${catkin_LIBRARY_DIRS}
3537
${OCTOMAP_LIBRARY_DIRS})
3638

3739

38-
QT5_WRAP_CPP(MOC_FILES
39-
include/octomap_rviz_plugins/occupancy_grid_display.h
40-
include/octomap_rviz_plugins/occupancy_map_display.h
41-
OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED -DBOOST_LEXICAL_CAST_INCLUDED
42-
)
43-
4440
set(SOURCE_FILES
4541
src/occupancy_grid_display.cpp
46-
src/occupancy_map_display.cpp
47-
${MOC_FILES}
42+
src/occupancy_map_display.cpp
43+
)
44+
45+
set(HEADER_FILES
46+
include/octomap_rviz_plugins/occupancy_grid_display.h
47+
include/octomap_rviz_plugins/occupancy_map_display.h
4848
)
4949

50-
add_library(${PROJECT_NAME} MODULE ${SOURCE_FILES})
50+
add_library(${PROJECT_NAME} MODULE ${SOURCE_FILES} ${HEADER_FILES})
5151
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES} ${catkin_LIBRARIES})
5252
target_compile_options(${PROJECT_NAME} PUBLIC "-Wno-register") # Avoid OGRE deprecaton warnings under C++17
5353

0 commit comments

Comments
 (0)