]> granicus.if.org Git - graphviz/commitdiff
add the fmt library as a test dependency
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 19 Jul 2022 19:13:12 +0000 (21:13 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 25 Jul 2022 18:24:05 +0000 (20:24 +0200)
cmake/FindFMT.cmake [new file with mode: 0644]
tests/CMakeLists.txt

diff --git a/cmake/FindFMT.cmake b/cmake/FindFMT.cmake
new file mode 100644 (file)
index 0000000..62f82e0
--- /dev/null
@@ -0,0 +1,11 @@
+find_path(FMT_INCLUDE_DIR fmt/core.h)
+
+find_library(FMT_LIBRARY NAMES fmt)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FMT DEFAULT_MSG FMT_LIBRARY FMT_INCLUDE_DIR)
+
+mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY)
+
+set(FMT_INCLUDE_DIRS ${FMT_INCLUDE_DIR})
+set(FMT_LIBRARIES ${FMT_LIBRARY})
index 71277453e0d15a214e7a1824cb6b8afd966ba986..7ba4b6e04a2fdfebab332cf5ebd15a9b6c07cec9 100644 (file)
@@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 3.12 FATAL_ERROR)
 
 find_package(Boost REQUIRED)
 find_package(Catch2 REQUIRED)
+find_package(FMT REQUIRED)
 find_package(RAPIDXML REQUIRED)
 find_package(SVGPP REQUIRED)
 
@@ -27,6 +28,7 @@ target_include_directories(test_common PRIVATE
 )
 target_include_directories(test_common SYSTEM PRIVATE
   ${Boost_INCLUDE_DIRS}
+  ${FMT_INCLUDE_DIRS}
   ${RAPIDXML_INCLUDE_DIRS}
   ${SVGPP_INCLUDE_DIRS}
 )
@@ -40,6 +42,7 @@ target_link_libraries(test_common PUBLIC
   cgraph++
   gvc
   gvc++
+  ${FMT_LIBRARIES}
 )
 
 # common steps for creating a test case