aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: dd6be290ae5b1ea7c295789e41c0d8f15debf142 (plain)
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
cmake_minimum_required(VERSION 2.8.11)
INCLUDE(FindPkgConfig)

# usefull flags:
# -DCMAKE_BUILD_TYPE=Debug
# -DCMAKE_BUILD_TYPE=Release
# -DCMAKE_INSTALL_PREFIX=install

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to 'Release' as none was specified.")
  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()

set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS $ENV{OE_QMAKE_PATH_HOST_BINS})

project(yelp-client)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC ")

set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Widgets REQUIRED)

pkg_check_modules(QT5_CORE REQUIRED Qt5Core)
pkg_check_modules(JSON REQUIRED json-c)
pkg_check_modules(QT5_WIDGETS REQUIRED Qt5Widgets)
pkg_check_modules(QT5_NETWORK REQUIRED Qt5Network)
pkg_check_modules(QTAPPFW REQUIRED qtappfw)
pkg_check_modules(QLIBWIN REQUIRED qlibwindowmanager)
pkg_check_modules(LIBHS REQUIRED libhomescreen)



include_directories( ${PROJECT_SOURCE_DIR}/ ${QTAPPFW_INCLUDE_DIRS} ${QT5_CORE_INCLUDE_DIRS} ${QT5_WIDGETS_INCLUDE_DIRS} ${QT5_NETWORK_INCLUDE_DIRS} ${JSON_INCLUDE_DIRS} ${QLIBWIN_INCLUDE_DIRS} ${LIBHS_INCLUDE_DIRS} )

qt5_wrap_cpp(yelp_client_SRC MainApp.h InfoPanelLabel.h ClickableLabel.h Keyboard.h)

QT5_ADD_RESOURCES(yelp_client_QRC yelp-client.qrc)
add_executable( yelp-client main.cpp MainApp.cpp InfoPanel.cpp InfoPanelLabel.cpp Keyboard.cpp yelp-client.qrc ${yelp_client_SRC} ${yelp_client_QRC})
#target_link_libraries( yelp-client binderclient )
target_link_libraries( yelp-client ${QTAPPFW_LIBRARIES} ${JSON_LIBRARIES} ${QLIBWIN_LIBRARIES} ${LIBHS_LIBRARIES} )
qt5_use_modules(yelp-client Core Widgets Network)

install (TARGETS yelp-client DESTINATION bin)

##########################################################################
# AGL binding
configure_file(config.xml.in config.xml)

add_custom_command(
	OUTPUT poi.wgt
	DEPENDS yelp-client
	COMMAND rm -rf package
	COMMAND mkdir -p package/root
	COMMAND cp config.xml package/root/
	COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/HMI_AppLauncher_POI_Active-01.png package/root/icon.png
	COMMAND cp yelp-client package/root/poi
	COMMAND wgtpkg-pack -f -o package/poi.wgt package/root
)
add_custom_target(widget ALL DEPENDS poi.wgt)