acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
custom.cmake (2788B)
1 # Option to define LV_LVGL_H_INCLUDE_SIMPLE, default: ON 2 option(LV_LVGL_H_INCLUDE_SIMPLE 3 "Use #include \"lvgl.h\" instead of #include \"../../lvgl.h\"" ON) 4 5 # Option to define LV_CONF_INCLUDE_SIMPLE, default: ON 6 option(LV_CONF_INCLUDE_SIMPLE 7 "Simple include of \"lv_conf.h\" and \"lv_drv_conf.h\"" ON) 8 9 # Option to set LV_CONF_PATH, if set parent path LV_CONF_DIR is added to 10 # includes 11 option(LV_CONF_PATH "Path defined for lv_conf.h") 12 get_filename_component(LV_CONF_DIR ${LV_CONF_PATH} DIRECTORY) 13 14 # Option to build shared libraries (as opposed to static), default: OFF 15 option(BUILD_SHARED_LIBS "Build shared libraries" OFF) 16 17 file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) 18 file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c) 19 file(GLOB_RECURSE DEMO_SOURCES ${LVGL_ROOT_DIR}/demos/*.c) 20 21 if (BUILD_SHARED_LIBS) 22 add_library(lvgl SHARED ${SOURCES}) 23 else() 24 add_library(lvgl STATIC ${SOURCES}) 25 endif() 26 27 add_library(lvgl::lvgl ALIAS lvgl) 28 add_library(lvgl_examples STATIC ${EXAMPLE_SOURCES}) 29 add_library(lvgl::examples ALIAS lvgl_examples) 30 add_library(lvgl_demos STATIC ${DEMO_SOURCES}) 31 add_library(lvgl::demos ALIAS lvgl_demos) 32 33 target_compile_definitions( 34 lvgl PUBLIC $<$<BOOL:${LV_LVGL_H_INCLUDE_SIMPLE}>:LV_LVGL_H_INCLUDE_SIMPLE> 35 $<$<BOOL:${LV_CONF_INCLUDE_SIMPLE}>:LV_CONF_INCLUDE_SIMPLE>) 36 37 # Include root and optional parent path of LV_CONF_PATH 38 target_include_directories(lvgl SYSTEM PUBLIC ${LVGL_ROOT_DIR} ${LV_CONF_DIR}) 39 40 # Include /examples folder 41 target_include_directories(lvgl_examples SYSTEM 42 PUBLIC ${LVGL_ROOT_DIR}/examples) 43 target_include_directories(lvgl_demos SYSTEM 44 PUBLIC ${LVGL_ROOT_DIR}/demos) 45 46 target_link_libraries(lvgl_examples PUBLIC lvgl) 47 target_link_libraries(lvgl_demos PUBLIC lvgl) 48 49 # Lbrary and headers can be installed to system using make install 50 file(GLOB LVGL_PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/lv_conf.h" 51 "${CMAKE_SOURCE_DIR}/lvgl.h") 52 53 if("${LIB_INSTALL_DIR}" STREQUAL "") 54 set(LIB_INSTALL_DIR "lib") 55 endif() 56 if("${INC_INSTALL_DIR}" STREQUAL "") 57 set(INC_INSTALL_DIR "include/lvgl") 58 endif() 59 60 install( 61 DIRECTORY "${CMAKE_SOURCE_DIR}/src" 62 DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/" 63 FILES_MATCHING 64 PATTERN "*.h") 65 66 set_target_properties( 67 lvgl 68 PROPERTIES OUTPUT_NAME lvgl 69 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 70 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 71 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 72 PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}") 73 74 install( 75 TARGETS lvgl 76 ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" 77 LIBRARY DESTINATION "${LIB_INSTALL_DIR}" 78 RUNTIME DESTINATION "${LIB_INSTALL_DIR}" 79 PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}")