-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
77 lines (65 loc) · 2.84 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
# CMake compatibility issues: don't modify this, please!
cmake_minimum_required(VERSION 2.6.3)
project(brownie)
# project version
set(${PROJECT_NAME}_MAJOR_VERSION 0)
set(${PROJECT_NAME}_MINOR_VERSION 1)
set(${PROJECT_NAME}_PATCH_LEVEL 0)
# set the default configuration to Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# set the module path
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# set some definitions
if(MAXKMERLENGTH)
add_definitions("-DMAXKMERLENGTH=${MAXKMERLENGTH}")
else(MAXKMERLENGTH)
add_definitions("-DMAXKMERLENGTH=31")
endif(MAXKMERLENGTH)
add_definitions("-DCATEGORIES=2")
add_definitions("-DBROWNIE_MAJOR_VERSION=${${PROJECT_NAME}_MAJOR_VERSION}")
add_definitions("-DBROWNIE_MINOR_VERSION=${${PROJECT_NAME}_MINOR_VERSION}")
add_definitions("-DBROWNIE_PATCH_LEVEL=${${PROJECT_NAME}_PATCH_LEVEL}")
# set windows specific flags
if (MSVC)
add_definitions("-D_SCL_SECURE_NO_WARNINGS")
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
endif (MSVC)
# set g++ specific flags
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS "-Wno-deprecated -std=c++11 -fopenmp")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -Wall -pedantic -Wno-long-long")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g3")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -Wall -pedantic -Wno-long-long")
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
# uncomment the portion below to disable assertions
if (CMAKE_BUILD_TYPE STREQUAL Release)
add_definitions(-DNDEBUG)
else (CMAKE_BUILD_TYPE STREQUAL Release)
add_definitions(-DDEBUG)
endif (CMAKE_BUILD_TYPE STREQUAL Release)
# check if zlib is present
find_package(ZLIB)
if (ZLIB_FOUND)
add_definitions(-DHAVE_ZLIB)
include_directories(${ZLIB_INCLUDE_DIR})
endif(ZLIB_FOUND)
set(CMAKE_VERBOSE_MAKEFILE ON)
# set include path for Google's sparse hash table
find_package(SparseHash)
if (SPARSEHASH_FOUND)
include_directories(${SPARSEHASH_INCLUDE_DIR})
else (SPARSEHASH_FOUND)
message(FATAL_ERROR "\nFATAL ERROR: The required Google SparseHash package"
" could not be found on this system. Please refer to the Velvet "
"manual for the Google Sparsehash installation instructions. If "
"you installed Google Sparsehash in a non-standard location "
"(e.g. somewhere in your homedir), you can point cmake to the "
"installation location as follows: \ncmake "
"-DSPARSEHASH_INCLUDE_DIR=<path-to-sparsehash>/include .")
endif(SPARSEHASH_FOUND)
add_subdirectory(src)
add_subdirectory(unittest)