vcpkg/ports/giflib/CMakeLists.txt

45 lines
905 B
CMake
Raw Normal View History

2017-04-27 22:00:00 +07:00
cmake_minimum_required(VERSION 3.4)
project(giflib C)
2017-04-27 22:00:00 +07:00
set(GIFLIB_EXPORTS "NOTFOUND" CACHE FILEPATH "The path of the DEF file listing the DLL exports.")
2017-04-27 22:00:00 +07:00
set(GIFLIB_HEADERS
gif_lib.h
2017-04-27 22:00:00 +07:00
)
set(GIFLIB_SOURCES
dgif_lib.c
egif_lib.c
gifalloc.c
gif_err.c
gif_font.c
gif_hash.c
openbsd-reallocarray.c
2017-04-27 22:00:00 +07:00
)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
include(CheckSymbolExists)
check_symbol_exists(reallocarray "stdlib.h" HAVE_REALLOCARRAY)
if(HAVE_REALLOCARRAY)
add_definitions(-DHAVE_REALLOCARRAY)
endif()
2017-04-27 22:00:00 +07:00
add_library(gif ${GIFLIB_SOURCES})
if(BUILD_SHARED_LIBS AND WIN32)
target_sources(gif PRIVATE "${GIFLIB_EXPORTS}")
else()
set(UNUSED "${GIFLIB_EXPORTS}")
endif()
2017-04-27 22:00:00 +07: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
)