-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
58 lines (45 loc) · 1.67 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
cmake_minimum_required(VERSION 3.12)
project (native-interface-lvgl-with-flow.eez-project)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s INITIAL_MEMORY=83886080 -sLLD_REPORT_UNDEFINED -s USE_SDL=2")
include_directories(${PROJECT_SOURCE_DIR})
add_subdirectory(lvgl)
add_subdirectory(lv_drivers)
file(GLOB MY_SOURCES "./*.c")
set(SOURCES ${MY_SOURCES})
# Comment out following statements to build project without eez flow support.
# Also, build lvgl-demo-no-flow.eez-project with EEZ Studio.
add_definitions(-DHAS_FLOW_SUPPORT=1)
set (HAS_FLOW_SUPPORT 1)
file(GLOB_RECURSE my_src
./src/*.cpp
./src/*.c
)
list(APPEND SOURCES ${my_src})
if (${HAS_FLOW_SUPPORT})
################################################################################
# EEZ Framework
add_definitions(-DEEZ_FOR_LVGL)
include_directories(
./eez-framework/src
./eez-framework/src/eez/libs/agg
./eez-framework/src/eez/platform/simulator
)
file(GLOB_RECURSE src_eez
./eez-framework/src/eez/*.cpp
./eez-framework/src/eez/*.c
)
list(APPEND SOURCES ${src_eez})
################################################################################
endif(${HAS_FLOW_SUPPORT})
add_executable(index ${SOURCES} ${INCLUDES})
if(NOT LVGL_CHOSEN_DEMO)
set(LVGL_CHOSEN_DEMO lv_demo_widgets)
endif()
set_source_files_properties(main.c PROPERTIES COMPILE_FLAGS -DCHOSEN_DEMO=${LVGL_CHOSEN_DEMO})
set(CMAKE_EXECUTABLE_SUFFIX ".html")
target_link_libraries(index
lvgl
lv_drivers
)
set_target_properties(index PROPERTIES LINK_FLAGS "--shell-file ${PROJECT_SOURCE_DIR}/lvgl_shell.html -s SINGLE_FILE=1")