-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
100 lines (82 loc) · 2.77 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
cmake_minimum_required(VERSION 3.5)
project(ros_sensors_qt512_ndk19 LANGUAGES CXX)
#set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC TRUE)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(BUILD_SHARED_LIBS OFF)
find_package(Qt5 COMPONENTS Widgets Gui Core Quick Positioning Sensors REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(fastrtps_cmake_module REQUIRED)
find_package(fastrtps REQUIRED CONFIG)
find_package(tf2 REQUIRED)
include_directories(
include/
${rclcpp_INCLUDE_DIRS}
${std_msgs_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS}
${tf2_INCLUDE_DIRS}
)
if(ANDROID)
add_library(ros_sensors_qt512_ndk19 SHARED
src/main.cpp
include/gps_spitter.h
src/gps_spitter.cpp
qml.qrc)
else()
add_executable(ros_sensors_qt512_ndk19
src/main.cpp
src/gps_spitter.cpp
qml.qrc)
endif()
target_compile_definitions(ros_sensors_qt512_ndk19
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(ros_sensors_qt512_ndk19
Qt5::Core
Qt5::Quick
Qt5::Positioning
Qt5::Sensors
${std_msgs_LIBRARIES}
${rclcpp_LIBRARIES}
${sensor_msgs_LIBRARIES}
${tf2_LIBRARIES}
fastrtps
)
ament_export_include_directories(include)
ament_export_dependencies(rclcpp builtin_interfaces std_msgs)
ament_export_libraries(
${PROJECT_NAME})
ament_package()
file(GLOB_RECURSE
MY_ANDROID_LIBS_LIST
/home/johnconn/external_storage/ros2_core_android_ws/install/device/*.so)
message("glob recurse setting to: ")
foreach(OPT ${MY_ANDROID_LIBS_LIST})
set(MY_ANDROID_STRING "${MY_ANDROID_STRING} ${OPT}")
endforeach()
message("${MY_ANDROID_STRING}")
# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
# Check http://doc.qt.io/qt-5/deployment-android.html for more information.
# These variables must use CACHE, otherwise QtCreator won't see them.
#if(ANDROID)
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android" CACHE INTERNAL "")
# if (ANDROID_ABI STREQUAL "armeabi-v7a")
# file(GLOB_RECURSE
# MY_ANDROID_LIBS_LIST
# /home/johnconn/external_storage/ros2_core_android_ws/install/device/*.so)
# #message("glob recurse setting to: ")
#
# foreach(OPT ${MY_ANDROID_LIBS_LIST})
# set(MY_ANDROID_STRING "${MY_ANDROID_STRING} ${OPT}")
# endforeach()
# #message("${MY_ANDROID_STRING}")
# #list(APPEND ANDROID_EXTRA_LIBS CACHE INTERNAL "")
# #list(APPEND ANDROID_EXTRA_LIBS CACHE INTERNAL "")
# endif()
#endif()