@@ -13,7 +13,7 @@
# Do not link to libnl and do not resolve neighbours internally for Ethernet,
# and do not build iwpmd.
-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
project(RDMA C)
# CMake likes to use -rdynamic too much, they fixed it in 3.4.
@@ -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}")
@@ -98,8 +98,8 @@ function(rdma_provider DEST)
# Even though these are modules we still want to use Wl,--no-undefined
set_target_properties(${DEST} PROPERTIES LINK_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
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.
@@ -259,6 +259,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)
@@ -29,7 +29,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 | 6 +++++- buildlib/rdma_functions.cmake | 5 +++-- libibcm/src/CMakeLists.txt | 2 +- libibverbs/src/CMakeLists.txt | 2 +- librdmacm/src/CMakeLists.txt | 6 +++--- 6 files changed, 14 insertions(+), 9 deletions(-)