From: abn Date: Mon, 2 May 2016 14:14:11 +0000 (+0200) Subject: All users free to choose whether to use XDR or not. X-Git-Tag: V8_1_0a1~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ab6932cf4f93b666593e23efd9908d479ae0981f;p=tools%2Fmedcoupling.git All users free to choose whether to use XDR or not. Default value is OFF when WIN32, ON otherwise. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e96cd926b..a21d11062 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,9 +59,11 @@ OPTION(MEDCOUPLING_BUILD_STATIC "Build MEDCoupling library in static mode." OFF) CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_METIS "Enable metis graph library in MEDPartitioner." ON "MEDCOUPLING_ENABLE_PARTITIONER" OFF) CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_SCOTCH "Enable scotch graph library in MEDPartitioner." ON "MEDCOUPLING_ENABLE_PARTITIONER;NOT MEDCOUPLING_USE_MPI" OFF) CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_PARMETIS "Enable parmetis graph library in MEDPartitioner." ON "MEDCOUPLING_ENABLE_PARTITIONER;MEDCOUPLING_USE_MPI" OFF) +SET(XDR_DEFAULT_OPTION ON) IF(WIN32) - CMAKE_DEPENDENT_OPTION(MEDCOUPLING_MEDLOADER_USE_XDR "Enable use of XDR for SauvReader." ON "NOT MEDCOUPLING_MICROMED" OFF) -ENDIF(WIN32) + SET(XDR_DEFAULT_OPTION OFF) +ENDIF() +CMAKE_DEPENDENT_OPTION(MEDCOUPLING_MEDLOADER_USE_XDR "Enable use of XDR for SauvReader." ${XDR_DEFAULT_OPTION} "NOT MEDCOUPLING_MICROMED" OFF) IF(MEDCOUPLING_BUILD_STATIC) SET(BUILD_SHARED_LIBS 0) @@ -78,13 +80,9 @@ IF(NOT MEDCOUPLING_MICROMED) FIND_PACKAGE(SalomeHDF5 REQUIRED) FIND_PACKAGE(SalomeMEDFile REQUIRED) # XDR stuff - IF(NOT WIN32) - FIND_PACKAGE(SalomeXDR REQUIRED) - ELSE(NOT WIN32) - IF(MEDCOUPLING_MEDLOADER_USE_XDR) + IF(MEDCOUPLING_MEDLOADER_USE_XDR) FIND_PACKAGE(SalomeXDR REQUIRED) - ENDIF(MEDCOUPLING_MEDLOADER_USE_XDR) - ENDIF(NOT WIN32) + ENDIF(MEDCOUPLING_MEDLOADER_USE_XDR) # End of XDR Stuff IF(MEDCOUPLING_ENABLE_PARTITIONER) FIND_PACKAGE(SalomeLibXml2) diff --git a/cmake_files/FindXDR.cmake b/cmake_files/FindXDR.cmake index dc93cac11..e8e862531 100644 --- a/cmake_files/FindXDR.cmake +++ b/cmake_files/FindXDR.cmake @@ -20,7 +20,9 @@ MESSAGE(STATUS "Check for XDR ...") FIND_PATH(XDR_INCLUDE_DIRS rpc/xdr.h) -SET(XDR_DEFINITIONS "-DHAS_XDR") +IF(XDR_INCLUDE_DIRS) + SET(XDR_DEFINITIONS "-DHAS_XDR") +ENDIF() IF(WIN32) FIND_LIBRARY(XDR_LIBRARIES xdr) # To get the .lib file from XDR