From a60fb27b6716525e82b5971b75279cbe23d80267 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 27 Sep 2022 20:15:28 -0400 Subject: [PATCH] Ensure consistent spdlog dependency target no matter the source (#1101) This removes the difference in targets generated for rmm depending on if spdlog is found on the machine, compared to being built as part of rmm. Now in all cases rmm targets depend on `spdlog::spdlog_header_only` and never `rmm::spdlog_header_only`. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/rmm/pull/1101 --- cmake/thirdparty/get_spdlog.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmake/thirdparty/get_spdlog.cmake b/cmake/thirdparty/get_spdlog.cmake index e816bff35..f78ae0262 100644 --- a/cmake/thirdparty/get_spdlog.cmake +++ b/cmake/thirdparty/get_spdlog.cmake @@ -17,11 +17,16 @@ function(find_and_configure_spdlog) include(${rapids-cmake-dir}/cpm/spdlog.cmake) rapids_cpm_spdlog(INSTALL_EXPORT_SET rmm-exports) + rapids_export_package(BUILD spdlog rmm-exports) if(spdlog_ADDED) - install(TARGETS spdlog_header_only EXPORT rmm-exports) - else() - rapids_export_package(BUILD spdlog rmm-exports) + rapids_export( + BUILD spdlog + EXPORT_SET spdlog + GLOBAL_TARGETS spdlog spdlog_header_only + NAMESPACE spdlog::) + include("${rapids-cmake-dir}/export/find_package_root.cmake") + rapids_export_find_package_root(BUILD spdlog [=[${CMAKE_CURRENT_LIST_DIR}]=] rmm-exports) endif() endfunction()