2023-09-30 22:17:31 +08:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2018-10-15 12:17:58 +08:00
|
|
|
set(COMPONENT_ADD_INCLUDEDIRS csrc)
|
2023-10-01 01:11:22 +08:00
|
|
|
file(GLOB COMPONENT_SRCS csrc/*.c)
|
2023-09-30 22:30:01 +08:00
|
|
|
file(GLOB COMPONENT_HDRS csrc/*.h)
|
2018-10-15 12:17:58 +08:00
|
|
|
|
2024-07-11 07:55:17 +08:00
|
|
|
if(COMMAND idf_component_register)
|
2024-07-11 09:19:01 +08:00
|
|
|
idf_component_register(SRCS "${COMPONENT_SRCS}" INCLUDE_DIRS csrc)
|
|
|
|
return()
|
2024-07-11 07:55:17 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
project(u8g2)
|
|
|
|
|
2022-05-04 00:36:00 +08:00
|
|
|
if(COMMAND register_component)
|
2024-07-11 09:19:01 +08:00
|
|
|
set(COMPONENT_NAME ".")
|
|
|
|
register_component()
|
2022-05-04 00:36:00 +08:00
|
|
|
else()
|
2024-07-11 09:19:01 +08:00
|
|
|
add_library(u8g2 ${COMPONENT_SRCS})
|
|
|
|
target_include_directories(u8g2 PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/csrc>" "$<INSTALL_INTERFACE:include>")
|
2022-05-04 00:36:00 +08:00
|
|
|
endif()
|
2023-09-30 22:30:01 +08:00
|
|
|
|
|
|
|
install(TARGETS u8g2
|
2024-07-11 09:19:01 +08:00
|
|
|
EXPORT u8g2-targets
|
|
|
|
ARCHIVE DESTINATION lib)
|
2023-09-30 22:30:01 +08:00
|
|
|
|
|
|
|
install(FILES ${COMPONENT_HDRS}
|
2024-07-11 09:19:01 +08:00
|
|
|
DESTINATION include/u8g2)
|
2023-09-30 22:30:13 +08:00
|
|
|
|
|
|
|
install(EXPORT u8g2-targets
|
2024-07-11 09:19:01 +08:00
|
|
|
DESTINATION lib/cmake/u8g2)
|
2023-09-30 22:30:13 +08:00
|
|
|
|
|
|
|
install(FILES ${u8g2_SOURCE_DIR}/pkg/u8g2-config.cmake
|
2024-07-11 09:19:01 +08:00
|
|
|
DESTINATION lib/cmake/u8g2)
|