Skip to content

Commit acd80bd

Browse files
committed
Comply with dependency's CMake bug fix
1 parent 135f50e commit acd80bd

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

CMakeLists.txt

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
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)
35

46
option(ORIE_TEST "Build Google Test for Orient Library" OFF)
57
option(ORIE_SYSTEM_PCRE2 "Use System PCRE2 Library" OFF)
68
option(ORIE_SYSTEM_ZSTD "Use System zstd Library" OFF)
79
option(ORIE_SYSTEM_RAPIDFUZZ "Use System rapidfuzz Library" OFF)
810
option(ORIE_LINK_STATIC "Statically link orient executable" OFF)
911

10-
# Unfortunately PCRE2 provides no package name therefore whether to use system
11-
# library can only be manually toggled unlike GTest.
1212
include(FetchContent)
1313
include(GNUInstallDirs)
1414
include(CMakePackageConfigHelpers)
1515
set(targs_to_install orie)
1616

17+
# Unfortunately PCRE2 provides no package name therefore whether to use system
18+
# library can only be manually toggled unlike GTest.
1719
if (NOT ORIE_SYSTEM_PCRE2)
1820
FetchContent_Declare(pcre2
1921
GIT_REPOSITORY https://github.com/PCRE2Project/pcre2
@@ -31,11 +33,12 @@ if (NOT ORIE_SYSTEM_PCRE2)
3133
endif(NOT ORIE_SYSTEM_PCRE2)
3234
set(orie_pcre2_libname pcre2-)
3335

34-
# zstd CMake file is in build/cmake
3536
if (NOT ORIE_SYSTEM_ZSTD)
3637
FetchContent_Declare(zstd
3738
GIT_REPOSITORY https://github.com/facebook/zstd.git
3839
GIT_TAG v1.5.1)
40+
# zstd CMake file is in build/cmake
41+
# cannot simply call FetchContent_MakeAvailable due to this
3942
FetchContent_GetProperties(zstd)
4043
if (NOT zstd_POPULATED)
4144
FetchContent_Populate(zstd)
@@ -54,17 +57,10 @@ if (NOT ORIE_SYSTEM_RAPIDFUZZ)
5457
GIT_REPOSITORY https://github.com/maxbachmann/rapidfuzz-cpp.git
5558
GIT_TAG main)
5659
FetchContent_MakeAvailable(rapidfuzz)
57-
# A bug in rapidfuzz cmake stopped it from installing if project name is set
5860
else (NOT ORIE_SYSTEM_RAPIDFUZZ)
5961
find_package(rapidfuzz REQUIRED)
6062
endif (NOT ORIE_SYSTEM_RAPIDFUZZ)
6163

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-
6864
# List common sources
6965
set(s ${CMAKE_CURRENT_SOURCE_DIR}/src/fs)
7066
set(orie_src

0 commit comments

Comments
 (0)