Commit 777f130 1 parent a72520e commit 777f130 Copy full SHA for 777f130
File tree 2 files changed +22
-4
lines changed
2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,13 @@ else()
214
214
set (vt_feature_cmake_ci_build "0" )
215
215
endif ()
216
216
217
+ option (vt_external_fmt "Build VT with external fmt" OFF )
218
+ if (${vt_external_fmt} )
219
+ message (STATUS "Building vt with external fmt library" )
220
+ else ()
221
+ message (STATUS "Building vt with included fmt library" )
222
+ endif ()
223
+
217
224
list (POP_BACK CMAKE_MESSAGE_INDENT)
218
225
219
226
message (STATUS "CI_BUILD = ${vt_feature_cmake_ci_build} " )
Original file line number Diff line number Diff line change @@ -20,10 +20,21 @@ endif()
20
20
# CLI11 always included in the build
21
21
add_subdirectory (${PROJECT_LIB_DIR} /CLI)
22
22
23
- # fmt always included in the build
24
- set (FMT_LIBRARY fmt)
25
- add_subdirectory (${PROJECT_LIB_DIR} /fmt)
26
- set_darma_compiler_flags(${FMT_LIBRARY} )
23
+ # use included fmt or external one
24
+ if (${vt_external_fmt} )
25
+ # user should provide 'fmt_DIR' to CMake (unless fmt is installed in system libs)
26
+ if (${fmt_DIR} )
27
+ message (STATUS "vt_external_fmt = ON. Using fmt located at ${fmt_DIR} " )
28
+ else ()
29
+ message (STATUS "vt_external_fmt = ON but ${fmt_DIR} is not provided." )
30
+ endif ()
31
+ find_package (fmt REQUIRED)
32
+ else ()
33
+ set (FMT_LIBRARY fmt)
34
+ add_subdirectory (${PROJECT_LIB_DIR} /fmt)
35
+ set_darma_compiler_flags(${FMT_LIBRARY} )
36
+ endif ()
37
+
27
38
28
39
# EngFormat-Cpp always included in the build
29
40
set (ENG_FORMAT_LIBRARY EngFormat-Cpp)
You can’t perform that action at this time.
0 commit comments