Provide a CMakeLists.txt to use minitar with CMake
This commit is contained in:
parent
363c01d6f8
commit
1633012823
3
.gitignore
vendored
3
.gitignore
vendored
@ -54,4 +54,5 @@ dkms.conf
|
|||||||
|
|
||||||
obj/
|
obj/
|
||||||
libmtar.a
|
libmtar.a
|
||||||
.vscode/
|
.vscode/
|
||||||
|
build/
|
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.8..3.22)
|
||||||
|
|
||||||
|
project(minitar C)
|
||||||
|
|
||||||
|
set(SOURCES
|
||||||
|
src/tar.c
|
||||||
|
src/util.c
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(minitar STATIC ${SOURCES})
|
||||||
|
|
||||||
|
set_target_properties(minitar PROPERTIES OUTPUT_NAME mtar)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
target_compile_options(minitar PRIVATE /W4 /WX)
|
||||||
|
else()
|
||||||
|
target_compile_options(minitar PRIVATE -Wall -Wextra -pedantic -Werror)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(TARGETS minitar DESTINATION lib)
|
||||||
|
install(FILES minitar.h DESTINATION include)
|
Loading…
Reference in New Issue
Block a user