-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
88 lines (66 loc) · 2.72 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8...3.23)
project(qbcf)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -pthread -std=c++11")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
find_path(HTS_INCLUDE_DIRS htslib/bgzf.h ../htslib/bgzf.h HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/ ../htslib)
if(NOT HTS_INCLUDE_DIRS )
message(FATAL_ERROR "libhts HTS_INCLUDE_DIRS not found")
endif()
message(STATUS ${HTS_INCLUDE_DIRS})
find_library(HTS_LIBRARIES libhts.a HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/ ../htslib/)
if(NOT HTS_LIBRARIES)
message(FATAL_ERROR "libhts HTS_LIBRARIES not found")
endif()
message(STATUS ${HTS_LIBRARIES})
find_path(QGEN_INCLUDE_DIRS qgenlib/qgen_error.h HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/ ../qgenlib)
if(NOT QGEN_INCLUDE_DIRS )
message(FATAL_ERROR "libqgen QGEN_INCLUDE_DIRS not found")
endif()
message(STATUS ${QGEN_INCLUDE_DIRS})
find_library(QGEN_LIBRARIES libqgen.a HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/ ../qgenlib/lib/)
if(NOT QGEN_LIBRARIES)
message(FATAL_ERROR "libqgen QGEN_LIBRARIES not found")
endif()
message(STATUS ${QGEN_LIBRARIES})
include_directories(${HTS_INCLUDE_DIRS} ${QGEN_INCLUDE_DIRS})
set(SOURCE_FILES
nuclear_pedigree.h nuclear_pedigree.cpp
sex_ploidy_map.h sex_ploidy_map.cpp
bcf_utils.h bcf_utils.cpp
qbcf_cally.cpp
qbcf_test_qgenlib.cpp
qbcf.h qbcf.cpp
)
SET(APP_EXE qbcf)
#find_package(OpenMP REQUIRED)
ADD_EXECUTABLE(${APP_EXE} ${SOURCE_FILES})
find_library(ZLIB z HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT ZLIB)
message(FATAL_ERROR "libz library not found")
endif()
find_library(CURLLIB curl HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT CURLLIB)
message(FATAL_ERROR "libcurl library not found")
endif()
find_package (BZip2)
if (NOT BZIP2_FOUND)
message(FATAL_ERROR "libbz2 library not found")
else()
include_directories(${BZIP2_INCLUDE_DIRS})
set(BZIP2 ${BZIP2_LIBRARIES})
endif()
find_library(LZMA lzma HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT LZMA)
message(WARNING "liblzma library not found, if you specified --disable-lzma when compiling libhts, please ignore this warning")
set(LZMA "")
else()
set(LZMA ${LZMA_LIBRARIES})
endif()
find_library(CRYPTOLIB crypto HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT CRYPTOLIB)
message(FATAL_ERROR "libcrypto library not found")
endif()
TARGET_LINK_LIBRARIES(${APP_EXE} PRIVATE ${QGEN_LIBRARIES} ${HTS_LIBRARIES} ${ZLIB} ${LZMA} ${BZIP2} ${CURLLIB} ${CRYPTOLIB} "${OpenMP_CXX_FLAGS}")
target_compile_options(${APP_EXE} PRIVATE "${OpenMP_CXX_FLAGS}")
install(TARGETS ${APP_EXE} RUNTIME DESTINATION bin)