Package: toppic / 1.3.0+dfsg1-4

0005-Patch-to-use-libpwizlite-and-libhts-from-the-system.patch Patch series | download
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From: Filippo Rusconi <lopippo@debian.org>
Date: Thu, 21 May 2020 22:30:18 +0200
Subject: Patch to use libpwizlite and libhts from the system.

---
 CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 14 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45567e7..9d748a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,19 @@ find_package(Qt5Widgets)
 find_package(Qt5Core)
 find_package(Qt5Gui)
 
+# Find package PwizLite
+find_package(PwizLite REQUIRED)
+message(STATUS "PwizLite_INCLUDE_DIRS: ${PwizLite_INCLUDE_DIRS}")
+message(STATUS "PwizLite_LIBRARIES: ${PwizLite_LIBRARIES}")
+
+# To find package htslib, we first need to resort to the pkg-config
+# program. Find it first.
+find_package(PkgConfig REQUIRED)
+# Now use it to search htslib (that is the name of the pc file).
+pkg_search_module(HtsLib REQUIRED IMPORTED_TARGET htslib libhts)
+message(STATUS "HtsLib_INCLUDE_DIRS: ${HtsLib_INCLUDE_DIRS}")
+message(STATUS "HtsLib_LIBRARY: ${HtsLib_LIBRARY}")
+
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   # Linux specific code
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTOPPIC_LINUX")
@@ -37,7 +50,10 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
                       ${CMAKE_CURRENT_SOURCE_DIR}/ext
                       ${Qt5Widgets_INCLUDE_DIRS}
                       ${Qt5Core_INCLUDE_DIRS}
-                      ${Qt5Gui_INCLUDE_DIRS})
+                      ${Qt5Gui_INCLUDE_DIRS}
+											${PwizLite_INCLUDE_DIRS}
+											${HtsLib_INCLUDE_DIRS}
+											)
 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 
 
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
@@ -53,13 +69,17 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 message(STATUS "cmake cxx flags " ${CMAKE_CXX_FLAGS})
 
 # pwiz
-file(GLOB PWIZ_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/utility/minimxml/*.cpp
-                    ${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/utility/misc/*.cpp
-                    ${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/data/common/*.cpp
-                    ${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/data/msdata/*.cpp)
+# Filippo Rusconi <lopippo@debian.org> Use the system library
+# See below the target_link_libraries functions.
+#file(GLOB PWIZ_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/utility/minimxml/*.cpp
+                    #${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/utility/misc/*.cpp
+                    #${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/data/common/*.cpp
+                    #${CMAKE_CURRENT_SOURCE_DIR}/ext/pwiz/data/msdata/*.cpp)
 
 # hts
-file(GLOB HTS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ext/htslib/*.c)
+# Filippo Rusconi <lopippo@debian.org> Use the system library
+# See below the target_link_libraries functions.
+# file(GLOB HTS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ext/htslib/*.c)
 
 # common
 file(GLOB_RECURSE COMMON_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/common/*.cpp)
@@ -244,32 +264,34 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     target_link_libraries(topfd xerces-c boost_program_options
         boost_filesystem boost_system boost_thread boost_iostreams boost_chrono
-        pthread z)
+				PwizLite::PwizLite pthread z)
 
     target_link_libraries(topfd_gui Qt5Widgets Qt5Core Qt5Gui
-        xerces-c boost_filesystem boost_system boost_thread boost_iostreams boost_chrono pthread z)
+        xerces-c boost_filesystem boost_system boost_thread boost_iostreams
+				boost_chrono PwizLite::PwizLite pthread z)
 
       #target_link_libraries(topfd_single xerces-c boost_program_options
       #  boost_filesystem boost_system boost_thread boost_iostreams boost_chrono
       #  pthread z)
 
     target_link_libraries(toppic xerces-c boost_program_options
-        boost_filesystem boost_system boost_thread pthread z)
+			boost_filesystem boost_system boost_thread PkgConfig::HtsLib pthread z)
 
     target_link_libraries(toppic_gui Qt5Widgets Qt5Core Qt5Gui xerces-c boost_program_options
-        boost_filesystem boost_system boost_thread pthread z)
+        boost_filesystem boost_system boost_thread PkgConfig::HtsLib hts pthread z)
 
     target_link_libraries(topmg xerces-c boost_program_options
-        boost_filesystem boost_system boost_thread pthread z)
+        boost_filesystem boost_system boost_thread PkgConfig::HtsLib pthread z)
 
     target_link_libraries(topmg_gui Qt5Widgets Qt5Core Qt5Gui xerces-c boost_program_options
-        boost_filesystem boost_system boost_thread pthread z)
+        boost_filesystem boost_system boost_thread PkgConfig::HtsLib pthread z)
 
     target_link_libraries(topdiff xerces-c boost_program_options
-	      boost_filesystem boost_system boost_thread pthread z)
+				boost_filesystem boost_system boost_thread PkgConfig::HtsLib pthread z)
 
     target_link_libraries(topdiff_gui Qt5Widgets Qt5Core Qt5Gui
-        xerces-c boost_program_options boost_filesystem boost_system boost_thread boost_iostreams pthread z)
+        xerces-c boost_program_options boost_filesystem boost_system boost_thread boost_iostreams 
+				 PkgConfig::HtsLib pthread z)
 
 #    target_link_libraries(toppic_test xerces-c boost_program_options
 #  boost_filesystem boost_system boost_thread pthread z)