-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
82 lines (63 loc) · 2.46 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
cmake_minimum_required(VERSION 3.7)
project(REViewer)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Check for required packages:
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
find_package(LibLZMA REQUIRED)
include(ExternalProject)
set(installDir ${CMAKE_CURRENT_BINARY_DIR}/install)
ExternalProject_Add(htslib
BUILD_IN_SOURCE YES
URL https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2
CONFIGURE_COMMAND ./configure --prefix=${installDir} --disable-libcurl
BUILD_COMMAND $(MAKE) lib-static
)
# Setup boost user config so that it uses the same c++ compiler as other components:
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (BOOST_COMPILER_TAG "gcc")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (BOOST_COMPILER_TAG "clang")
set(B2_OPTIONS ${B2_OPTIONS} "toolset=clang")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set (BOOST_COMPILER_TAG "darwin")
set(B2_OPTIONS ${B2_OPTIONS} "toolset=clang")
endif()
if (BOOST_COMPILER_TAG)
set(BOOST_UCONFIG "${CMAKE_BINARY_DIR}/user-config.jam")
file(WRITE "${BOOST_UCONFIG}" "using ${BOOST_COMPILER_TAG} : : \"${CMAKE_CXX_COMPILER}\" ;\n")
set(BOOST_PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${BOOST_UCONFIG} tools/build/src/user-config.jam)
endif()
ExternalProject_Add(Boost
BUILD_IN_SOURCE YES
URL https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2
PATCH_COMMAND ${BOOST_PATCH_COMMAND}
CONFIGURE_COMMAND ./bootstrap.sh --prefix=${installDir}
BUILD_COMMAND ./b2 install -j8 --with-filesystem --with-system --with-program_options link=static ${B2_OPTIONS}
INSTALL_COMMAND ""
)
ExternalProject_Add(spdlog
URL https://github.com/gabime/spdlog/archive/refs/tags/v1.6.1.tar.gz
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${installDir}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
)
ExternalProject_Add(catch2
URL https://github.com/catchorg/Catch2/archive/refs/tags/v2.12.4.tar.gz
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${installDir}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DBUILD_TESTING=OFF
)
ExternalProject_Add(reviewer
SOURCE_DIR ${CMAKE_SOURCE_DIR}/reviewer
BUILD_ALWAYS YES
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${installDir}
-DCMAKE_PREFIX_PATH:PATH=${installDir}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
)
ExternalProject_Add_StepDependencies(reviewer configure
Boost spdlog htslib catch2)