Add cmake option FREECAD_USE_EXTERNAL_FMT to turn on/off system fmt use

defaults to ON
This commit is contained in:
Adrian Insaurralde Avalos
2023-06-28 21:52:43 -04:00
committed by Adrián Insaurralde Avalos
parent 5718efbdeb
commit b7814c46ad
2 changed files with 4 additions and 1 deletions

View File

@@ -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)

View File

@@ -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}")