From 0ed759021670d24a3c7fe7c4e6aa48eeb020f585 Mon Sep 17 00:00:00 2001 From: "Markus Kitsinger (SwooshyCueb)" Date: Fri, 16 Feb 2024 17:12:34 -0500 Subject: [PATCH] [#6256] CMake: use find_package for spdlog --- CMakeLists.txt | 3 +++ lib/core/CMakeLists.txt | 4 ++-- plugins/api/CMakeLists.txt | 1 - plugins/auth/CMakeLists.txt | 1 - plugins/auth_legacy/CMakeLists.txt | 1 - plugins/database/CMakeLists.txt | 1 - plugins/experimental/CMakeLists.txt | 1 - plugins/microservices/CMakeLists.txt | 1 - plugins/network/CMakeLists.txt | 1 - plugins/resources/CMakeLists.txt | 1 - plugins/resources/replication/CMakeLists.txt | 1 - plugins/resources/unixfilesystem/CMakeLists.txt | 2 -- plugins/rule_engines/CMakeLists.txt | 1 - plugins/rule_engines/irods_rule_language/CMakeLists.txt | 1 - server/api/CMakeLists.txt | 1 - server/core/CMakeLists.txt | 1 - server/delay_server/CMakeLists.txt | 1 - server/drivers/CMakeLists.txt | 1 - server/harness/CMakeLists.txt | 1 - server/icat/CMakeLists.txt | 1 - server/main_server/CMakeLists.txt | 1 - server/re/CMakeLists.txt | 1 - 22 files changed, 5 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d211544a29..f1dba4dead 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,6 +202,9 @@ endif() find_package(nlohmann_json "3.6.1" REQUIRED) find_package(fmt "8.1.1" REQUIRED HINTS "${IRODS_EXTERNALS_FULLPATH_FMT}") +find_package(spdlog "1.9.2" REQUIRED + HINTS "${IRODS_EXTERNALS_FULLPATH_SPDLOG}") + if (NOT DEFINED THREADS_PREFER_PTHREAD_FLAG) set(THREADS_PREFER_PTHREAD_FLAG TRUE) diff --git a/lib/core/CMakeLists.txt b/lib/core/CMakeLists.txt index d7e0e37011..52635097e2 100644 --- a/lib/core/CMakeLists.txt +++ b/lib/core/CMakeLists.txt @@ -79,6 +79,7 @@ target_link_libraries( PUBLIC nlohmann_json::nlohmann_json fmt::fmt + spdlog::spdlog_header_only Threads::Threads ) target_include_directories( @@ -95,7 +96,6 @@ target_include_directories( "$" PRIVATE "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_common_core @@ -236,6 +236,7 @@ foreach(variant IN ITEMS client server) PUBLIC nlohmann_json::nlohmann_json fmt::fmt + spdlog::spdlog_header_only OpenSSL::Crypto OpenSSL::SSL ) @@ -256,7 +257,6 @@ foreach(variant IN ITEMS client server) "$" PRIVATE "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_lib_core_${variant} diff --git a/plugins/api/CMakeLists.txt b/plugins/api/CMakeLists.txt index efb3c7aa81..f8c22d8d0c 100644 --- a/plugins/api/CMakeLists.txt +++ b/plugins/api/CMakeLists.txt @@ -71,7 +71,6 @@ foreach(plugin IN LISTS IRODS_API_PLUGINS) "${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" "${IRODS_EXTERNALS_FULLPATH_NANODBC}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/auth/CMakeLists.txt b/plugins/auth/CMakeLists.txt index 8063a19693..946efdc899 100644 --- a/plugins/auth/CMakeLists.txt +++ b/plugins/auth/CMakeLists.txt @@ -43,7 +43,6 @@ foreach(plugin IN LISTS IRODS_AUTH_PLUGINS) "$" "$" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/auth_legacy/CMakeLists.txt b/plugins/auth_legacy/CMakeLists.txt index 9b7cb5dec6..202aa67138 100644 --- a/plugins/auth_legacy/CMakeLists.txt +++ b/plugins/auth_legacy/CMakeLists.txt @@ -44,7 +44,6 @@ foreach(plugin IN LISTS IRODS_AUTH_LEGACY_PLUGINS) "$" "$" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/database/CMakeLists.txt b/plugins/database/CMakeLists.txt index 735d90f6e0..dcc1b1318e 100644 --- a/plugins/database/CMakeLists.txt +++ b/plugins/database/CMakeLists.txt @@ -79,7 +79,6 @@ foreach(plugin IN LISTS IRODS_DATABASE_PLUGINS) "$" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" "${IRODS_EXTERNALS_FULLPATH_NANODBC}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/experimental/CMakeLists.txt b/plugins/experimental/CMakeLists.txt index d3ad7d61d1..b022db562d 100644 --- a/plugins/experimental/CMakeLists.txt +++ b/plugins/experimental/CMakeLists.txt @@ -40,7 +40,6 @@ foreach(plugin IN LISTS IRODS_EXPERIMENTAL_API_PLUGINS) "$" "${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/microservices/CMakeLists.txt b/plugins/microservices/CMakeLists.txt index 3fe00cd8fa..6c8ccc12b5 100644 --- a/plugins/microservices/CMakeLists.txt +++ b/plugins/microservices/CMakeLists.txt @@ -64,7 +64,6 @@ foreach(plugin IN LISTS IRODS_MICROSERVICE_PLUGINS) ${plugin_target} PRIVATE "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt index a84e9aa55c..576969331a 100644 --- a/plugins/network/CMakeLists.txt +++ b/plugins/network/CMakeLists.txt @@ -39,7 +39,6 @@ foreach(plugin IN LISTS IRODS_NETWORK_PLUGINS) ${plugin_target} PRIVATE "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/resources/CMakeLists.txt b/plugins/resources/CMakeLists.txt index 09b36454e4..cb70946ddb 100644 --- a/plugins/resources/CMakeLists.txt +++ b/plugins/resources/CMakeLists.txt @@ -53,7 +53,6 @@ foreach(plugin IN LISTS IRODS_RESOURCE_PLUGINS) PRIVATE "${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/resources/replication/CMakeLists.txt b/plugins/resources/replication/CMakeLists.txt index dac2fa19ee..dba6bf8000 100644 --- a/plugins/resources/replication/CMakeLists.txt +++ b/plugins/resources/replication/CMakeLists.txt @@ -29,7 +29,6 @@ target_include_directories( "$" "${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_resource_plugin-replication diff --git a/plugins/resources/unixfilesystem/CMakeLists.txt b/plugins/resources/unixfilesystem/CMakeLists.txt index 0f189654b0..3c89afea19 100644 --- a/plugins/resources/unixfilesystem/CMakeLists.txt +++ b/plugins/resources/unixfilesystem/CMakeLists.txt @@ -17,7 +17,6 @@ target_include_directories( irods_resource_plugin_obj-unixfilesystem PUBLIC "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" "$" ) target_compile_definitions( @@ -55,7 +54,6 @@ target_include_directories( "$" "${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_resource_plugin-unixfilesystem diff --git a/plugins/rule_engines/CMakeLists.txt b/plugins/rule_engines/CMakeLists.txt index 5455eb7683..d40667d682 100644 --- a/plugins/rule_engines/CMakeLists.txt +++ b/plugins/rule_engines/CMakeLists.txt @@ -45,7 +45,6 @@ foreach(plugin IN LISTS IRODS_RULE_ENGINE_PLUGINS) #"$" "$" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( ${plugin_target} diff --git a/plugins/rule_engines/irods_rule_language/CMakeLists.txt b/plugins/rule_engines/irods_rule_language/CMakeLists.txt index 3894b73a09..c48f42cd72 100644 --- a/plugins/rule_engines/irods_rule_language/CMakeLists.txt +++ b/plugins/rule_engines/irods_rule_language/CMakeLists.txt @@ -44,7 +44,6 @@ target_include_directories( #"$" "$" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_rule_engine_plugin-irods_rule_language diff --git a/server/api/CMakeLists.txt b/server/api/CMakeLists.txt index 6f4014cde1..8725a86315 100644 --- a/server/api/CMakeLists.txt +++ b/server/api/CMakeLists.txt @@ -188,7 +188,6 @@ target_include_directories( "${IRODS_EXTERNALS_FULLPATH_CPPZMQ}/include" "${IRODS_EXTERNALS_FULLPATH_NANODBC}/include" "${IRODS_EXTERNALS_FULLPATH_ZMQ}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_server_api diff --git a/server/core/CMakeLists.txt b/server/core/CMakeLists.txt index 9d6679a8bc..f033520c86 100644 --- a/server/core/CMakeLists.txt +++ b/server/core/CMakeLists.txt @@ -99,7 +99,6 @@ target_include_directories( "${IRODS_EXTERNALS_FULLPATH_CPPZMQ}/include" "${IRODS_EXTERNALS_FULLPATH_NANODBC}/include" "${IRODS_EXTERNALS_FULLPATH_ZMQ}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_server_core diff --git a/server/delay_server/CMakeLists.txt b/server/delay_server/CMakeLists.txt index e44d3be393..3fea52aca5 100644 --- a/server/delay_server/CMakeLists.txt +++ b/server/delay_server/CMakeLists.txt @@ -25,7 +25,6 @@ target_include_directories( PRIVATE "$" "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irodsDelayServer diff --git a/server/drivers/CMakeLists.txt b/server/drivers/CMakeLists.txt index bb3ba8398b..8c4a34e06f 100644 --- a/server/drivers/CMakeLists.txt +++ b/server/drivers/CMakeLists.txt @@ -41,7 +41,6 @@ target_include_directories( "${IRODS_EXTERNALS_FULLPATH_CPPZMQ}/include" "${IRODS_EXTERNALS_FULLPATH_NANODBC}/include" "${IRODS_EXTERNALS_FULLPATH_ZMQ}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_server_drivers diff --git a/server/harness/CMakeLists.txt b/server/harness/CMakeLists.txt index 88dd27fada..cd7fec6366 100644 --- a/server/harness/CMakeLists.txt +++ b/server/harness/CMakeLists.txt @@ -24,7 +24,6 @@ foreach(harness IN ITEMS api configuration) irods_${harness}_test_harness PRIVATE "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_${harness}_test_harness diff --git a/server/icat/CMakeLists.txt b/server/icat/CMakeLists.txt index 604930f425..9dc872133f 100644 --- a/server/icat/CMakeLists.txt +++ b/server/icat/CMakeLists.txt @@ -41,7 +41,6 @@ target_include_directories( "${IRODS_EXTERNALS_FULLPATH_CPPZMQ}/include" "${IRODS_EXTERNALS_FULLPATH_NANODBC}/include" "${IRODS_EXTERNALS_FULLPATH_ZMQ}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_server_icat diff --git a/server/main_server/CMakeLists.txt b/server/main_server/CMakeLists.txt index 60581cd7b7..51e0b6bb10 100644 --- a/server/main_server/CMakeLists.txt +++ b/server/main_server/CMakeLists.txt @@ -34,7 +34,6 @@ target_include_directories( "${IRODS_EXTERNALS_FULLPATH_BOOST}/include" "${IRODS_EXTERNALS_FULLPATH_CPPZMQ}/include" "${IRODS_EXTERNALS_FULLPATH_ZMQ}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irodsServer diff --git a/server/re/CMakeLists.txt b/server/re/CMakeLists.txt index 603c932cc5..effffb8f3b 100644 --- a/server/re/CMakeLists.txt +++ b/server/re/CMakeLists.txt @@ -67,7 +67,6 @@ target_include_directories( "${IRODS_EXTERNALS_FULLPATH_CPPZMQ}/include" "${IRODS_EXTERNALS_FULLPATH_NANODBC}/include" "${IRODS_EXTERNALS_FULLPATH_ZMQ}/include" - "${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include" ) target_compile_definitions( irods_server_re