-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
111 lines (83 loc) · 2 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
cmake_minimum_required(VERSION 2.8.1)
cmake_policy(SET CMP0015 NEW)
project(sts CXX)
OPTION(USE_OPENMP "Use OpenMP if available." OFF)
#
# cmake modules
#
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake
${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/cxx11/Modules)
#
# Versioning
#
include(GetGitRevisionDescription)
git_describe(GIT_DESCRIPTION --always --long)
#
# Compiler settings
#
include(FindCXXFeatures)
if(NOT _HAS_CXX11_FLAG)
message( FATAL_ERROR "-std=c++11 flag not supported." )
endif()
set(CMAKE_CXX_FLAGS "-g -Wall -Wextra -pedantic ${CXX11_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}")
IF(USE_OPENMP)
find_package(OpenMP)
IF (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(OPENMP_FOUND)
ENDIF(USE_OPENMP)
#
# In-tree dependencies
#
OPTION(USE_BEAGLE "Use BEAGLE library." OFF)
# boostable
include_directories(SYSTEM lib/boostable)
# lcfit
include_directories(lib/lcfit/lcfit_src)
include_directories(lib/lcfit/lcfit_cpp_src)
add_subdirectory(lib/lcfit)
# SMCTC
add_definitions(-DSMCTC_HAVE_BGL)
include_directories(SYSTEM lib/smctc/include)
add_subdirectory(lib/smctc)
# JsonCpp
include_directories(lib/jsoncpp/include)
add_subdirectory(lib/jsoncpp)
# tclap
include_directories(lib/include)
#
# External dependencies
#
# pkg-config
find_package(PkgConfig REQUIRED)
# BEAGLE
IF(USE_BEAGLE)
pkg_check_modules(HMS_BEAGLE hmsbeagle-1 REQUIRED)
include_directories(${HMS_BEAGLE_INCLUDE_DIRS})
link_directories(${HMS_BEAGLE_LIBRARY_DIRS})
ELSE(USE_BEAGLE)
SET(NO_BEAGLE "1")
add_definitions("-DNO_BEAGLE")
ENDIF(USE_BEAGLE)
# Bio++
find_package(Bpp REQUIRED)
include_directories(SYSTEM ${BPP_INCLUDES})
# GSL
include(FindGsl)
find_package(Gsl REQUIRED)
include_directories(SYSTEM ${GSL_INCLUDE_DIRS})
link_directories(${GSL_LIBRARY_DIRS})
#
# sts proper
#
add_subdirectory(src)
#
# Tests
#
IF (BUILD_TESTING)
enable_testing()
add_subdirectory(test)
ENDIF (BUILD_TESTING)