Blob Blame History Raw
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,7 +106,7 @@ find_package(Protobuf REQUIRED)
 find_package(ZLIB REQUIRED)
 find_package(Unwind)
 
-if(DISABLE_VCPKG)
+if(DISABLE_VCPKG AND NOT USE_SYSTEM_PKGS)
 add_subdirectory(${EXTERNAL_DIR}/Catch2)
 add_subdirectory(${EXTERNAL_DIR}/cxxopts)
 add_subdirectory(${EXTERNAL_DIR}/cpp-httplib)
@@ -118,11 +118,29 @@ include_directories(
   ${EXTERNAL_DIR}/cxxopts/include
 )
 else()
-find_package(Catch2 CONFIG REQUIRED)
+if (NOT DISABLE_VCPKG)
+  find_package(Catch2 CONFIG REQUIRED)
+endif()
 find_package(httplib CONFIG REQUIRED)
 find_package(cxxopts CONFIG REQUIRED)
 find_package(nlohmann_json CONFIG REQUIRED)
-find_path(SIMPLEINI_INCLUDE_DIRS "ConvertUTF.c")
+endif()
+
+if(USE_SYSTEM_PKGS)
+# Fedora's Catch2 is too old
+# nlohmann_json packaging is broken
+# simpleini system package does not ship ConvertUTF.{c,h}
+add_subdirectory(${EXTERNAL_DIR}/Catch2)
+include_directories(
+  ${EXTERNAL_DIR}/simpleini
+  ${INCLUDE_INSTALL_DIR}/nlohmann
+)
+
+get_cmake_property(_variableNames VARIABLES)
+list (SORT _variableNames)
+foreach (_variableName ${_variableNames})
+    message(STATUS "${_variableName}=${${_variableName}}")
+endforeach()
 endif()
 
 # Optional packages
@@ -353,7 +371,6 @@ macro(DECORATE_FUZZER TARGET_NAME)
 endmacro()
 
 include_directories(
-  ${EXTERNAL_DIR}/easyloggingpp/src
   ${EXTERNAL_DIR}/PlatformFolders
   ${EXTERNAL_DIR}/ThreadPool
   ${EXTERNAL_DIR}/sole
@@ -381,8 +398,8 @@ endif()
 add_library(
   et-lib STATIC
 
-  ${EXTERNAL_DIR}/easyloggingpp/src/easylogging++.h
-  ${EXTERNAL_DIR}/easyloggingpp/src/easylogging++.cc
+  ${INCLUDE_INSTALL_DIR}/easylogging++.h
+  ${INCLUDE_INSTALL_DIR}/easylogging++.cc
   ${EXTERNAL_DIR}/PlatformFolders/sago/platform_folders.cpp
 
   src/base/BackedReader.hpp