-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (40 loc) · 1.41 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 2.8.12)
project(qt_ros)
find_package(Qt5Widgets REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs )
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(qt_ros_INCLUDE_DIRECTORIES
src
include
resources )
include_directories(${qt_ros_INCLUDE_DIRECTORIES}
${Qt5Widgets_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS} )
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp geometry_msgs
DEPENDS Qt5Widgets )
file(GLOB qt_ros_SRCS src/*.cpp)
list(REMOVE_ITEM qt_ros_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp )
file(GLOB qt_ros_HDRS include/*.h)
file(GLOB qt_ros_UIS resources/*.ui)
file(GLOB qt_ros_QRSCS resources/qrc/*.qrc)
qt5_add_resources(qt_ros_VFS ${qt_ros_QRSCS}) #VFS = Virtual File System
qt5_wrap_cpp(qt_ros_MOCS ${qt_ros_HDRS})
qt5_wrap_ui(qt_ros_UI_HDRS ${qt_ros_UIS} )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions(${Qt5Widgets_DEFINITIONS}
${catkin_DEFINITIONS} )
add_library(_qt_ros
${qt_ros_SRCS}
${qt_ros_MOCS}
${qt_ros_UI_HDRS}
${qt_ros_VFS} )
add_executable(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME}
_qt_ros
Qt5::Widgets
${catkin_LIBRARIES} )