-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
147 lines (110 loc) · 3.33 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
project(botui)
option(wombat "Use the Wombat controller" ON)
option(DEBUG "Enable debug mode" OFF)
option(RELEASE "Enable release mode" OFF)
option(docker_cross "Cross compile option for docker container" OFF)
set(KIPR_VERSION_MAJOR 1)
set(KIPR_VERSION_MINOR 2)
set(KIPR_VERSION_PATCH 2)
cmake_minimum_required(VERSION 2.8.11)
#if (wallaby)
# add_definitions(-DWALLABY)
#set(DEVICE_DIR ${CMAKE_SOURCE_DIR}/devices/wallaby)
#find_package(OpenCV REQUIRED)
#else()
# set(DEVICE_DIR ${CMAKE_SOURCE_DIR}/devices/kovan)
#endif()
set(LIBKAR_ROOT ${CMAKE_SOURCE_DIR}/../libkar)
set(PCOMPILER_ROOT ${CMAKE_SOURCE_DIR}/../pcompiler)
set(LIBKIPR_ROOT ${CMAKE_SOURCE_DIR}/../libwallaby)
include_directories(/usr/local/include)
if(wombat)
add_definitions(-DWOMBAT)
set(DEVICE_DIR ${CMAKE_SOURCE_DIR}/devices/wombat)
endif()
if(docker_cross)
link_directories("${LIBKAR_ROOT}/lib")
link_directories("${PCOMPILER_ROOT}/lib")
link_directories("${LIBKIPR_ROOT}/build")
include_directories(/usr/local/include)
endif()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/deploy)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(INCLUDE ${CMAKE_SOURCE_DIR}/include/botui)
set(WOMBAT ${DEVICES}/kipr)
set(RC ${CMAKE_SOURCE_DIR}/rc)
set(SRC ${CMAKE_SOURCE_DIR}/src)
set(UI ${CMAKE_SOURCE_DIR}/ui)
set(TS ${CMAKE_SOURCE_DIR}/ts)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${DBUS}/include
${CMAKE_BINARY_DIR}
${DEVICE_DIR}/include
${INCLUDE}
)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Network Quick QuickWidgets QuickControls2)
find_package(OpenSSL REQUIRED)
file(GLOB INCLUDES ${INCLUDE}/*.h ${DEVICE_DIR}/include/*.h)
file(GLOB SOURCES ${SRC}/*.cpp ${DEVICE_DIR}/src/*.cpp)
file(GLOB UIS ${UI}/*)
file(GLOB TS_FILES ${TS}/*.ts)
file(GLOB DBUS_INTERFACES ${DBUS}/*.xml)
set(UI ${UIS})
set(QRC_FILES
${RC}/icons.qrc
${RC}/construction.qrc
${RC}/qml.qrc
${RC}/fonts.qrc
${RC}/target.qrc
)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(MOC_SRCS ${INCLUDES})
set(SRCS_CXX ${SOURCES})
qt6_wrap_cpp(SRCS_CXX ${MOC_SRCS} OPTIONS -DQT_VERSION=0x060000 -UQT_DBUS_LIB)
qt6_wrap_ui(SRCS_CXX ${UI})
qt6_add_resources(SRCS_CXX ${QRC_FILES})
add_definitions(-Wall)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(botui ${SRCS_CXX} ${QM_FILES} ${DBUS_INTERFACE_SOURCES})
if (DEBUG)
add_definitions(-g)
endif()
if (RELEASE)
add_definitions(-O3)
endif()
add_subdirectory(dbus)
target_link_libraries(botui
Qt6::Core
Qt6::Gui
Qt6::Quick
Qt6::QuickWidgets
Qt6::Widgets
Qt6::QuickControls2
network_manager_dbus
pcompiler
z
${OPENSSL_LIBRARIES}
)
IF(wombat)
target_link_libraries(botui kipr)
ENDIF()
target_link_libraries(botui ${QT_LIBRARIES})
install(TARGETS botui DESTINATION bin)
install(FILES ${QM_FILES} DESTINATION "/etc/botui/locale")
set(CPACK_PACKAGE_NAME botui)
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_VERSION_MAJOR ${KIPR_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${KIPR_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${KIPR_VERSION_PATCH})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "KISS Institute for Practical Robotics")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
include(CPack)