-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
150 lines (132 loc) · 3.39 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
cmake_minimum_required(VERSION 3.11)
project(qmlcmake)
add_compile_options(-std=c++14)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
###################################
# Attention! Need use gold linker #
# to avoid multiple definition #
# '__bss_start' in QQuickStyle #
###################################
if (UNIX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
if ("${ld_version}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
endif()
endif()
###################################
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
rviz
)
# Qt5
find_package(Qt5 COMPONENTS
Core
Qml
Quick
WebView
Widgets
QuickControls2
Sql
REQUIRED
)
set(TARGET_HDR
include/ros_wrapper.h
include/simplegrid.h
include/displayconfig.h
include/robot_model.h
# include/my_rviz.h
# src/log_model.h
# src/base_module.h
# src/weight_module.h
# src/festo_module.h
# src/flexbe_module.h
# src/model.h
# src/scenario_model.h
# src/stz_module.h
# src/manipulator_module.h
# src/scenarioparser.h
)
set(TARGET_SRC
# src/log_model.cpp
# src/base_module.cpp
src/main.cpp
src/ros_wrapper.cpp
src/simplegrid.cpp
src/displayconfig.cpp
src/robot_model.cpp
# src/my_rviz.cpp
# src/weight_module.cpp
# src/festo_module.cpp
# src/flexbe_module.cpp
# src/model.cpp
# src/scenario_model.cpp
# src/stz_module.cpp
# src/manipulator_module.cpp
# src/scenarioparser.cpp
)
set(RESOURCES
src/qml.qrc
# src/imports/FalloutTheme/qmldir
# src/imports/FalloutTheme/FalloutTheme.qml
)
###################################
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS
src
include
CATKIN_DEPENDS
roscpp
std_msgs
)
###########
## Build ##
###########
qt5_wrap_cpp(${PROJECT_NAME}_MOCS ${TARGET_HDR})
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/src/imports
${CMAKE_SOURCE_DIR}/src/CustomItems
# /opt/Qt5_15/5.15.0
CACHE STRING "" FORCE)
qt5_add_resources(${PROJECT_NAME}_QML src/qml.qrc)
include_directories(
include
${catkin_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}
${Qt5Widgets_INCLUDE_DIRS}
# ${CMAKE_SOURCE_DIR}/src/imports/FalloutTheme/
# ${CMAKE_SOURCE_DIR}/src/CustomItems/
)
add_executable(${PROJECT_NAME}
${TARGET_SRC}
${QT_RESOURCES_CPP}
${${PROJECT_NAME}_MOCS}
${${PROJECT_NAME}_QML}
${RESOURCES}
${TARGET_HDR}
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
Qt5::Core
Qt5::Qml
Qt5::Quick
Qt5::QuickControls2
Qt5::Sql
Qt5::WebView
)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
get_target_property(QtCore_location Qt5::Core LOCATION)
# Копироваие скрипта с для поиска по сценариям
#configure_file(${CMAKE_SOURCE_DIR}/src/find_scenarios.py
# ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}/find_scenarios.py
# COPYONLY)
#configure_file(${CMAKE_SOURCE_DIR}/src/find_scenarios.py
# $ENV{HOME}/.ros/find_scenarios.py
# COPYONLY)