forked from olikraus/u8g2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (25 loc) · 860 Bytes
/
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
cmake_minimum_required(VERSION 3.5)
set(COMPONENT_ADD_INCLUDEDIRS csrc)
file(GLOB COMPONENT_SRCS csrc/*.c)
file(GLOB COMPONENT_HDRS csrc/*.h)
if(COMMAND idf_component_register)
idf_component_register(SRCS "${COMPONENT_SRCS}" INCLUDE_DIRS csrc)
return()
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()
install(TARGETS u8g2
EXPORT u8g2-targets
ARCHIVE DESTINATION lib)
install(FILES ${COMPONENT_HDRS}
DESTINATION include/u8g2)
install(EXPORT u8g2-targets
DESTINATION lib/cmake/u8g2)
install(FILES ${u8g2_SOURCE_DIR}/pkg/u8g2-config.cmake
DESTINATION lib/cmake/u8g2)