From: Magnus Jacobsson Date: Tue, 19 Jul 2022 19:13:12 +0000 (+0200) Subject: add the fmt library as a test dependency X-Git-Tag: 5.0.1~31^2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f23dcc9f9195746c90d3cf957192351578f2f8e6;p=graphviz add the fmt library as a test dependency --- diff --git a/cmake/FindFMT.cmake b/cmake/FindFMT.cmake new file mode 100644 index 000000000..62f82e011 --- /dev/null +++ b/cmake/FindFMT.cmake @@ -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}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 71277453e..7ba4b6e04 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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