-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
195 lines (168 loc) · 6.99 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
## ========================================================================
## This file is part of HMMlib.
##
## HMMlib is free software: you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as
## published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## HMMlib is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with HMMlib. If not, see
## <http://www.gnu.org/licenses/>.
##
## Copyright (C) 2010 Bioinformatics Research Centre, Aarhus University.
## Author: Andreas Sand ([email protected])
## ========================================================================
cmake_minimum_required(VERSION 2.6)
IF(UNIX AND NOT WIN32)
message("
====================================================================================
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
<http://www.gnu.org/licenses/>.
Copyright (C) 2010 Bioinformatics Research Centre, Aarhus University.
Author: Andreas Sand ([email protected])
====================================================================================
")
## set(CMAKE_CXX_COMPILER "g++")
## set(CMAKE_C_COMPILER "gcc")
project(HMMlib CXX C)
## Version
set(HMMlib_VERSION_CURRENT "1")
set(HMMlib_VERSION_REVISION "0")
set(HMMlib_VERSION_AGE "2")
# Set the CMAKE_PREFIX_PATH for the find_library function when using non
# standard install location
IF(CMAKE_INSTALL_PREFIX)
set(CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}" ${CMAKE_PREFIX_PATH})
ENDIF(CMAKE_INSTALL_PREFIX)
# openmp
if(WITH_OMP)
find_package(OpenMP)
endif(WITH_OMP)
# Doxygen
find_package(Doxygen)
if (DOXYGEN_FOUND)
add_custom_target(doc ${DOXYGEN_EXECUTABLE} Doxyfile)
endif(DOXYGEN_FOUND)
# Boost
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.42 QUIET COMPONENTS unit_test_framework python)
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
link_libraries(${Boost_LIBRARIES})
message("-- Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
message("-- Boost include directory: ${Boost_INCLUDE_DIRS}")
message("-- Boost lib directory: ${Boost_LIBRARY_DIRS}")
message("-- Boost libraries: ${Boost_LIBRARIES}")
if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
message("-- Boost.Test: yes")
else(Boost_UNIT_TEST_FRAMEWORK_FOUND)
message("-- Boost.Test: no")
message("-- Test code will not be compiled.")
endif(Boost_UNIT_TEST_FRAMEWORK_FOUND)
if(Boost_PYTHON_FOUND)
message("-- Boost.Python: yes")
else(Boost_PYTHON_FOUND)
message("-- Boost.Python: no")
message("-- Python bindings will not be generated.")
endif(Boost_PYTHON_FOUND)
else (Boost_FOUND)
message(FATAL_ERROR "The Boost C++ libraries was not found. Get Boost from http://www.boost.org/ or set the environment variable BOOST_ROOT to point to the root of boost directory.")
endif (Boost_FOUND)
# Python
find_package(PythonLibs QUIET)
if(PYTHONLIBS_FOUND)
message("-- Python: yes")
message("-- Python include directory: ${PYTHON_INCLUDE_PATH}")
message("-- Python libraries: ${PYTHON_LIBRARIES}")
include_directories(${PYTHON_INCLUDE_PATH})
link_libraries(${PYTHON_LIBRARIES})
else(PYTHONLIBS_FOUND)
message("-- Python: no")
message("-- Python bindings will not be generated.")
endif(PYTHONLIBS_FOUND)
set(CMAKE_CXX_FLAGS "-Wall -Wconversion -O3 ${OpenMP_CXX_FLAGS} -msse4 -std=c++11")
# message("CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
enable_testing()
# Add subdirectories
add_subdirectory(HMMlib)
if(Boost_PYTHON_FOUND AND PYTHONLIBS_FOUND)
add_subdirectory(python)
endif(Boost_PYTHON_FOUND AND PYTHONLIBS_FOUND)
if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
add_subdirectory(tests)
endif(Boost_UNIT_TEST_FRAMEWORK_FOUND)
# Effective version number computation
set(HMMlib_VERSION_MAJOR "${HMMlib_VERSION_CURRENT}")
set(HMMlib_VERSION_MINOR "${HMMlib_VERSION_REVISION}")
set(HMMlib_VERSION_PATCH "${HMMlib_VERSION_AGE}")
set(HMMlib_VERSION "${HMMlib_VERSION_MAJOR}.${HMMlib_VERSION_MINOR}.${HMMlib_VERSION_PATCH}")
# Packager
set(CPACK_PACKAGE_NAME "hmmlib")
set(CPACK_PACKAGE_VENDOR "BiRC - Bioinformatics Research Center, Aarhus University, Denmark")
set(CPACK_PACKAGE_VERSION "${HMMlib_VERSION_CURRENT}.${HMMlib_VERSION_REVISION}.${HMMlib_VERSION_AGE}")
set(CPACK_PACKAGE_VERSION_MAJOR "${HMMlib_VERSION_CURRENT}")
set(CPACK_PACKAGE_VERSION_MINOR "${HMMlib_VERSION_REVISION}")
set(CPACK_PACKAGE_VERSION_PATCH "${HMMlib_VERSION_AGE}")
IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
set(CPACK_SYSTEM_NAME x86_64)
set(CPACK_TOPLEVEL_TAG x86_64)
ELSE (CMAKE_SIZEOF_VOID_P MATCHES "8")
set(CPACK_SYSTEM_NAME x86_32)
set(CPACK_TOPLEVEL_TAG x86_32)
ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HMMlib: a library for general hidden Markov Models, exploiting modern CPUs")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set(CPACK_SOURCE_IGNORE_FILES
".*CMakeFiles"
".*Makefile"
".*Makefile_manual"
".*_CPack_Packages"
".*CMakeCache.txt"
".*\\\\.cmake"
".*\\\\.svn/"
"doc"
".*.gz"
".*.zip"
"Testing"
"tests/hmm_test$"
"tests/hmm_table_test$"
"tests/hmm_vector_test$"
"tests/hmm_matrix_test$"
"install_manifest.txt"
".svnignore.txt"
"tests/.svnignore.txt"
"HMMlib/.svnignore.txt"
"python/.svnignore.txt"
"python/pyhmmlib.so"
"python/python_test.py"
".*~"
${CPACK_SOURCE_IGNORE_FILES}
)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
include(CPack)
#This adds the 'dist' target
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
ELSE(UNIX AND NOT WIN32)
message("
================================================
HMMlib 1.0.2 does not support Microsoft Windows.
================================================
")
ENDIF(UNIX AND NOT WIN32)