From 1dbd2a9b006b7c798299002dd3e036a76cfbb8e9 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 24 Jul 2024 17:03:46 -0400 Subject: [PATCH] Pass GLOBAL_TARGETS to rapids_cpm_find in rapids_cpm_bs_thread_pool() (#655) Because the GLOBAL_TARGETS option was not being passed, rapids_cpm_bs_thread_pool() was accidentally calling CPMAddPackage() twice for bs_thread_pool, resulting in invalid pinned versions output. Pass GLOBAL_TARGETS to ensure CPMAddPackage() is only called once. --- rapids-cmake/cpm/bs_thread_pool.cmake | 1 + testing/cpm/cpm_bs_thread_pool-simple.cmake | 3 +++ 2 files changed, 4 insertions(+) diff --git a/rapids-cmake/cpm/bs_thread_pool.cmake b/rapids-cmake/cpm/bs_thread_pool.cmake index 1bab9165..eda7f322 100644 --- a/rapids-cmake/cpm/bs_thread_pool.cmake +++ b/rapids-cmake/cpm/bs_thread_pool.cmake @@ -71,6 +71,7 @@ function(rapids_cpm_bs_thread_pool) include("${rapids-cmake-dir}/cpm/find.cmake") rapids_cpm_find(bs_thread_pool ${version} ${ARGN} + GLOBAL_TARGETS rapids_bs_thread_pool CPM_ARGS GIT_REPOSITORY ${repository} GIT_TAG ${tag} diff --git a/testing/cpm/cpm_bs_thread_pool-simple.cmake b/testing/cpm/cpm_bs_thread_pool-simple.cmake index 4d11576b..3af63aa6 100644 --- a/testing/cpm/cpm_bs_thread_pool-simple.cmake +++ b/testing/cpm/cpm_bs_thread_pool-simple.cmake @@ -32,3 +32,6 @@ if(NOT TARGET BS::thread_pool) endif() rapids_cpm_bs_thread_pool() + +include(${rapids-cmake-dir}/cpm/generate_pinned_versions.cmake) +rapids_cpm_generate_pinned_versions(OUTPUT ${CMAKE_BINARY_DIR}/versions.json)