1 |
# zlib library |
2 |
|
3 |
# library name |
4 |
set(zlibName zlib) |
5 |
|
6 |
# Debug - Build |
7 |
if(CMAKE_BUILD_TYPE STREQUAL Debug) |
8 |
# add defines |
9 |
add_definitions(-W -g -O0) |
10 |
endif(CMAKE_BUILD_TYPE STREQUAL Debug) |
11 |
|
12 |
# Devel - Build |
13 |
if(CMAKE_BUILD_TYPE STREQUAL Devel) |
14 |
# add defines |
15 |
add_definitions(-O2 -W) |
16 |
endif(CMAKE_BUILD_TYPE STREQUAL Devel) |
17 |
|
18 |
# Release - Build |
19 |
if(CMAKE_BUILD_TYPE STREQUAL Release) |
20 |
# add defines |
21 |
add_definitions(-fexpensive-optimizations -O3 -W) |
22 |
endif(CMAKE_BUILD_TYPE STREQUAL Release) |
23 |
|
24 |
# variable with all sources of this library |
25 |
set(zlibSources |
26 |
compress.c |
27 |
deflate.c |
28 |
gzwrite.c |
29 |
trees.c |
30 |
crc32.c |
31 |
gzlib.c |
32 |
infback.c |
33 |
inftrees.c |
34 |
adler32.c |
35 |
gzclose.c |
36 |
gzread.c |
37 |
inffast.c |
38 |
inflate.c |
39 |
uncompr.c |
40 |
zutil.c) |
41 |
|
42 |
# variable with all headers of this library |
43 |
set(zlibHeaders |
44 |
gzguts.h |
45 |
inffast.h |
46 |
inflate.h |
47 |
zconf.h |
48 |
zlib.h |
49 |
zutil.h |
50 |
deflate.h |
51 |
inffixed.h |
52 |
trees.h |
53 |
crc32.h |
54 |
inftrees.h ) |
55 |
|
56 |
# add library |
57 |
add_library(${zlibName} STATIC ${zlibSources} ${zlibHeaders}) |
58 |
|
59 |
# Force the linker into 32 bits mode |
60 |
target_link_libraries(${zlibName} -m32) |
61 |
|