minitar/CMakeLists.txt

35 lines
993 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.8..3.22)
2023-02-15 18:24:54 +00:00
project(minitar LANGUAGES C VERSION 1.7.2)
option(MINITAR_IGNORE_UNSUPPORTED_TYPES "Skip past entries that have unsupported types instead of panicking (deprecated)" OFF)
set(SOURCES
src/tar.c
src/util.c
)
add_library(minitar STATIC ${SOURCES})
if(MINITAR_IGNORE_UNSUPPORTED_TYPES)
message(WARNING "MINITAR_IGNORE_UNSUPPORTED_TYPES is deprecated, since there are no unsupported types anymore")
endif()
target_include_directories(minitar PUBLIC ${CMAKE_CURRENT_LIST_DIR}) # for minitar.h
set_target_properties(minitar PROPERTIES OUTPUT_NAME mtar)
set_target_properties(minitar PROPERTIES C_STANDARD 11)
set_target_properties(minitar PROPERTIES C_STANDARD_REQUIRED ON)
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)
2023-02-06 21:42:31 +00:00
add_subdirectory(examples)