-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (63 loc) · 2.32 KB
/
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
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
cmake_minimum_required(VERSION 3.15)
if ("${COMPONENT_NAME}" STREQUAL "")
project(general-support-library)
# Add the library
add_library(general-support-library STATIC
BufferedOut.cpp
PersistentStorage.cpp
)
add_library(general-support-library-graphics STATIC
graphics/EmbeddedFont.cpp
graphics/EmbeddedFonts.cpp
graphics/Canvas.cpp
)
target_compile_features(general-support-library PUBLIC cxx_std_17)
target_compile_options(general-support-library PRIVATE -Wall -Wextra -pedantic)
target_include_directories(general-support-library PUBLIC .)
target_link_libraries(general-support-library-graphics PUBLIC general-support-library)
set_source_files_properties(graphics/EmbeddedFonts.cpp PROPERTIES COMPILE_FLAGS -Wno-missing-braces)
find_package(Freetype)
find_package(Iconv)
if (FREETYPE_FOUND AND ICONV_FOUND)
add_subdirectory(gfx-font-converter)
endif ()
find_package(GTest)
if (GTEST_FOUND)
enable_testing()
add_subdirectory(tests)
endif ()
else ()
set(srcs
BufferedOut.cpp
PersistentStorage.cpp
graphics/EmbeddedFont.cpp
graphics/EmbeddedFonts.cpp
graphics/Canvas.cpp
esp32-esp-idf/AnalogPin.cpp
esp32-esp-idf/Delays.cpp
esp32-esp-idf/GpioDigitalPin.cpp
esp32-esp-idf/I2CBus.cpp
esp32-esp-idf/I2CDevice.cpp
esp32-esp-idf/PacketUart.cpp
esp32-esp-idf/SerialDebug.cpp
esp32-esp-idf/SerialOut.cpp
esp32-esp-idf/SimpleUartDevice.cpp
esp32-esp-idf/SpiBus.cpp
esp32-esp-idf/SpiDevice.cpp
)
set(includedirs
${CMAKE_CURRENT_LIST_DIR}
)
set(private_requirements)
if (IDF_VERSION_MAJOR GREATER 4)
list(APPEND private_requirements esp_adc driver esp_timer)
endif ()
idf_component_register(INCLUDE_DIRS ${includedirs}
SRCS ${srcs}
PRIV_REQUIRES ${private_requirements}
)
set_source_files_properties(graphics/EmbeddedFonts.cpp PROPERTIES COMPILE_FLAGS -Wno-missing-braces)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
target_compile_options(${COMPONENT_LIB} PUBLIC -DDEBUG_SERIAL_OUT)
endif ()
endif ()