-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
executable file
·62 lines (35 loc) · 1.66 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
cmake_minimum_required(VERSION 2.8.0)
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_LAST_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(KMER_SIZE 55 CACHE STRING "BayesTyper kmer size")
if(${KMER_SIZE} GREATER 255)
message(FATAL_ERROR "\nKmer size needs to be <= 255")
else(${KMER_SIZE} GREATER 255)
message(STATUS "Kmer size: " ${KMER_SIZE})
endif(${KMER_SIZE} GREATER 255)
SET(BUILD_STATIC 0 CACHE BOOL "Build static")
if(${BUILD_STATIC} EQUAL 0)
SET(CMAKE_CXX_FLAGS "--std=c++11 -lpthread -g -O3 -DBT_KMER_SIZE='${KMER_SIZE}' -DBT_VERSION='\"v1.5 ${GIT_LAST_COMMIT_HASH}\"'")
else(${BUILD_STATIC} EQUAL 0)
message(STATUS "Building BayesTyper static")
SET(CMAKE_CXX_FLAGS "--std=c++11 -pthread -O3 -static -static-libgcc -static-libstdc++ -DBT_KMER_SIZE='${KMER_SIZE}' -DBT_VERSION='\"v1.5\"'")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--whole-archive -lpthread -Wl,--no-whole-archive")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBS OFF)
SET(Boost_USE_STATIC_LIBS ON)
endif(${BUILD_STATIC} EQUAL 0)
FIND_PACKAGE(Boost COMPONENTS iostreams program_options system filesystem serialization REQUIRED)
message(STATUS ${Boost_LIBRARIES})
add_subdirectory(${CMAKE_SOURCE_DIR}/external/kmc_api)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/vcf++)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/kmerBloom)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/bayesTyper)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/bayesTyperTools)
SET(BUILD_SCRIPTS 0 CACHE BOOL "Build BayesTyperTools scripts")
if(${BUILD_SCRIPTS} EQUAL 1)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/bayesTyperTools/scripts)
endif(${BUILD_SCRIPTS} EQUAL 1)