Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMAKE: Add targets once in case of multiple find_package() #9696

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions cmake/ucx-targets.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@
get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
set(exec_prefix "@exec_prefix@")

add_library(ucx::ucs SHARED IMPORTED)
if(NOT TARGET ucx::ucs)
add_library(ucx::ucs SHARED IMPORTED)

set_target_properties(ucx::ucs PROPERTIES
IMPORTED_LOCATION "@libdir@/libucs.so"
INTERFACE_INCLUDE_DIRECTORIES "@includedir@"
)
set_target_properties(ucx::ucs PROPERTIES
IMPORTED_LOCATION "@libdir@/libucs.so"
INTERFACE_INCLUDE_DIRECTORIES "@includedir@"
)
endif()

add_library(ucx::ucp SHARED IMPORTED)
if(NOT TARGET ucx::ucp)
add_library(ucx::ucp SHARED IMPORTED)

set_target_properties(ucx::ucp PROPERTIES
IMPORTED_LOCATION "@libdir@/libucp.so"
INTERFACE_INCLUDE_DIRECTORIES "@includedir@"
)
set_target_properties(ucx::ucp PROPERTIES
IMPORTED_LOCATION "@libdir@/libucp.so"
INTERFACE_INCLUDE_DIRECTORIES "@includedir@"
)
endif()

add_library(ucx::uct SHARED IMPORTED)
if(NOT TARGET ucx::uct)
add_library(ucx::uct SHARED IMPORTED)

set_target_properties(ucx::uct PROPERTIES
IMPORTED_LOCATION "@libdir@/libuct.so"
INTERFACE_INCLUDE_DIRECTORIES "@includedir@"
)
set_target_properties(ucx::uct PROPERTIES
IMPORTED_LOCATION "@libdir@/libuct.so"
INTERFACE_INCLUDE_DIRECTORIES "@includedir@"
)
endif()
Loading