forked from lasote/conan-giflib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (51 loc) · 1.59 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
PROJECT(giflib)
cmake_minimum_required(VERSION 2.8)
include(../conanbuildinfo.cmake)
CONAN_BASIC_SETUP()
SET(GIFLIB_SOURCE_DIR ".")
SET(TARGET_LIB libgif)
SET(GIFLIB_PUBLIC_HEADERS
${GIFLIB_SOURCE_DIR}/lib/gif_lib.h
)
SET(GIFLIB_PRIVATE_HEADERS
${GIFLIB_SOURCE_DIR}/lib/gif_lib_private.h
${GIFLIB_SOURCE_DIR}/lib/gif_hash.h
)
file(GLOB GIFLIB_SRCS lib/*.c)
IF(MSVC)
# Create file to avoid include file name collision on other platforms
CONFIGURE_FILE(unistd.h.in unistd.h @ONLY)
# Add unistd.h, getopt.h, getopt.c and stdbool.h for windows build
# getopt from: http://gist.github.com/ashelly/7776712
# unistd.h from: http://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c
# stdbool.h is just a simple redefinition of bool as int
SET(GIFLIB_PUBLIC_HEADERS
${GIFLIB_PUBLIC_HEADERS}
stdbool.h
)
SET(GIFLIB_PRIVATE_HEADERS
${GIFLIB_PRIVATE_HEADERS}
getopt.h
unistd.h
)
SET(GIFLIB_SRCS
${GIFLIB_SRCS}
getopt.c
)
ENDIF(MSVC)
# Dependent include files
INCLUDE_DIRECTORIES(${GIFLIB_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
IF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4018 /wd4028 /wd4244 /wd4996")
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_LIB)
SET(CMAKE_DEBUG_POSTFIX "d")
ENDIF(MSVC)
IF(MINGW)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_LIB)
ENDIF(MINGW)
MESSAGE(ERROR ${GIFLIB_SRCS})
ADD_LIBRARY(${TARGET_LIB} STATIC ${GIFLIB_SRCS} ${GIFLIB_PRIVATE_HEADERS} ${GIFLIB_PUBLIC_HEADERS})
ADD_LIBRARY(getarg STATIC util/getarg.c)
IF(MINGW)
SET_TARGET_PROPERTIES(${TARGET_LIB} PROPERTIES OUTPUT_NAME gif)
ENDIF()