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")
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)