forked from pjotrp/biolib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·226 lines (193 loc) · 5.39 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# CMakeLists.txt root folder for BIOLIB (see http://biolib.open-bio.org/)
#
# Build everything:
#
# cmake .
#
# Conditionals:
#
# Build the libraries without language interfaces:
#
# cmake -DBUILD_LIBS:BOOLEAN=TRUE .
# cmake -DBUILD_DOCS:BOOLEAN=TRUE .
#
# Build the Ruby/Python/Perl interface and libraries:
#
# cmake -DBUILD_RUBY:BOOLEAN=TRUE .
# cmake -DBUILD_PYTHON:BOOLEAN=TRUE .
# cmake -DBUILD_PERL:BOOLEAN=TRUE .
#
# each of these will include BUILD_LIBS
#
# To build specific libraries, for example
#
# cmake -DSTADEN_LIB:BOOLEAN=TRUE
# cmake -DEMBOSS_LIB:BOOLEAN=TRUE
# cmake -DRQTL_LIB:BOOLEAN=TRUE
#
# Combine with BUILD_RUBY (etc.) to build just one library type.
#
# See ./INSTALL for more information
cmake_minimum_required(VERSION 2.6)
project (BIOLIB)
ENABLE_TESTING()
# Testing:
#
# quicktest: Run fast 'integration' tests
# unittest: Run unit testing
# doctest: Run doctest testing
# regressiontest: Run all regression tests
# test: Run all tests
#
# So:
#
# make unittest
# make doctest
# etc.
#
#
ADD_CUSTOM_TARGET(regressiontest COMMAND ctest -R TestRegression)
ADD_CUSTOM_TARGET(unittest COMMAND ctest -R TestUnit)
ADD_CUSTOM_TARGET(doctest COMMAND ctest -R TestDoc)
ADD_CUSTOM_TARGET(testall COMMAND ctest)
ADD_CUSTOM_TARGET(quicktest COMMAND ctest -E "TestRegression\\|TestUnit\\|Slow\\|TestDoc")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/tools/cmake-support/modules/")
message("CMake modules: ${CMAKE_MODULE_PATH}")
FIND_PACKAGE(GitSubmodule)
include(CheckIncludeFiles)
message("Building biolib:")
if(BUILD_ALL)
set(BUILD_RUBY TRUE)
set(BUILD_PERL TRUE)
set(BUILD_PYTHON TRUE)
endif(BUILD_ALL)
if(BUILD_RUBY)
message(" Ruby interface")
set(BUILD_LIBS TRUE)
endif(BUILD_RUBY)
if(BUILD_PYTHON)
message(" Python interface")
set(BUILD_LIBS TRUE)
endif(BUILD_PYTHON)
if(BUILD_PERL)
message(" Perl interface")
set(BUILD_LIBS TRUE)
endif(BUILD_PERL)
if(NOT BUILD_DOCS)
if(NOT BUILD_LIBS)
set(BUILD_LIBS TRUE)
message(" Building libraries only")
set(BUILD_RUBY TRUE)
message(" Ruby interface")
# set(BUILD_PYTHON TRUE)
# set(BUILD_PERL TRUE)
endif(NOT BUILD_LIBS)
endif(NOT BUILD_DOCS)
# For release 1.0 the following modules are default:
set(BLD_BIOLIB_CORE TRUE)
set(BLD_BIOLIB_R TRUE)
set(BLD_AFFYIO TRUE)
set(BLD_STADEN TRUE)
set(BLD_EMBOSS TRUE)
set(BLD_EXAMPLE TRUE)
# These modules are optional
set(BLD_RQTL FALSE)
set(BLD_LIBSEQUENCE FALSE)
IF(NOT CYGWIN)
set(BLD_AFFYIO TRUE) # still problem finding Rlib
ENDIF()
if (EXAMPLE_LIB)
set(BLD_STADEN FALSE)
set(BLD_EMBOSS FALSE)
set(BLD_RQTL FALSE)
set(BLD_AFFYIO FALSE)
set(BLD_EXAMPLE TRUE)
set(BLD_BIOLIB_CORE FALSE)
set(BLD_BIOLIB_R FALSE)
endif (EXAMPLE_LIB)
if (AFFYIO_LIB)
set(BLD_STADEN FALSE)
set(BLD_EMBOSS FALSE)
set(BLD_RQTL FALSE)
set(BLD_AFFYIO TRUE)
set(BLD_EXAMPLE FALSE)
set(BLD_BIOLIB_CORE TRUE) # requires biolib error handler
set(BLD_BIOLIB_R TRUE) # R dependency for error messages
endif (AFFYIO_LIB)
if (STADEN_LIB)
set(BLD_STADEN TRUE)
set(BLD_EMBOSS FALSE)
set(BLD_RQTL FALSE)
set(BLD_AFFYIO FALSE)
set(BLD_EXAMPLE FALSE)
set(BLD_BIOLIB_CORE FALSE)
set(BLD_BIOLIB_R FALSE)
endif (STADEN_LIB)
if (EMBOSS_LIB)
set(BLD_EMBOSS TRUE)
set(BLD_STADEN FALSE)
set(BLD_RQTL FALSE)
set(BLD_AFFYIO FALSE)
set(BLD_EXAMPLE FALSE)
set(BLD_BIOLIB FALSE)
set(BLD_BIOLIB_R FALSE)
endif (EMBOSS_LIB)
if (RQTL_LIB)
set(BLD_RQTL TRUE)
set(BLD_BIOLIB_CORE TRUE)
set(BLD_BIOLIB_R TRUE)
set(BLD_STADEN FALSE)
set(BLD_EMBOSS FALSE)
set(BLD_AFFYIO FALSE)
set(BLD_EXAMPLE TRUE) # contains typemap tests
endif (RQTL_LIB)
if (LIBSEQUENCE_LIB)
set(BLD_LIBSEQUENCE TRUE)
set(BLD_RQTL FALSE)
set(BLD_STADEN FALSE)
set(BLD_EMBOSS FALSE)
set(BLD_AFFYIO FALSE)
set(BLD_EXAMPLE FALSE)
set(BLD_BIOLIB FALSE)
endif (LIBSEQUENCE_LIB)
if (EXAMPLE_LIB)
set(BLD_RQTL FALSE)
set(BLD_STADEN FALSE)
set(BLD_EMBOSS FALSE)
set(BLD_AFFYIO FALSE)
set(BLD_EXAMPLE TRUE)
set(BLD_BIOLIB_CORE FALSE)
endif (EXAMPLE_LIB)
message(" Biolib libraries")
message(STATUS "Install Biolib_R ${BLD_BIOLIB_R}")
message(STATUS "Install Affyio ${BLD_AFFYIO}")
message(STATUS "Install Staden ${BLD_STADEN}")
message(STATUS "Install EMBOSS ${BLD_EMBOSS}")
message(STATUS "Install RQTL ${BLD_RQTL}")
message(STATUS "Install Libsequence ${BLD_LIBSEQUENCE}")
message(STATUS "Install Example ${BLD_EXAMPLE}")
FIND_PACKAGE(Map)
# SET(CMAKE_BUILD_TYPE Debug) Release is on by default
if(DEBUG)
SET(CMAKE_BUILD_TYPE Debug)
else(DEBUG)
SET(CMAKE_BUILD_TYPE Release)
endif(DEBUG)
SET(DEFAULT_BUILD_SHARED_LIBS ON)
SET(BUILD_SHARED_LIBS ${DEFAULT_BUILD_SHARED_LIBS} CACHE BOOL "Building shared or static libraries")
# Documentation
if (BUILD_DOCS)
INCLUDE (APIDoc)
endif (BUILD_DOCS)
# Turn off chatty makefiles by default. To make them chatty again,
# call make with VERBOSE=1 like this:
#
# make VERBOSE=1
SET(CMAKE_VERBOSE_MAKEFILE OFF)
############################################################
# Set default search directory prefixes for third party libraries.
SET(THIRD_PARTY_LIBRARY_PATH "" CACHE PATH "Default search path for third-party libraries")
SET(THIRD_PARTY_INCLUDE_PATH "" CACHE PATH "Default search path for third-party headers")
add_subdirectory (src)
include(src)
FIND_PACKAGE(SystemInfo)