aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPetr Vaněk <arkamar@atlas.cz>2021-08-21 11:24:35 +0200
committerPetr Vaněk <arkamar@atlas.cz>2021-08-21 11:57:11 +0200
commit309bb213cffb23e6bee98157b53cf5db31f97ef9 (patch)
treec79b321634c0fbaa90f5b459a6a8a0445c32363a /CMakeLists.txt
parentebb10e3c0dba4c21f71f76b370898023f1b22e98 (diff)
downloadrspamd-309bb213cffb23e6bee98157b53cf5db31f97ef9.tar.gz
rspamd-309bb213cffb23e6bee98157b53cf5db31f97ef9.zip
Add SYSTEM_FMT cmake option
This gives packagers option to use system version of fmt rather than bundled one. It is disabled by default.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c38758f3..fc4175677 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,7 @@ OPTION(ENABLE_LIBUNWIND "Use libunwind to print crash traces [default: OFF]"
OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF)
OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]" ON)
OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF)
+OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [defalut: OFF]" OFF)
############################# INCLUDE SECTION #############################################
@@ -117,7 +118,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/"
"${CMAKE_SOURCE_DIR}/contrib/lc-btrie"
"${CMAKE_SOURCE_DIR}/contrib/lua-lpeg"
"${CMAKE_SOURCE_DIR}/contrib/frozen/include"
- "${CMAKE_SOURCE_DIR}/contrib/fmt/include"
"${CMAKE_SOURCE_DIR}/contrib/doctest"
"${CMAKE_SOURCE_DIR}/contrib/fu2/include"
"${CMAKE_BINARY_DIR}/src" #Stored in the binary dir
@@ -650,7 +650,12 @@ ADD_SUBDIRECTORY(contrib/libev)
ADD_SUBDIRECTORY(contrib/kann)
ADD_SUBDIRECTORY(contrib/fastutf8)
ADD_SUBDIRECTORY(contrib/google-ced)
-ADD_SUBDIRECTORY(contrib/fmt)
+IF(SYSTEM_FMT MATCHES "OFF")
+ ADD_SUBDIRECTORY(contrib/fmt)
+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/fmt/include")
+ELSE()
+ find_package(fmt)
+ENDIF()
ADD_SUBDIRECTORY(contrib/doctest)
IF (NOT WITH_LUAJIT)