2022-11-20 19:13:37 +00:00
|
|
|
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)
|
|
|
|
|
2022-11-21 18:01:12 +00:00
|
|
|
target_include_directories(minitar PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
|
2022-11-20 19:13:37 +00:00
|
|
|
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)
|