-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
50 lines (39 loc) · 1.28 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
cmake_minimum_required(VERSION 3.0)
project(FastVC)
option(STATIC "build dependency-free binary" OFF)
#openmp
find_package(OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_CXX_COMPILER "icpc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
#link
#HTS_PREFIX
if(DEFINED HTS_PREFIX)
else()
set(HTS_PREFIX "/usr/local/htslib")
endif()
message("hts dir: " ${HTS_PREFIX})
LINK_DIRECTORIES(${HTS_PREFIX}/lib)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-O3 -g -ffast-math ${CMAKE_CXX_FLAGS}")
if(STATIC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-intel -no-intel-extensions -static-libstdc++ -qopenmp-link=static -lz")
endif ()
#add_subdirectory(src)
aux_source_directory(./src SOURCE_LIST)
aux_source_directory(./src/modes SOURCE_LIST)
message(${SOURCE_LIST})
include_directories(./include ./include/modes ${HTS_PREFIX}/include)
add_executable (FastVC ${SOURCE_LIST})
if(STATIC)
target_link_libraries(FastVC libhts.a)
else()
target_link_libraries(FastVC hts)
endif()
SET(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR})
install(TARGETS FastVC DESTINATION bin)