From 4814eabb5c060a2dfee60bb07133dffa9bc0689d Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 21 Mar 2019 09:07:08 +0300 Subject: [PATCH] Integration of [CEA 13233] support new xdr.h location - Attempt 3: there can be a separate xdr library on some platforms --- cmake/FindXDR.cmake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmake/FindXDR.cmake b/cmake/FindXDR.cmake index d61ab2f..2a0ba1e 100644 --- a/cmake/FindXDR.cmake +++ b/cmake/FindXDR.cmake @@ -19,6 +19,8 @@ MESSAGE(STATUS "Check for XDR ...") +INCLUDE(FindPackageHandleStandardArgs) + FIND_PATH(XDR_INCLUDE_DIRS rpc/xdr.h PATH_SUFFIXES tirpc) IF(XDR_INCLUDE_DIRS) SET(XDR_DEFINITIONS "-DHAS_XDR") @@ -34,7 +36,15 @@ IF(WIN32) SET(XDR_INCLUDE_DIRS "${XDR_INCLUDE_DIRS2}") # Make the detection fail ENDIF() ENDIF() + FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS XDR_LIBRARIES) +ELSE(WIN32) + FIND_LIBRARY(XDR_LIBRARIES NAMES tirpc xdr) + IF(NOT XDR_LIBRARIES) + MESSAGE(STATUS "Could not find XDR libraries ...") + SET(XDR_LIBRARIES) # reset variable tough, as they are not mandatory on some platforms + ELSE() + MESSAGE(STATUS "Found XDR libraries ${XDR_LIBRARIES} ...") + ENDIF() + FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS) ENDIF(WIN32) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS) -- 2.39.2