From d8bbb06e08c0269ec9ec1a1fd3ddd0825af58359 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 18 Oct 2013 06:36:15 +0000 Subject: [PATCH] XDR detection. The aim is to enable it even on win7. --- CMakeLists.txt | 16 ++++++++++++---- adm_local/cmake_files/CMakeLists.txt | 1 + src/MEDLoader/CMakeLists.txt | 2 +- src/MEDLoader/SauvMedConvertor.cxx | 5 +---- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6e1739d8..9fcd4febe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,10 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -#IF(WIN32) -# INCLUDE(${PROJECT_SOURCE_DIR}/adm_local/cmake_files/FindXDR.cmake) -#ENDIF(WIN32) - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) PROJECT(SalomeMED C CXX) @@ -84,6 +80,9 @@ OPTION(SALOME_BUILD_DOC "Build MED doc." ON) CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_METIS "Enable metis graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF) CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_SCOTCH "Enable scotch graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF) CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_PARMETIS "Enable parmetis graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;SALOME_USE_MPI" OFF) +IF(WIN32) + CMAKE_DEPENDENT_OPTION(SALOME_MED_MEDLOADER_USE_XDR "Enable use of XDR for SauvReader." ON "NOT SALOME_MED_MICROMED" OFF) +ENDIF(WIN32) # # Set list of prerequisites @@ -114,6 +113,15 @@ INCLUDE(SalomeSetupPlatform) IF(NOT SALOME_MED_MICROMED) FIND_PACKAGE(SalomeHDF5 REQUIRED) FIND_PACKAGE(SalomeMEDFile REQUIRED) + # XDR stuff + IF(NOT WIN32) + FIND_PACKAGE(SalomeXDR REQUIRED) + ELSE(NOT WIN32) + IF(SALOME_MED_MEDLOADER_USE_XDR) + FIND_PACKAGE(SalomeXDR REQUIRED) + ENDIF(SALOME_MED_MEDLOADER_USE_XDR) + ENDIF(NOT WIN32) + # End of XDR Stuff IF(SALOME_MED_ENABLE_PARTITIONER) FIND_PACKAGE(SalomeLibXml2) SALOME_LOG_OPTIONAL_PACKAGE(LibXml2 SALOME_MED_ENABLE_PARTITIONER) diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt index dff494ff0..b6efc0649 100644 --- a/adm_local/cmake_files/CMakeLists.txt +++ b/adm_local/cmake_files/CMakeLists.txt @@ -19,6 +19,7 @@ SET(admlocal_cmake_DATA FindXDR.cmake + FindSalomeXDR.cmake FindMetis.cmake FindSalomeMetis.cmake FindParMetis.cmake diff --git a/src/MEDLoader/CMakeLists.txt b/src/MEDLoader/CMakeLists.txt index c633ab39c..d892e0569 100644 --- a/src/MEDLoader/CMakeLists.txt +++ b/src/MEDLoader/CMakeLists.txt @@ -58,7 +58,7 @@ SET(medloader_SOURCES ) ADD_LIBRARY(medloader SHARED ${medloader_SOURCES}) -SET_TARGET_PROPERTIES(medloader PROPERTIES COMPILE_FLAGS "") +SET_TARGET_PROPERTIES(medloader PROPERTIES COMPILE_FLAGS "${XDR_DEFINITIONS}") TARGET_LINK_LIBRARIES(medloader medcoupling ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES}) INSTALL(TARGETS medloader EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) diff --git a/src/MEDLoader/SauvMedConvertor.cxx b/src/MEDLoader/SauvMedConvertor.cxx index 059d2f6d4..1fbd660e6 100644 --- a/src/MEDLoader/SauvMedConvertor.cxx +++ b/src/MEDLoader/SauvMedConvertor.cxx @@ -41,10 +41,7 @@ #ifdef WIN32 #include -#endif - -#ifndef WIN32 -#define HAS_XDR +#else #include #endif -- 2.39.2