2017-04-27 23:00:00 +08:00
|
|
|
cmake_minimum_required(VERSION 3.4)
|
|
|
|
|
2019-03-27 08:31:19 +08:00
|
|
|
project(giflib C)
|
2017-04-27 23:00:00 +08:00
|
|
|
|
2021-07-24 00:02:46 +08:00
|
|
|
set(GIFLIB_EXPORTS "NOTFOUND" CACHE FILEPATH "The path of the DEF file listing the DLL exports.")
|
|
|
|
|
2017-04-27 23:00:00 +08:00
|
|
|
set(GIFLIB_HEADERS
|
2021-07-24 00:02:46 +08:00
|
|
|
gif_lib.h
|
2017-04-27 23:00:00 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
set(GIFLIB_SOURCES
|
2021-07-24 00:02:46 +08:00
|
|
|
dgif_lib.c
|
|
|
|
egif_lib.c
|
|
|
|
gifalloc.c
|
|
|
|
gif_err.c
|
|
|
|
gif_font.c
|
|
|
|
gif_hash.c
|
|
|
|
openbsd-reallocarray.c
|
2017-04-27 23:00:00 +08:00
|
|
|
)
|
|
|
|
|
2019-03-29 05:46:21 +08:00
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
2021-07-24 00:02:46 +08:00
|
|
|
|
|
|
|
include(CheckSymbolExists)
|
|
|
|
check_symbol_exists(reallocarray "stdlib.h" HAVE_REALLOCARRAY)
|
|
|
|
if(HAVE_REALLOCARRAY)
|
|
|
|
add_definitions(-DHAVE_REALLOCARRAY)
|
|
|
|
endif()
|
|
|
|
|
2017-04-27 23:00:00 +08:00
|
|
|
add_library(gif ${GIFLIB_SOURCES})
|
2021-07-24 00:02:46 +08:00
|
|
|
if(BUILD_SHARED_LIBS AND WIN32)
|
|
|
|
target_sources(gif PRIVATE "${GIFLIB_EXPORTS}")
|
|
|
|
else()
|
|
|
|
set(UNUSED "${GIFLIB_EXPORTS}")
|
|
|
|
endif()
|
2017-04-27 23:00:00 +08:00
|
|
|
|
|
|
|
if (NOT GIFLIB_SKIP_HEADERS)
|
|
|
|
install(FILES ${GIFLIB_HEADERS} DESTINATION include)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
install(TARGETS gif
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|