]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
Integration of [CEA 13233] support new xdr.h location
authorvsr <vsr@opencascade.com>
Thu, 21 Mar 2019 06:07:08 +0000 (09:07 +0300)
committervsr <vsr@opencascade.com>
Thu, 21 Mar 2019 06:07:08 +0000 (09:07 +0300)
- Attempt 3: there can be a separate xdr library on some platforms

cmake/FindXDR.cmake

index d61ab2f0235fcaf83c321c2b75225c0a531d70b4..2a0ba1e9c03ea1475ba1d8c2077627f4f891aba6 100644 (file)
@@ -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)