Commit 663dd0bb authored by Andreas Tille's avatar Andreas Tille
Browse files

Adapt build system to Debian packaged libhts

parent 7bd06402
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5,7 +5,8 @@ Section: science
Priority: optional
Build-Depends: debhelper (>= 12~),
               cmake,
               libhdf5-dev
               libhdf5-dev,
               libhts-dev
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/med-team/kallisto
Vcs-Git: https://salsa.debian.org/med-team/kallisto.git

debian/patches/series

0 → 100644
+1 −0
Original line number Diff line number Diff line
use_debian_packaged_htslib.patch
+55 −0
Original line number Diff line number Diff line
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 21 Mar 2019 15:53:04 +0100
Description: Adapt build system to Debian packaged libhts

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,7 +34,7 @@ ELSE(LINK MATCHES shared)
     message("shared build")
 ENDIF(LINK MATCHES static)
 
-
+if(!DEBIAN_BUILD)
 include(ExternalProject)
 ExternalProject_Add(htslib
     PREFIX ${PROJECT_SOURCE_DIR}/ext/htslib
@@ -47,7 +47,7 @@ ExternalProject_Add(htslib
 )
 
 include_directories(${htslib_PREFIX}/src/htslib)
-
+endif()
 
 
 # add_compile_options(-Wdeprecated-register)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,7 +3,9 @@ file(GLOB headers *.h *.hpp)
 
 list(REMOVE_ITEM sources main.cpp)
 
+if(!DEBIAN_BUILD)
 include_directories(../ext/htslib)
+endif()
 
 add_library(kallisto_core ${sources} ${headers})
 target_include_directories(kallisto_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
@@ -11,7 +13,11 @@ target_include_directories(kallisto_core
 add_executable(kallisto main.cpp)
 
 find_package( Threads REQUIRED )
+if(DEBIAN_BUILD)
+target_link_libraries(kallisto kallisto_core pthread hts)
+else()
 target_link_libraries(kallisto kallisto_core pthread ${CMAKE_CURRENT_SOURCE_DIR}/../ext/htslib/libhts.a)
+endif()
 
 if(LINK MATCHES static)
     set(BUILD_SHARED_LIBS OFF)
@@ -56,4 +62,4 @@ else()
 endif(LINK MATCHES static)
 
 
-install(TARGETS kallisto DESTINATION "${CMAKE_INSTALL_BINDIR}")
\ No newline at end of file
+install(TARGETS kallisto DESTINATION "${CMAKE_INSTALL_BINDIR}")
+3 −4
Original line number Diff line number Diff line
@@ -20,12 +20,11 @@ include /usr/share/dpkg/default.mk
%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DDEBIAN_BUILD=1

### When overriding auto_test make sure DEB_BUILD_OPTIONS will be respected
#override_dh_auto_test:
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#	do_stuff_for_testing
#endif

### If you **really** can not use uscan (even not with mode=git) use a debian/get-orig-script
#get-orig-source:
#	. debian/get-orig-source