From b7814c46ad02e2abd9e86b0467f7dca893702711 Mon Sep 17 00:00:00 2001 From: Adrian Insaurralde Avalos Date: Wed, 28 Jun 2023 21:52:43 -0400 Subject: [PATCH] Add cmake option FREECAD_USE_EXTERNAL_FMT to turn on/off system fmt use defaults to ON --- cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake | 1 + cMake/FreeCAD_Helpers/SetupLibFmt.cmake | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake index ed66121d38..fc4344adbd 100644 --- a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake +++ b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake @@ -8,6 +8,7 @@ macro(InitializeFreeCADBuildOptions) option(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF) option(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF) option(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF) + option(FREECAD_USE_EXTERNAL_FMT "Use system installed fmt library if available instead of fetching the source." ON) option(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON) option(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF) option(BUILD_WITH_CONDA "Set ON if you build FreeCAD with conda" OFF) diff --git a/cMake/FreeCAD_Helpers/SetupLibFmt.cmake b/cMake/FreeCAD_Helpers/SetupLibFmt.cmake index dcf00c77fd..53fce7836b 100644 --- a/cMake/FreeCAD_Helpers/SetupLibFmt.cmake +++ b/cMake/FreeCAD_Helpers/SetupLibFmt.cmake @@ -3,7 +3,9 @@ macro(SetupLibFmt) # This internet check idea is borrowed from: # https://stackoverflow.com/questions/62214621/how-to-check-for-internet-connection-with-cmake-automatically-prevent-fails-if - find_package(fmt QUIET) + if(FREECAD_USE_EXTERNAL_FMT) + find_package(fmt QUIET) + endif() if(fmt_FOUND) message(STATUS "find_package() was used to locate fmt version ${fmt_VERSION}")