1
1
cmake_minimum_required (VERSION 3.14)
2
- enable_language (CXX)
2
+ project (orient VERSION 0.4.0)
3
+ set (CMAKE_CXX_STANDARD 17)
4
+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
3
5
4
6
option (ORIE_TEST "Build Google Test for Orient Library" OFF )
5
7
option (ORIE_SYSTEM_PCRE2 "Use System PCRE2 Library" OFF )
6
8
option (ORIE_SYSTEM_ZSTD "Use System zstd Library" OFF )
7
9
option (ORIE_SYSTEM_RAPIDFUZZ "Use System rapidfuzz Library" OFF )
8
10
option (ORIE_LINK_STATIC "Statically link orient executable" OFF )
9
11
10
- # Unfortunately PCRE2 provides no package name therefore whether to use system
11
- # library can only be manually toggled unlike GTest.
12
12
include (FetchContent)
13
13
include (GNUInstallDirs)
14
14
include (CMakePackageConfigHelpers)
15
15
set (targs_to_install orie)
16
16
17
+ # Unfortunately PCRE2 provides no package name therefore whether to use system
18
+ # library can only be manually toggled unlike GTest.
17
19
if (NOT ORIE_SYSTEM_PCRE2)
18
20
FetchContent_Declare(pcre2
19
21
GIT_REPOSITORY https://github.com/PCRE2Project/pcre2
@@ -31,11 +33,12 @@ if (NOT ORIE_SYSTEM_PCRE2)
31
33
endif (NOT ORIE_SYSTEM_PCRE2)
32
34
set (orie_pcre2_libname pcre2-)
33
35
34
- # zstd CMake file is in build/cmake
35
36
if (NOT ORIE_SYSTEM_ZSTD)
36
37
FetchContent_Declare(zstd
37
38
GIT_REPOSITORY https://github.com/facebook/zstd.git
38
39
GIT_TAG v1.5.1)
40
+ # zstd CMake file is in build/cmake
41
+ # cannot simply call FetchContent_MakeAvailable due to this
39
42
FetchContent_GetProperties(zstd)
40
43
if (NOT zstd_POPULATED)
41
44
FetchContent_Populate(zstd)
@@ -54,17 +57,10 @@ if (NOT ORIE_SYSTEM_RAPIDFUZZ)
54
57
GIT_REPOSITORY https://github.com/maxbachmann/rapidfuzz-cpp.git
55
58
GIT_TAG main)
56
59
FetchContent_MakeAvailable(rapidfuzz)
57
- # A bug in rapidfuzz cmake stopped it from installing if project name is set
58
60
else (NOT ORIE_SYSTEM_RAPIDFUZZ)
59
61
find_package (rapidfuzz REQUIRED)
60
62
endif (NOT ORIE_SYSTEM_RAPIDFUZZ)
61
63
62
- # A bug in rapidfuzz cmake stopped it from installing if project name is set
63
- # therefore set project name here.
64
- project (orient VERSION 0.4.0)
65
- set (CMAKE_CXX_STANDARD 17)
66
- set (CMAKE_CXX_STANDARD_REQUIRED ON )
67
-
68
64
# List common sources
69
65
set (s ${CMAKE_CURRENT_SOURCE_DIR} /src/fs)
70
66
set (orie_src
0 commit comments