@@ -14,7 +14,7 @@
# -DENABLE_RESOLVE_NEIGH=0 (default enabled)
# Do not link to libnl and do not resolve neighbours internally for Ethernet.
-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
project(RDMA C)
set(PACKAGE_NAME "RDMA")
@@ -3,7 +3,7 @@
# Execute a header fixup based on NOT_NEEDED for HEADER
# The buildlib includes alternate header file shims for several scenarios, if
-# the build system detects a feature is present then it should call OrcDoFixup
+# the build system detects a feature is present then it should call RDMA_DoFixup
# with the test as true. If false then the shim header will be installed.
# Typically the shim header will replace a missing header with stubs, or it
@@ -11,7 +11,11 @@
function(RDMA_DoFixup not_needed header)
set(DEST "${BUILD_INCLUDE}/${header}")
if (NOT "${not_needed}")
- get_filename_component(DIR ${DEST} DIRECTORY)
+ if(CMAKE_VERSION VERSION_LESS "2.8.12")
+ get_filename_component(DIR ${DEST} PATH)
+ else()
+ get_filename_component(DIR ${DEST} DIRECTORY)
+ endif()
file(MAKE_DIRECTORY "${DIR}")
string(REPLACE / - header-bl ${header})
execute_process(COMMAND "ln" "-Tsf" "${BUILDLIB}/fixup-include/${header-bl}" "${DEST}")
@@ -68,8 +68,8 @@ function(rdma_provider DEST)
set(DEST ${DEST}-rdmav2)
add_library(${DEST} MODULE ${ARGN})
rdma_set_library_map(${DEST} ${BUILDLIB}/provider.map)
- target_link_libraries(${DEST} PRIVATE ibverbs)
- target_link_libraries(${DEST} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
+ target_link_libraries(${DEST} LINK_PRIVATE ibverbs)
+ target_link_libraries(${DEST} LINK_PRIVATE ${CMAKE_THREAD_LIBS_INIT})
set_target_properties(${DEST} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
# Provider Plugins do not use SONAME versioning, there is no reason to
# create the usual symlinks.
@@ -222,6 +222,7 @@ function(rdma_finalize_libs)
list(GET RDMA_STATIC_LIBS ${I} STATIC)
# PUBLIC libraries
+ set(LIBS "")
get_property(TMP TARGET ${SHARED} PROPERTY INTERFACE_LINK_LIBRARIES SET)
if (TMP)
get_target_property(TMP ${SHARED} INTERFACE_LINK_LIBRARIES)
@@ -6,4 +6,4 @@ publish_headers(infiniband
rdma_library(ibcm libibcm.map 1 1.0.0
cm.c
)
-target_link_libraries(ibcm PUBLIC ibverbs)
+target_link_libraries(ibcm LINK_PUBLIC ibverbs)
@@ -27,7 +27,7 @@ rdma_library(ibverbs libibverbs.map 1 1.0.0
sysfs.c
verbs.c
)
-target_link_libraries(ibverbs PRIVATE
+target_link_libraries(ibverbs LINK_PRIVATE
${NL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
@@ -15,8 +15,8 @@ rdma_library(rdmacm librdmacm.map 1 1.0.0
indexer.c
rsocket.c
)
-target_link_libraries(rdmacm PUBLIC ibverbs)
-target_link_libraries(rdmacm PRIVATE ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(rdmacm LINK_PUBLIC ibverbs)
+target_link_libraries(rdmacm LINK_PRIVATE ${CMAKE_THREAD_LIBS_INIT})
# The preload library is a bit special, it needs to be open coded
# Since it is a LD_PRELOAD it has no soname, and is installed in sub dir
@@ -26,7 +26,7 @@ add_library(rspreload SHARED
)
set_target_properties(rspreload PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
rdma_set_library_map(rspreload librspreload.map)
-target_link_libraries(rspreload PRIVATE
+target_link_libraries(rspreload LINK_PRIVATE
rdmacm
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
cmake 2.8.12 is also from 2013, however .12 is broadly compatible with versions up 3.6. However, there were significant changes between .11 and .12, such that .11 doesn't trivially work. For some reason Centos 7 only includes 2.8.11 (Centos 6 includes .12). Even though cmake 3.5.x is available from EPEL, make it easy for everyone and patch in .11 support, this can be reverted someday. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- CMakeLists.txt | 2 +- buildlib/RDMA_DoFixup.cmake | 8 ++++++-- buildlib/rdma_functions.cmake | 5 +++-- libibcm/src/CMakeLists.txt | 2 +- libibverbs/src/CMakeLists.txt | 2 +- librdmacm/src/CMakeLists.txt | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-)