-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
44 lines (34 loc) · 971 Bytes
/
CMakeLists.txt
File metadata and controls
44 lines (34 loc) · 971 Bytes
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
cmake_minimum_required(VERSION 3.10)
project(libUartCommProtocol VERSION 1.0.0 LANGUAGES C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Compiler flags
add_compile_options(-Wall -Werror -O2)
# Include directories
include_directories(inc utils)
# Core library sources
set(CORE_SOURCES
src/uni_communication.c
utils/uni_crc16.c
utils/uni_log.c
utils/uni_interruptable.c
)
# Create static library
add_library(uartcomm STATIC ${CORE_SOURCES})
target_link_libraries(uartcomm pthread)
# Examples
option(BUILD_EXAMPLES "Build example programs" ON)
if(BUILD_EXAMPLES)
add_executable(peera benchmark/peer_a.c)
target_link_libraries(peera uartcomm pthread)
add_executable(peerb benchmark/peer_b.c)
target_link_libraries(peerb uartcomm pthread)
endif()
# Installation
install(TARGETS uartcomm
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(FILES inc/uni_communication.h
DESTINATION include/uartcomm
)