forked from UMCUGenetics/guix-additions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanta-use-system-zlib.patch
70 lines (67 loc) · 2.31 KB
/
manta-use-system-zlib.patch
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
66
67
68
69
70
This patch originates from Debian:
https://anonscm.debian.org/cgit/debian-med/manta.git/tree/debian/patches/use_debian_packaged_zlib.patch
Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 15 Nov 2016 14:29:08 +0100
Description: Check for Debian packaged zlib
--- a/redist/CMakeLists.txt
+++ b/redist/CMakeLists.txt
@@ -50,56 +50,10 @@ endif ()
#
# zlib
#
-set(ZLIB_PREFIX "zlib-1.2.8")
-superset(ZLIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ZLIB_PREFIX}")
-if (WIN32)
- superset(ZLIB_LIBRARY "${ZLIB_DIR}/${CMAKE_BUILD_TYPE}/zlibstatic.lib")
-else ()
- superset(ZLIB_LIBRARY "${ZLIB_DIR}/libz.a")
-endif ()
-
-add_custom_command(
- OUTPUT ${ZLIB_DIR}
- COMMAND ${CMAKE_COMMAND} -E remove_directory "${ZLIB_DIR}"
- COMMAND ${CMAKE_COMMAND} -E tar xjf "${THIS_REDIST_DIR}/${ZLIB_PREFIX}.tar.bz2"
- COMMENT "Unpacking zlib package")
-
-if (NOT WIN32)
- set (ASM_MAKE_OPTION LOC=-DASMV OBJA=match.o)
- if (THIS_ARCH MATCHES "^.*86$")
- set(ZLIB_ARCH "")
- set(ASM_FILE_COPY cp contrib/asm686/match.S match.S)
- elseif (THIS_ARCH MATCHES "^x86_64$")
- set(ZLIB_ARCH "--64")
- set(ASM_FILE_COPY cp contrib/amd64/amd64-match.S match.S)
- else ()
- set (ZLIB_ARCH "")
- set (ASM_FILE_COPY "")
- set (ASM_MAKE_OPTION "")
- endif ()
-
- add_custom_command(
- OUTPUT ${ZLIB_LIBRARY}
- COMMAND CC=${CMAKE_C_COMPILER} ${ZLIB_DIR}/configure --prefix="${ZLIB_DIR}" --static ${ZLIB_ARCH} >zlib.config.log
- COMMAND ${ASM_FILE_COPY}
- COMMAND $(MAKE) ${ASM_MAKE_OPTION} >zlib.build.log 2>zlib.build.error.log
- WORKING_DIRECTORY ${ZLIB_DIR}
- DEPENDS ${ZLIB_DIR}
- COMMENT "Building zlib package")
-else ()
- add_custom_command(
- OUTPUT ${ZLIB_LIBRARY}
- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" ${THIS_CMAKE_PLATFORM} -DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}" ${ZLIB_DIR} >zlib.config.log
- COMMAND ${CMAKE_MAKE_PROGRAM} /p:Configuration=${CMAKE_BUILD_TYPE} "${ZLIB_DIR}/zlib.sln" >zlib.build.log
- WORKING_DIRECTORY ${ZLIB_DIR}
- DEPENDS ${ZLIB_DIR}
- COMMENT "Building zlib package")
-endif ()
-
-
-set(THIS_ZLIB "${THIS_PROJECT_NAME}_zlib")
-add_custom_target(${THIS_ZLIB} DEPENDS "${ZLIB_LIBRARY}")
-
+find_package(ZLIB REQUIRED)
+if (ZLIB_FOUND)
+ set(HAVE_ZLIB 1)
+endif()
#
# htslib