-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (39 loc) · 1.1 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
cmake_minimum_required(VERSION 3.16...3.22)
include(cmake/BuildType.cmake)
project(
amstools
VERSION 0.4
DESCRIPTION "Collection of fast and efficient biological sequence tools"
LANGUAGES CXX
)
## prevent in-source builds
#
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles.")
endif()
## must include after the project call due to GNUInstallDirs requiring a
## language be enabled
#
include(GNUInstallDirs)
## check for zlib
#
find_package(ZLIB)
## check for cxxopts
#
find_package(
cxxopts CONFIG
HINTS $ENV{HOME} $ENV{HOME}/.local /usr/local /usr
)
if(NOT cxxopts_FOUND)
message(STATUS "Fetching cxxopts library...")
include(FetchContent)
FetchContent_Declare(
cxxopts
GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
GIT_TAG v3.1.1
)
FetchContent_MakeAvailable(cxxopts)
endif()
enable_testing()
add_subdirectory(src)