From 620e4fcb03afaf40a9a6ecf7e9a87fc23b2fe2bd Mon Sep 17 00:00:00 2001 From: bruneton Date: Wed, 10 Jul 2013 08:50:23 +0000 Subject: [PATCH] CMake: added FindSalomeMED.cmake so taht PARAVIS can load MED in config mode Fixed some configruation elements --- CMakeLists.txt | 8 ++-- adm_local/cmake_files/CMakeLists.txt | 1 + adm_local/cmake_files/FindSalomeMED.cmake | 39 +++++++++++++++++++ .../cmake_files/SalomeMEDConfig.cmake.in | 11 +----- 4 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 adm_local/cmake_files/FindSalomeMED.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ead1e4d1..3ff90e5f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,8 +270,9 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} # Create the configuration files: # - in the build tree: -# Ensure the variables are always defined for the configure: - +# Ensure the variables are always defined for the configure (even if empty): +SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}") +SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}") SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}") SET(HDF5_ROOT_DIR "${HDF5_ROOT_DIR}") SET(MPI_ROOT_DIR "${MPI_ROOT_DIR}") @@ -292,7 +293,8 @@ CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake. ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}" PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX - MEDFILE_ROOT_DIR HDF5_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR + KERNEL_ROOT_DIR GUI_ROOT_DIR MEDFILE_ROOT_DIR + HDF5_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR SWIG_ROOT_DIR PYTHON_ROOT_DIR CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR SPHINX_ROOT_DIR) diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt index 1a69921e0..dff494ff0 100644 --- a/adm_local/cmake_files/CMakeLists.txt +++ b/adm_local/cmake_files/CMakeLists.txt @@ -25,6 +25,7 @@ SET(admlocal_cmake_DATA FindSalomeParMetis.cmake FindScotch.cmake FindSalomeScotch.cmake + FindSalomeMED.cmake ) INSTALL(FILES ${admlocal_cmake_DATA} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL}) diff --git a/adm_local/cmake_files/FindSalomeMED.cmake b/adm_local/cmake_files/FindSalomeMED.cmake new file mode 100644 index 000000000..b984405ea --- /dev/null +++ b/adm_local/cmake_files/FindSalomeMED.cmake @@ -0,0 +1,39 @@ +# 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 +# +# +# Author: Adrien Bruneton +# + +# MED detection for Salome - this is typically called by dependent modules +# (PARAVIS, etc ...) +# +# The detection is simpler than for other prerequisites. +# See explanation in FindSalomeKERNEL.cmake. +# + +IF(NOT SalomeMED_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome MED ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${MED_ROOT_DIR}") +SALOME_FIND_PACKAGE(SalomeMED SalomeMED CONFIG) + +IF(NOT SalomeMED_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome MED: ${MED_ROOT_DIR}") +ENDIF() diff --git a/adm_local/cmake_files/SalomeMEDConfig.cmake.in b/adm_local/cmake_files/SalomeMEDConfig.cmake.in index 70ff7ff25..32a61f323 100644 --- a/adm_local/cmake_files/SalomeMEDConfig.cmake.in +++ b/adm_local/cmake_files/SalomeMEDConfig.cmake.in @@ -71,19 +71,12 @@ ENDIF(SALOME_BUILD_GUI) # For all prerequisites, load the corresponding targets if the package was used # in CONFIG mode. This ensures dependent projects link correctly -# without having to set LD_LIBRARY_PATH: +# without having to set LD_LIBRARY_PATH. +# Many of them will be automatically loaded from KERNEL or GUI: SET(_PREREQ) SET(_PREREQ_CONFIG_DIR) -IF(NOT SALOME_MED_STANDALONE) - LIST(APPEND _PREREQ OmniORB) - LIST(APPEND _PREREQ_CONFIG_DIR "@OmniORB_DIR@" ) - IF(SALOME_BUILD_GUI) - LIST(APPEND _PREREQ Qt4) - LIST(APPEND _PREREQ_CONFIG_DIR "Qt4_DIR@" ) - ENDIF() -ENDIF() IF(NOT SALOME_MED_MICROMED) LIST(APPEND _PREREQ HDF5 MEDFile ) LIST(APPEND _PREREQ_CONFIG_DIR "@HDF5_DIR@" "@MEDFile_DIR@") -- 2.39.2