Skip to content

Commit

Permalink
Make sure this works when UCX of the right version is found
Browse files Browse the repository at this point in the history
  • Loading branch information
eisenhauer committed Jan 14, 2023
1 parent 9e79052 commit 39fccd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ if(ADIOS2_USE_SST AND NOT WIN32)
endif()
if(UCX_FOUND)
set(ADIOS2_SST_HAVE_UCX TRUE)
set(ADIOS2_HAVE_UCX TRUE)
endif()
endif()

Expand Down
5 changes: 2 additions & 3 deletions cmake/FindUCX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ if(NOT (PC_UCX_FOUND STREQUAL "IGNORE"))
set(UCX_INCLUDE_DIRS ${PC_UCX${_PC_TYPE}_INCLUDE_DIRS})
set(UCX_LIBRARIES ${PC_UCX${_PC_TYPE}_LINK_LIBRARIES})
set(UCX_LIBRARY_DIRS ${PC_UCX${_PC_TYPE}_LIBRARY_DIRS})
set(UCX_FOUND ${PC_UCX_FOUND})
endif()
endif()
endif()

if(NOT ${PC_UCX_VERSION})
set(_UCX_VER_FILE "${ucp_INCLUDE_DIR}/ucp/api/ucp_version.h")
set(_UCX_VER_FILE "${UCX_INCLUDE_DIRS}/ucp/api/ucp_version.h")
if(EXISTS "${_UCX_VER_FILE}")
file(READ "${_UCX_VER_FILE}" _ver)
string(REGEX MATCH "#define UCP_API_MAJOR *([0-9]*)" _ ${_ver})
Expand All @@ -79,14 +80,12 @@ find_package_handle_standard_args(UCX
REQUIRED_VARS UCX_LIBRARIES)

if(UCX_FOUND)
message("Found UCX: ")
if(NOT TARGET ucx::ucx)
add_library(ucx::ucx INTERFACE IMPORTED)
if(UCX_INCLUDE_DIRS)
set_target_properties(ucx::ucx PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${UCX_INCLUDE_DIRS}"
)
message("'${UCX_INCLUDE_DIRS}'")
endif()
if(UCX_LIBRARIES)
set_target_properties(ucx::ucx PROPERTIES
Expand Down

0 comments on commit 39fccd2

Please sign in to comment.