-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
24 lines (17 loc) · 748 Bytes
/
CMakeLists.txt
File metadata and controls
24 lines (17 loc) · 748 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
cmake_minimum_required(VERSION 3.22.1)
project(encode C)
include(GNUInstallDirs)
set(CMAKE_C_STANDARD 17)
set(HEADERS_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
set(LIBRARY_DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(CMAKE_C_FLAGS "-O3 -fmessage-length=0 -Wall -Werror -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wwrite-strings")
set(SOURCE_ROOT "src")
add_library(encode STATIC ${SOURCE_ROOT}/encode.h ${SOURCE_ROOT}/encode.c)
set_target_properties(encode PROPERTIES PUBLIC_HEADER ${SOURCE_ROOT}/encode.h)
target_link_libraries(encode m)
install(
TARGETS encode
PUBLIC_HEADER DESTINATION ${HEADERS_DESTINATION}
LIBRARY DESTINATION ${LIBRARY_DESTINATION}
ARCHIVE DESTINATION ${LIBRARY_DESTINATION}
)