Commit db567c2 1 parent 2687b4f commit db567c2 Copy full SHA for db567c2
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 @@ -151,6 +151,13 @@ define_option(vt_build_tests "tests" "Build VT tests" ON empty_feature)
151
151
define_option(vt_build_tools "tools" "Build VT tools" ON empty_feature)
152
152
define_option(vt_build_examples "examples" "Build VT examples" ON empty_feature)
153
153
154
+ option (vt_external_fmt "Build VT with external fmt" OFF )
155
+ if (${vt_external_fmt} )
156
+ message (STATUS "Building vt with external fmt library" )
157
+ else ()
158
+ message (STATUS "Building vt with included fmt library" )
159
+ endif ()
160
+
154
161
list (POP_BACK CMAKE_MESSAGE_INDENT)
155
162
156
163
##########################################################################################################
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