diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/cmake/FindZLIB.cmake | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/linden/indra/cmake/FindZLIB.cmake b/linden/indra/cmake/FindZLIB.cmake new file mode 100644 index 0000000..6d630f1 --- /dev/null +++ b/linden/indra/cmake/FindZLIB.cmake | |||
@@ -0,0 +1,46 @@ | |||
1 | # -*- cmake -*- | ||
2 | |||
3 | # - Find zlib | ||
4 | # Find the ZLIB includes and library | ||
5 | # This module defines | ||
6 | # ZLIB_INCLUDE_DIRS, where to find zlib.h, etc. | ||
7 | # ZLIB_LIBRARIES, the libraries needed to use zlib. | ||
8 | # ZLIB_FOUND, If false, do not try to use zlib. | ||
9 | # | ||
10 | # This FindZLIB is about 43 times as fast the one provided with cmake (2.8.x), | ||
11 | # because it doesn't look up the version of zlib, resulting in a dramatic | ||
12 | # speed up for configure (from 4 minutes 22 seconds to 6 seconds). | ||
13 | # | ||
14 | # Note: Since this file is only used for standalone, the windows | ||
15 | # specific parts were left out. | ||
16 | |||
17 | FIND_PATH(ZLIB_INCLUDE_DIR zlib.h | ||
18 | NO_SYSTEM_ENVIRONMENT_PATH | ||
19 | ) | ||
20 | |||
21 | FIND_LIBRARY(ZLIB_LIBRARY z) | ||
22 | |||
23 | if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) | ||
24 | SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) | ||
25 | SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) | ||
26 | SET(ZLIB_FOUND "YES") | ||
27 | else (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) | ||
28 | SET(ZLIB_FOUND "NO") | ||
29 | endif (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) | ||
30 | |||
31 | if (ZLIB_FOUND) | ||
32 | if (NOT ZLIB_FIND_QUIETLY) | ||
33 | message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}") | ||
34 | SET(ZLIB_FIND_QUIETLY TRUE) | ||
35 | endif (NOT ZLIB_FIND_QUIETLY) | ||
36 | else (ZLIB_FOUND) | ||
37 | if (ZLIB_FIND_REQUIRED) | ||
38 | message(FATAL_ERROR "Could not find ZLIB library") | ||
39 | endif (ZLIB_FIND_REQUIRED) | ||
40 | endif (ZLIB_FOUND) | ||
41 | |||
42 | mark_as_advanced( | ||
43 | ZLIB_LIBRARY | ||
44 | ZLIB_INCLUDE_DIR | ||
45 | ) | ||
46 | |||