From a49662958e8434bf2bf2bb97aad9d246390d8785 Mon Sep 17 00:00:00 2001 From: Ben Morgan Date: Fri, 10 May 2024 12:26:43 +0100 Subject: [PATCH] Explicitly create namespaced ALIAS targets for RDC libraries If explicit ALIAS targets with the final install namespace (e.g. "NS::Target" for "Target") are not created for an RDC library, the installed targets have the wrong names set for the CUDA_RDC properties. This results in both compile and (unseen) link errors because the bare target names are interpreted as raw libraries, not CMake targets. Dependencies are then not transmitted correctly, resulting in compile/link issues for missing include paths etc. Explicitly create ALIAS targets for CopCore and AdePT RDC libraries to ensure they are installed with the correct install-time target names for their `CUDA_RDC_...` properties. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38d23154..f4baa316 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,7 @@ set(ADEPT_G4_INTEGRATION_SRCS ) cuda_rdc_add_library(CopCore INTERFACE) +cuda_rdc_add_library(CopCore::CopCore ALIAS CopCore) cuda_rdc_target_include_directories(CopCore INTERFACE $ @@ -173,6 +174,7 @@ cuda_rdc_target_include_directories(CopCore ) cuda_rdc_add_library(AdePT_G4_integration SHARED ${ADEPT_G4_INTEGRATION_SRCS}) +cuda_rdc_add_library(AdePT::AdePT_G4_integration ALIAS AdePT_G4_integration) cuda_rdc_target_include_directories(AdePT_G4_integration PUBLIC $