Skip to content

Commit

Permalink
#102: update build options in build.sh to support external fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Sep 4, 2024
1 parent 59e2359 commit 697c675
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
Expand Down
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -41,6 +43,7 @@ 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_XVFB_ENABLED=$(on_off ${VT_TV_XVFB_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:-""}
Expand Down Expand Up @@ -154,6 +157,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
Expand Down Expand Up @@ -186,6 +190,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}"
Expand Down

0 comments on commit 697c675

Please sign in to comment.