u8g2-copy/CMakeLists.txt

34 lines
860 B
CMake
Raw Normal View History

2023-09-30 22:17:31 +08:00
cmake_minimum_required(VERSION 3.5)
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)
2024-07-11 07:55:17 +08:00
if(COMMAND idf_component_register)
idf_component_register(SRCS "${COMPONENT_SRCS}" INCLUDE_DIRS csrc)
return()
2024-07-11 07:55:17 +08:00
endif()
project(u8g2)
if(COMMAND register_component)
set(COMPONENT_NAME ".")
register_component()
else()
add_library(u8g2 ${COMPONENT_SRCS})
target_include_directories(u8g2 PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/csrc>" "$<INSTALL_INTERFACE:include>")
endif()
2023-09-30 22:30:01 +08:00
install(TARGETS u8g2
2024-07-11 09:24:11 +08:00
EXPORT u8g2-targets
ARCHIVE DESTINATION lib)
2023-09-30 22:30:01 +08:00
install(FILES ${COMPONENT_HDRS}
2024-07-11 09:24:11 +08:00
DESTINATION include/u8g2)
install(EXPORT u8g2-targets
2024-07-11 09:24:11 +08:00
DESTINATION lib/cmake/u8g2)
install(FILES ${u8g2_SOURCE_DIR}/pkg/u8g2-config.cmake
2024-07-11 09:24:11 +08:00
DESTINATION lib/cmake/u8g2)