From 77eea5dc26e32147c1a25e575e6e5e7020562b0c Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Mon, 26 Aug 2024 12:59:41 -0400 Subject: [PATCH] #102: update build options in build.sh to support external fmt --- CMakeLists.txt | 3 +-- build.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5a0f6f7f7..ef8a579a20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,14 +33,13 @@ option(VT_TV_PYTHON_BINDINGS_ENABLED "Build vt-tv with Python bindings" OFF) option(VT_TV_OPENMP_ENABLED "Build vt-tv with openMP support" ON) option(VT_TV_TESTS_ENABLED "Build vt-tv with unit tests" ON) option(VT_TV_COVERAGE_ENABLED "Build vt-tv with coverage" OFF) -option(VT_TV_EXTERNAL_FMT "Build vt-tv with an external fmt library" ON) +option(VT_TV_EXTERNAL_FMT "Build vt-tv with an external fmt library" OFF) if(VT_TV_EXTERNAL_FMT) set(FMT_INCLUDE_NAME fmt) else() set(FMT_INCLUDE_NAME fmt-vt-tv) endif() - add_definitions(-DINCLUDE_FMT_CORE=<${FMT_INCLUDE_NAME}/core.h>) add_definitions(-DINCLUDE_FMT_FORMAT=<${FMT_INCLUDE_NAME}/format.h>) add_definitions(-DINCLUDE_FMT_OSTREAM=<${FMT_INCLUDE_NAME}/ostream.h>) diff --git a/build.sh b/build.sh index a645bd3d4f..de95945ad8 100755 --- a/build.sh +++ b/build.sh @@ -24,6 +24,8 @@ function on_off() { # > Build variables # >> Path VTK_DIR="${VTK_DIR:-$PARENT_DIR/vtk/build}" +fmt_DIR="${fmt_DIR:-''}" +fmt_ROOT="${fmt_ROOT:-''}" CC="${CC:-$(which gcc || echo '')}" CXX="${CXX:-$(which g++ || echo '')}" GCOV="${GCOV:-gcov}" @@ -40,6 +42,7 @@ VT_TV_COVERAGE_ENABLED=$(on_off ${VT_TV_COVERAGE_ENABLED:-OFF}) VT_TV_CLEAN=$(on_off ${VT_TV_CLEAN:-ON}) VT_TV_PYTHON_BINDINGS_ENABLED=$(on_off ${VT_TV_PYTHON_BINDINGS_ENABLED:-OFF}) VT_TV_WERROR_ENABLED=$(on_off ${VT_TV_WERROR_ENABLED:-OFF}) +VT_TV_EXTERNAL_FMT=$(on_off ${VT_TV_EXTERNAL_FMT:-OFF}) # >> Run tests settings VT_TV_RUN_TESTS=$(on_off ${VT_TV_RUN_TESTS:-OFF}) VT_TV_RUN_TESTS_FILTER=${VT_TV_RUN_TESTS_FILTER:-""} @@ -149,6 +152,7 @@ echo CC=$CC echo CXX=$CXX echo GCOV=$GCOV echo VTK_DIR=$VTK_DIR +echo VT_TV_EXTERNAL_FMT=$VT_TV_EXTERNAL_FMT # Build if [[ "${VT_TV_BUILD}" == "ON" ]]; then @@ -181,6 +185,10 @@ if [[ "${VT_TV_BUILD}" == "ON" ]]; then -DPython_EXECUTABLE="$(which python)" \ -DPython_INCLUDE_DIRS=$(python -c "import sysconfig; print(sysconfig.get_path('include'))") \ \ + -DVT_TV_EXTERNAL_FMT=${VT_TV_EXTERNAL_FMT} \ + -Dfmt_DIR=${fmt_DIR} \ + -Dfmt_ROOT=${fmt_ROOT} \ + \ "${VT_TV_DIR}" time cmake --build . --parallel -j "${VT_TV_CMAKE_JOBS}"