-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-CMakeLists.txt.patch
More file actions
126 lines (126 loc) · 4.89 KB
/
fix-CMakeLists.txt.patch
File metadata and controls
126 lines (126 loc) · 4.89 KB
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
--- lvgl/CMakeLists.txt 2024-10-19 01:08:11.969462222 +0000
+++ lvgl-orig/CMakeLists.txt 2024-12-01 15:58:18.262974425 +0000
@@ -1,40 +1,83 @@
-cmake_minimum_required(VERSION 3.12.4)
-
-set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
-
-if(NOT ESP_PLATFORM)
- if(NOT (CMAKE_C_COMPILER_ID STREQUAL "MSVC"))
- project(lvgl LANGUAGES C CXX ASM HOMEPAGE_URL https://github.com/lvgl/lvgl)
- else()
- project(lvgl LANGUAGES C CXX HOMEPAGE_URL https://github.com/lvgl/lvgl)
- endif()
-endif()
-
-set(LVGL_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
-
-if(ESP_PLATFORM)
- include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/esp.cmake)
-elseif(ZEPHYR_BASE)
- include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/zephyr.cmake)
-elseif(MICROPY_DIR)
- include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/micropython.cmake)
-else()
- include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/custom.cmake)
-endif()
-
-#[[
- unfortunately CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS does not work for global data.
- for global data we still need decl specs.
- Check out the docs to learn more about the limitations of CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
- https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html#prop_tgt:WINDOWS_EXPORT_ALL_SYMBOLS
-
- For all compiled sources within the library (i.e. basically all lvgl files) we need to use dllexport.
- For all compiled sources from outside the library (i.e. files which include lvgl headers) we need to use dllimport.
- We can do this by using CMakes INTERFACE and PRIVATE keyword.
- ]]
-if (MSVC)
- target_compile_definitions(lvgl
- INTERFACE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllimport\)
- PRIVATE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllexport\)
- )
+cmake_minimum_required(VERSION 3.12.4)
+
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+
+project(lvgl LANGUAGES C CXX ASM HOMEPAGE_URL https://github.com/lvgl/lvgl)
+
+set(LVGL_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
+
+if(ESP_PLATFORM)
+ include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/esp.cmake)
+elseif(ZEPHYR_BASE)
+ include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/zephyr.cmake)
+elseif(MICROPY_DIR)
+ include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/micropython.cmake)
+else()
+ # Asegúrate de que custom.cmake no intente crear la biblioteca de nuevo
+ set(LVGL_ALREADY_DEFINED TRUE)
+ include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/custom.cmake)
+endif()
+
+find_package(PkgConfig REQUIRED)
+
+# If the target system if linux (not Windows, not MacOS), we need to include the following libraries
+if (UNIX AND NOT APPLE)
+ # Añadir estas líneas para encontrar e incluir libdrm
+ pkg_check_modules(LIBDRM REQUIRED libdrm)
+
+ include_directories(${LIBDRM_INCLUDE_DIRS})
+ link_directories(${LIBDRM_LIBRARY_DIRS})
+ target_link_libraries(lvgl PUBLIC ${LIBDRM_LIBRARIES})
+
+ # Añadir estas líneas para encontrar e incluir libinput
+ pkg_check_modules(LIBINPUT REQUIRED libinput)
+
+ include_directories(${LIBINPUT_INCLUDE_DIRS})
+ link_directories(${LIBINPUT_LIBRARY_DIRS})
+ target_link_libraries(lvgl PUBLIC ${LIBINPUT_LIBRARIES})
+
+ # Añadir estas líneas para encontrar e incluir xkbcommon
+ pkg_check_modules(XKBCOMMON REQUIRED xkbcommon)
+
+ include_directories(${XKBCOMMON_INCLUDE_DIRS})
+ link_directories(${XKBCOMMON_LIBRARY_DIRS})
+ target_link_libraries(lvgl PUBLIC ${XKBCOMMON_LIBRARIES})
+endif()
+
+# Excepto en linux arquitectura ARM incluir SDL2
+if (NOT (UNIX AND (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")))
+ # Añadir libreria SDL2
+ find_package(SDL2 REQUIRED)
+ include_directories(${SDL2_INCLUDE_DIRS})
+ target_link_libraries(lvgl PUBLIC ${SDL2_LIBRARIES})
+endif()
+
+# Add library: avformat, avcodec, avutil, swscale
+pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET libavformat libavcodec libavutil libswscale)
+include_directories(${LIBAV_INCLUDE_DIRS})
+link_directories(${LIBAV_LIBRARY_DIRS})
+target_link_libraries(lvgl PUBLIC PkgConfig::LIBAV)
+
+# Add library: m, z, pthread
+find_package(Threads REQUIRED)
+
+target_link_libraries(lvgl PUBLIC m)
+target_link_libraries(lvgl PUBLIC z)
+target_link_libraries(lvgl PUBLIC Threads::Threads)
+
+#[[
+ unfortunately CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS does not work for global data.
+ for global data we still need decl specs.
+ Check out the docs to learn more about the limitations of CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
+ https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html#prop_tgt:WINDOWS_EXPORT_ALL_SYMBOLS
+
+ For all compiled sources within the library (i.e. basically all lvgl files) we need to use dllexport.
+ For all compiled sources from outside the library (i.e. files which include lvgl headers) we need to use dllimport.
+ We can do this by using CMakes INTERFACE and PRIVATE keyword.
+]]
+if (MSVC)
+ target_compile_definitions(lvgl
+ INTERFACE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllimport\)
+ PRIVATE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllexport\)
+ )
endif()
\ No newline at end of file