summaryrefslogtreecommitdiff
path: root/media-gfx/netgen/files/netgen-6.2.2204-use-system-spdlog.patch
blob: cbd45ca07f3f26f523ec68fe8c49ad042ab88f6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From e20e1e2e2109f1ce6580587f63ad000ac6bdd877 Mon Sep 17 00:00:00 2001
From: Bernd Waibel <waebbl-gentoo@posteo.net>
Date: Tue, 13 Dec 2022 08:14:12 +0100
Subject: [PATCH] use system spdlog

Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -481,8 +481,13 @@ endif(ENABLE_UNIT_TESTS)
 #######################################################################
 
 if(USE_SPDLOG)
-  include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/external_projects/spdlog.cmake)
-  include_directories(${SPDLOG_INCLUDE_DIR})
+  find_package(spdlog REQUIRED CONFIG)
+  if(TARGET spdlog::spdlog)
+    get_target_property(SPDLOG_INCLUDE_DIR spdlog::spdlog INTERFACE_INCLUDE_DIRECTORIES)
+    include_directories(${SPDLOG_INCLUDE_DIR})
+  else()
+    message(SEND_ERROR "You enabled USE_SPDLOG, but the spdlog package could not be found.")
+  endif()
 endif(USE_SPDLOG)
 
 if(ENABLE_CPP_CORE_GUIDELINES_CHECK)
--- a/libsrc/core/CMakeLists.txt
+++ b/libsrc/core/CMakeLists.txt
@@ -50,10 +50,6 @@ endif(TRACE_MEMORY)
 
 if(USE_SPDLOG)
   include_directories(${SPDLOG_INCLUDE_DIR})
-  install(DIRECTORY ${SPDLOG_INCLUDE_DIR}
-    DESTINATION ${NG_INSTALL_DIR_INCLUDE}
-    )
-  add_dependencies(ngcore project_spdlog)
   target_compile_definitions(ngcore PUBLIC NETGEN_USE_SPDLOG)
   if(DEBUG_LOG)
     target_compile_definitions(ngcore PUBLIC NETGEN_LOG_DEBUG)
-- 
2.38.1