Mercurial > hg > orthanc
comparison OrthancFramework/Resources/CMake/ZlibConfiguration.cmake @ 4044:d25f4c0fa160 framework
splitting code into OrthancFramework and OrthancServer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 10 Jun 2020 20:30:34 +0200 |
parents | Resources/CMake/ZlibConfiguration.cmake@c783f4f29390 |
children | 304842a0d152 |
comparison
equal
deleted
inserted
replaced
4043:6c6239aec462 | 4044:d25f4c0fa160 |
---|---|
1 if (STATIC_BUILD OR NOT USE_SYSTEM_ZLIB) | |
2 SET(ZLIB_SOURCES_DIR ${CMAKE_BINARY_DIR}/zlib-1.2.11) | |
3 SET(ZLIB_URL "http://orthanc.osimis.io/ThirdPartyDownloads/zlib-1.2.11.tar.gz") | |
4 SET(ZLIB_MD5 "1c9f62f0778697a09d36121ead88e08e") | |
5 | |
6 DownloadPackage(${ZLIB_MD5} ${ZLIB_URL} "${ZLIB_SOURCES_DIR}") | |
7 | |
8 include_directories( | |
9 ${ZLIB_SOURCES_DIR} | |
10 ) | |
11 | |
12 list(APPEND ZLIB_SOURCES | |
13 ${ZLIB_SOURCES_DIR}/adler32.c | |
14 ${ZLIB_SOURCES_DIR}/compress.c | |
15 ${ZLIB_SOURCES_DIR}/crc32.c | |
16 ${ZLIB_SOURCES_DIR}/deflate.c | |
17 ${ZLIB_SOURCES_DIR}/infback.c | |
18 ${ZLIB_SOURCES_DIR}/inffast.c | |
19 ${ZLIB_SOURCES_DIR}/inflate.c | |
20 ${ZLIB_SOURCES_DIR}/inftrees.c | |
21 ${ZLIB_SOURCES_DIR}/trees.c | |
22 ${ZLIB_SOURCES_DIR}/uncompr.c | |
23 ${ZLIB_SOURCES_DIR}/zutil.c | |
24 ) | |
25 | |
26 if (NOT ORTHANC_SANDBOXED) | |
27 # The source files below require access to the filesystem | |
28 list(APPEND ZLIB_SOURCES | |
29 ${ZLIB_SOURCES_DIR}/gzlib.c | |
30 ${ZLIB_SOURCES_DIR}/gzclose.c | |
31 ${ZLIB_SOURCES_DIR}/gzread.c | |
32 ${ZLIB_SOURCES_DIR}/gzwrite.c | |
33 ) | |
34 endif() | |
35 | |
36 source_group(ThirdParty\\zlib REGULAR_EXPRESSION ${ZLIB_SOURCES_DIR}/.*) | |
37 | |
38 if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR | |
39 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") | |
40 # "ioapi.c" from zlib (minizip) expects the "IOAPI_NO_64" macro to be set to "true" | |
41 # https://ohse.de/uwe/articles/lfs.html | |
42 add_definitions( | |
43 -DIOAPI_NO_64=1 | |
44 ) | |
45 endif() | |
46 | |
47 else() | |
48 include(FindZLIB) | |
49 include_directories(${ZLIB_INCLUDE_DIRS}) | |
50 link_libraries(${ZLIB_LIBRARIES}) | |
51 endif() |