Commit d1ef913c authored by EVPath Upstream's avatar EVPath Upstream Committed by Atkins, Charles Vernon
Browse files

EVPath 2018-03-27 (40b2d4ea)

Code extracted from:

    https://github.com/chuckatkins/EVPath.git

at commit 40b2d4eab5cd211f40454b35e9111167e6ae5aca (fix-libfabric-to-use-pkgconfig).

Upstream Shortlog
-----------------

Chuck Atkins (1):
      40b2d4ea Make FindLIBFABRIC based on pkgconfig
parent d69100e9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -496,7 +496,10 @@ function(traverse_target_interface in_target out_libs out_inc_dirs)
        set(_has_targets TRUE)
        get_target_property(L_libs ${L} INTERFACE_LINK_LIBRARIES)
        get_target_property(L_inc_dirs ${L} INTERFACE_INCLUDE_DIRECTORIES)
        get_target_property(L_type ${L} TYPE)
        if(L_type MATCHES "(STATIC|SHARED)_LIBRARY")
          list(APPEND _libs "$<TARGET_FILE:${L}>")
        endif()
        if(L_libs)
          list(APPEND _libs ${L_libs})
        endif()
+7 −19
Original line number Diff line number Diff line
@@ -20,29 +20,17 @@ if(LIBFABRIC_PREFIX)
  list(INSERT CMAKE_PREFIX_PATH 0 ${LIBFABRIC_PREFIX})
endif()

find_path(LIBFABRIC_INCLUDE_DIR rdma/fabric.h)
find_library(LIBFABRIC_LIBRARY fabric)
mark_as_advanced(LIBFABRIC_INCLUDE_DIR LIBFABRIC_LIBRARY)

if(LIBFABRIC_PREFIX)
  set(CMAKE_PREFIX_PATH ${_CMAKE_PREFIX_PATH})
  unset(_CMAKE_PREFIX_PATH)
include(CMakeFindDependencyMacro)
find_dependency(PkgConfig)
if(PKG_CONFIG_FOUND)
  set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
  pkg_check_modules(LIBFABRIC IMPORTED_TARGET libfabric)
endif()

######################################################
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBFABRIC_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(libfabric  DEFAULT_MSG
    LIBFABRIC_LIBRARY LIBFABRIC_INCLUDE_DIR)

if(LIBFABRIC_FOUND)
  set(LIBFABRIC_LIBRARIES ${LIBFABRIC_LIBRARY})
  set(LIBFABRIC_INCLUDE_DIRS ${LIBFABRIC_INCLUDE_DIR})
  if(NOT TARGET libfabric::libfabric)
    add_library(libfabric::libfabric UNKNOWN IMPORTED)
    add_library(libfabric::libfabric INTERFACE IMPORTED)
    set_target_properties(libfabric::libfabric PROPERTIES
      IMPORTED_LOCATION "${LIBFABRIC_LIBRARY}"
      INTERFACE_INCLUDE_DIRECTORIES "${LIBFABRIC_INCLUDE_DIR}")
      INTERFACE_LINK_LIBRARIES PkgConfig::LIBFABRIC)
  endif()
endif()