Skip to content

Commit

Permalink
Merge pull request #9702 from tvegas1/cmake_targets_v116
Browse files Browse the repository at this point in the history
CMAKE: Add targets once in case of multiple find_package() - v 1.16.x
  • Loading branch information
gleon99 authored Feb 21, 2024
2 parents 9f77720 + 13b5524 commit 71f1466
Showing 1 changed file with 21 additions and 15 deletions.
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()

0 comments on commit 71f1466

Please sign in to comment.