forked from schmeing/ReSeq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·85 lines (71 loc) · 2.87 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
cmake_minimum_required(VERSION 3.1)
project(reseq)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: Debug Release
RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# Require C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Testing framework
add_subdirectory(googletest)
SET( GTEST_ROOT "${PROJECT_SOURCE_DIR}/googletest/googletest/" )
include_directories(${GTEST_ROOT}/include)
# Compression packages
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
# Add boost
cmake_policy(SET CMP0057 NEW)
find_package(Boost 1.48.0 REQUIRED filesystem math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l program_options serialization system)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
SET( BOOST_LIBRARY_FLAGS "-lboost_serialization -lboost_program_options -lboost_filesystem -lboost_system" )
# Suppress warnings of deprecated std::auto_ptr used in boost
SET( BOOST_LIBRARY_FLAGS "${BOOST_LIBRARY_FLAGS} -Wno-deprecated-declarations" )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BOOST_LIBRARY_FLAGS}" )
# Fix FindBoost issue with not giving ${Boost_LIBRARY_DIRS}
if(NOT $ENV{BOOST_ROOT} STREQUAL "")
link_directories("$ENV{BOOST_ROOT}/lib/")
endif()
if(NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "")
link_directories($ENV{BOOST_LIBRARYDIR})
endif()
# Add NLopt
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdeprecated-declarations" )
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/nlopt/cmake/")
add_subdirectory(nlopt)
include_directories("${PROJECT_SOURCE_DIR}/build/nlopt/src/api/")
# Add SeqAn
SET(SEQAN_INCLUDE_PATH "${PROJECT_SOURCE_DIR}/seqan/include")
include_directories(${SEQAN_INCLUDE_PATH})
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/seqan/util/cmake/")
find_package(SeqAn REQUIRED)
include_directories(${SEQAN_INCLUDE_DIRS})
add_definitions(${SEQAN_DEFINITIONS})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS}")
# Output directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Version
set(RESEQ_VERSION_MAJOR 1)
set(RESEQ_VERSION_MINOR 1)
# Configure header file to pass CMake settings to code
configure_file(
"${PROJECT_SOURCE_DIR}/CMakeConfig.h.in"
"${PROJECT_BINARY_DIR}/CMakeConfig.h"
)
# Compiler flags
SET(GCC_COVERAGE_COMPILE_FLAGS "-std=c++14 -fPIC -lrt -fext-numeric-literals")
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
# Include directories
include_directories("${PROJECT_BINARY_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/reseq")
include_directories("${PROJECT_SOURCE_DIR}/2016-05-15_ROOTPWA/utilities")
# Subdirectories
add_subdirectory(skewer)
add_subdirectory(reseq)
add_subdirectory(python)