forked from cajun-rat/openivi-html5
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
63 lines (47 loc) · 1.97 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
cmake_minimum_required(VERSION 2.8.8)
project(openivi-html5)
# Tell CMake to run moc when necessary:
set(CMAKE_AUTOMOC ON)
# Tell CMake to run the UI compiler when necessary
# SET(CMAKE_AUTOUIC ON)
# Only available in cmake 3.0. yocto only has cmake 2.8.12
# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
find_package(Qt5Widgets REQUIRED)
find_package(Qt5WebKitWidgets REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(X11)
find_program(CTAGS NAMES ctags)
qt5_wrap_ui(UI_MAINWINDOW mainwindow.ui)
set_source_files_properties(softwareloadingmanager.xml
PROPERTIES INCLUDE softwareloadingmanagerdbus.h)
qt5_add_dbus_interfaces(DBUS_FILES softwareloadingmanager.xml)
qt5_add_resources(RCC_FILES resources/resources.qrc)
# Generate config.h from config.h.in
configure_file(config.h.in config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(openivi-html5
main.cc mainwindow.cc webgraphicview.cc softwareloadingmanager.cc
car.cc installdetail.cc packageid.cc
virtualkeyboard.cc allowlocation_webpage.cc
${DBUS_FILES} ${RCC_FILES} ${UI_MAINWINDOW})
if (X11_FOUND)
target_link_libraries(openivi-html5 ${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
endif(X11_FOUND)
set_property(TARGET openivi-html5 PROPERTY CXX_STANDARD 11)
qt5_use_modules(openivi-html5 Widgets DBus WebKitWidgets)
message("Build type is ${CMAKE_BUILD_TYPE}")
# Export compile_commands.json for clang-check
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (CTAGS)
# Generate tags if the 'ctags' tool is available
set_source_files_properties(tags PROPERTIES GENERATED true)
add_custom_target(tags
COMMAND ${CTAGS} -R --c++-kinds=+p --fields=+iaS --extra=+q .
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_dependencies(openivi-html5 tags)
endif() # CTAGS
# vim: set tabstop=4 shiftwidth=4 expandtab: