From 81a1755b449ad5a01c58673f6c132bebdafb963e Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 8 Jul 2013 13:53:06 +0000 Subject: [PATCH] MEDFile detection --- salome_adm/cmake_files/FindMEDFILE.cmake | 103 ------------------ salome_adm/cmake_files/FindMEDFile.cmake | 42 +++++++ ...eMedfile.cmake => FindSalomeMEDFile.cmake} | 4 +- 3 files changed, 44 insertions(+), 105 deletions(-) delete mode 100644 salome_adm/cmake_files/FindMEDFILE.cmake create mode 100644 salome_adm/cmake_files/FindMEDFile.cmake rename salome_adm/cmake_files/{FindSalomeMedfile.cmake => FindSalomeMEDFile.cmake} (92%) diff --git a/salome_adm/cmake_files/FindMEDFILE.cmake b/salome_adm/cmake_files/FindMEDFILE.cmake deleted file mode 100644 index 74e5adcbe..000000000 --- a/salome_adm/cmake_files/FindMEDFILE.cmake +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# ------ - -MESSAGE(STATUS "Check for medfile ...") - -# ------ - -SET(MED_ENABLE_MED3 ON) - -# ------ - -SET(MED3HOME $ENV{MED3HOME}) -IF(NOT MED3HOME) - FIND_PROGRAM(MDUMP mdump) - IF(MDUMP) - MESSAGE(STATUS "mdump found: ${MDUMP}") - SET(MED3HOME ${MDUMP}) - GET_FILENAME_COMPONENT(MED3HOME ${MED3HOME} PATH) - GET_FILENAME_COMPONENT(MED3HOME ${MED3HOME} PATH) - ELSE(MDUMP) - MESSAGE(STATUS "mdump not found, try to use MED3HOME environment variable or check your PATH") - SET(MED_ENABLE_MED3 OFF) - ENDIF(MDUMP) -ENDIF(NOT MED3HOME) - -IF(MED_ENABLE_MED3) - MESSAGE(STATUS "Searching medfile in ${MED3HOME}") -ENDIF(MED_ENABLE_MED3) - -IF(MED_ENABLE_MED3) - FIND_PATH(MED3_INCLUDE_DIR med.h ${MED3HOME}/include) - IF(MED3_INCLUDE_DIR) - SET(MED3_INCLUDES ${HDF5_INCLUDES} -I${MED3_INCLUDE_DIR} -D${MACHINE})#to be removed - SET(MED3_DEFINITIONS "-D${MACHINE}") - IF(${MED3HOME} STREQUAL /usr) - SET(MED3_INCLUDE_DIRS) - ELSE(${MED3HOME} STREQUAL /usr) - SET(MED3_INCLUDE_DIRS ${MED3_INCLUDE_DIR}) - ENDIF(${MED3HOME} STREQUAL /usr) - MESSAGE(STATUS "med.h found in ${MED3_INCLUDE_DIR}") - ELSE(MED3_INCLUDE_DIR) - MESSAGE(STATUS "med.h not found in ${MED3HOME}/include, check your installation.") - SET(MED_ENABLE_MED3 OFF) - ENDIF(MED3_INCLUDE_DIR) -ENDIF(MED_ENABLE_MED3) - -SET(MED3_LIBS_C_ONLY) -FOREACH(name medC) - IF(MED_ENABLE_MED3) - FIND_LIBRARY(${name}_LIB ${name} ${MED3HOME}/lib) - IF(${name}_LIB) - MESSAGE(STATUS "${name} lib found: ${${name}_LIB}") - SET(MED3_LIBS_C_ONLY ${MED3_LIBS} ${${name}_LIB}) - ELSE(${name}_LIB) - MESSAGE(STATUS "${name} lib not found in ${MED3HOME}/lib, check your installation.") - SET(MED_ENABLE_MED3 OFF) - ENDIF(${name}_LIB) - ENDIF(MED_ENABLE_MED3) -ENDFOREACH(name medC) - -SET(MED3_HAS_FORTRAN_BINDINGS 0) -IF(MED_ENABLE_MED3) - FIND_LIBRARY(med_LIB med ${MED3HOME}/lib) - IF(med_LIB) - MESSAGE(STATUS "med lib found: ${med_LIB}") - SET(MED3_LIBS ${MED3_LIBS_C_ONLY} ${med_LIB}) - SET(MED3_HAS_FORTRAN_BINDINGS 1) - ELSE(med_LIB) - MESSAGE(STATUS "med lib not found in ${MED3HOME}/lib") - ENDIF(med_LIB) - - FIND_LIBRARY(medimport_LIB medimport ${MED3HOME}/lib) - IF(medimport_LIB) - MESSAGE(STATUS "medimport lib found: ${medimport_LIB}") - SET(MED3_LIBS ${MED3_LIBS} ${medimport_LIB}) - ELSE(medimport_LIB) - MESSAGE(STATUS "medimport lib not found in ${MED3HOME}/lib") - SET(MED3_HAS_FORTRAN_BINDINGS 0) - ENDIF(medimport_LIB) -ENDIF(MED_ENABLE_MED3) - -IF(MED_ENABLE_MED3) -ELSE(MED_ENABLE_MED3) - MESSAGE(STATUS "medfile not found ... optional ... disabled") -ENDIF(MED_ENABLE_MED3) diff --git a/salome_adm/cmake_files/FindMEDFile.cmake b/salome_adm/cmake_files/FindMEDFile.cmake new file mode 100644 index 000000000..5ee40e16f --- /dev/null +++ b/salome_adm/cmake_files/FindMEDFile.cmake @@ -0,0 +1,42 @@ +# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# ------ + +MESSAGE(STATUS "Check for medfile ...") + +# ------ + +SET(MEDFILE_ROOT_DIR $ENV{MEDFILE_ROOT_DIR} CACHE PATH "Path to the MEDFile.") +IF(MEDFILE_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${CPPUNIT_ROOT_DIR}") +ENDIF(MEDFILE_ROOT_DIR) + +FIND_PATH(MEDFILE_INCLUDE_DIRS med.h) +#FIND_PROGRAM(MDUMP mdump) +FIND_LIBRARY(MEDFILE_C_LIBRARIES libmedC.so medC) +FIND_LIBRARY(MEDFILE_F_LIBRARIES libmed.so med) +IF(MEDFILE_F_LIBRARIES) + SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES} ${MEDFILE_F_LIBRARIES}) +ELSE(MEDFILE_F_LIBRARIES) + SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES}) +ENDIF(MEDFILE_F_LIBRARIES) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MEDFile REQUIRED_VARS MEDFILE_INCLUDE_DIRS MEDFILE_LIBRARIES) diff --git a/salome_adm/cmake_files/FindSalomeMedfile.cmake b/salome_adm/cmake_files/FindSalomeMEDFile.cmake similarity index 92% rename from salome_adm/cmake_files/FindSalomeMedfile.cmake rename to salome_adm/cmake_files/FindSalomeMEDFile.cmake index 10e45a635..f890f17a9 100644 --- a/salome_adm/cmake_files/FindSalomeMedfile.cmake +++ b/salome_adm/cmake_files/FindSalomeMEDFile.cmake @@ -24,5 +24,5 @@ # !! Please read the generic detection procedure in SalomeMacros.cmake !! # -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(medfile MEDFILE_ROOT_DIR_EXP 0) -#MARK_AS_ADVANCED() \ No newline at end of file +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(MEDFile MEDFILE_ROOT_DIR_EXP 0) +#MARK_AS_ADVANCED() -- 2.39.2