| 1 |
Author: Andreas Tille <[email protected]> |
| 2 |
Last-Update: Fri, 05 Jun 2020 17:53:54 +0200 |
| 3 |
Description: Use Debian packaged libraries also in tests |
| 4 |
|
| 5 |
--- a/test/CMakeLists.txt |
| 6 |
+++ b/test/CMakeLists.txt |
| 7 |
@@ -11,6 +11,7 @@ project(iitii) |
| 8 |
INCLUDE(ExternalProject) |
| 9 |
include_directories(${PROJECT_SOURCE_DIR}/..) |
| 10 |
|
| 11 |
+if(!DEBIAN_BUILD) |
| 12 |
# After build, double-check external/src/htslib-stamp/htslib-build-out.log |
| 13 |
# to make sure CFLAGS were set as expected |
| 14 |
ExternalProject_Add(htslib |
| 15 |
@@ -44,6 +45,9 @@ ExternalProject_Add(CTPL |
| 16 |
ExternalProject_Get_Property(CTPL source_dir) |
| 17 |
set(CTPL_INCLUDE_DIR ${source_dir}) |
| 18 |
include_directories(${CTPL_INCLUDE_DIR}) |
| 19 |
+else() |
| 20 |
+include_directories(/usr/include/htslib) |
| 21 |
+endif() |
| 22 |
|
| 23 |
ExternalProject_Add(catch |
| 24 |
URL https://github.com/philsquared/Catch/archive/v2.9.1.zip |
| 25 |
@@ -59,15 +63,20 @@ include_directories(${source_dir}/single |
| 26 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++17 -Wall -Werror=return-type -Wno-reorder -fdiagnostics-color=auto") |
| 27 |
|
| 28 |
add_executable(test_iitii util.h test_iitii.cc) |
| 29 |
|
| 30 |
+find_package(PkgConfig REQUIRED) |
| 31 |
+pkg_search_module(GLIB REQUIRED glib-2.0) |
| 32 |
+include_directories(${GLIB_INCLUDE_DIRS}) |
| 33 |
+include_directories("../src") ## FIXME: for autopkgtest this line has to be removed |
| 34 |
+## target_link_libraries(test_iitii ${GLIB_LDFLAGS}) |
| 35 |
+#add_dependencies(test_iitii catch libhts) |
| 36 |
target_link_libraries(test_iitii libhts libz.a libbz2.a liblzma.a) |
| 37 |
|
| 38 |
add_executable(dumb_benchmark util.h dumb_benchmark.cc) |
| 39 |
|
| 40 |
+#add_dependencies(dumb_benchmark libhts) |
| 41 |
target_link_libraries(dumb_benchmark libhts libz.a libbz2.a liblzma.a) |
| 42 |
|
| 43 |
add_executable(gnomad_benchmark util.h gnomad_benchmark.cc) |
| 44 |
|
| 45 |
+# add_dependencies(gnomad_benchmark libhts) |
| 46 |
target_link_libraries(gnomad_benchmark libhts libz.a libbz2.a liblzma.a) |
| 47 |
|
| 48 |
include(CTest) |