]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
CMake: improved XDR detection -> simplify logic and get rid of XDR_ROOT_DIR
authorbruneton <bruneton>
Fri, 17 Jan 2014 10:12:38 +0000 (10:12 +0000)
committerbruneton <bruneton>
Fri, 17 Jan 2014 10:12:38 +0000 (10:12 +0000)
which should not appear in FindXDR.cmake

adm_local/cmake_files/FindXDR.cmake

index 8b39fda0fc88c55625efd651101f15409a161a79..7942f585ffdeb6c6ee48864f121856b7c45f07d6 100644 (file)
 #
 
 MESSAGE(STATUS "Check for XDR ...")
-SET(XDR_ROOT_DIR $ENV{XDR_ROOT_DIR} CACHE PATH "Path to the XDR.")
-IF(XDR_ROOT_DIR)
-  LIST(APPEND CMAKE_LIBRARY_PATH "${XDR_ROOT_DIR}/lib")
-  LIST(APPEND CMAKE_INCLUDE_PATH "${XDR_ROOT_DIR}/include")
-ENDIF(XDR_ROOT_DIR)
 
-FIND_LIBRARY(XDR_LIBRARIES xdr)
 FIND_PATH(XDR_INCLUDE_DIRS rpc/xdr.h)
 SET(XDR_DEFINITIONS "-DHAS_XDR")
 
 IF(WIN32)
-  LIST(APPEND XDR_INCLUDE_DIRS "${XDR_ROOT_DIR}/include/src/msvc")
+  FIND_LIBRARY(XDR_LIBRARIES xdr)                 # To get the .lib file from XDR
+  FIND_PATH(XDR_INCLUDE_DIRS2 src/msvc/stdint.h)  # To get the stdint.h from XDR (needed by types.h)
+  IF(XDR_INCLUDE_DIRS)
+    IF(XDR_INCLUDE_DIRS2)
+      LIST(APPEND XDR_INCLUDE_DIRS "${XDR_INCLUDE_DIRS2}")
+    ELSE()
+      SET(XDR_INCLUDE_DIRS "${XDR_INCLUDE_DIRS2}")  # Make the detection fail
+    ENDIF()
+  ENDIF()
 ENDIF(WIN32)
 
 INCLUDE(FindPackageHandleStandardArgs)