From 233f2e1eb00e3319c958259f5c847d38e1c0882a Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Tue, 1 Dec 2015 14:00:41 +0100 Subject: [PATCH] cmake files --- medtool/CMakeLists.txt | 69 +++----------------------- medtool/cmake_files/CMakeLists.txt | 32 ++++++++++++ medtool/cmake_files/FindGraphviz.cmake | 5 ++ 3 files changed, 45 insertions(+), 61 deletions(-) create mode 100644 medtool/cmake_files/CMakeLists.txt diff --git a/medtool/CMakeLists.txt b/medtool/CMakeLists.txt index 1ae2dc0ac..0bf0392c2 100644 --- a/medtool/CMakeLists.txt +++ b/medtool/CMakeLists.txt @@ -38,10 +38,6 @@ SET(${PROJECT_NAME_UC}_VERSION_DEV 1) LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_files") INCLUDE(MEDCouplingMacros) -# Platform setup -# ============== -#INCLUDE(SalomeSetupPlatform) - # # User options # ============ @@ -65,41 +61,29 @@ ENDIF(WIN32) # Set list of prerequisites # ========================= -LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_files") - IF(NOT MEDCOUPLING_MED_MICROMED) - #FIND_PACKAGE(SalomeHDF5 REQUIRED) - #FIND_PACKAGE(SalomeMEDFile REQUIRED) FIND_PACKAGE(HDF5 REQUIRED) FIND_PACKAGE(MEDFile REQUIRED) # XDR stuff IF(NOT WIN32) - #FIND_PACKAGE(SalomeXDR REQUIRED) FIND_PACKAGE(XDR REQUIRED) ELSE(NOT WIN32) IF(MEDCOUPLING_MED_MEDLOADER_USE_XDR) - #FIND_PACKAGE(SalomeXDR REQUIRED) FIND_PACKAGE(XDR REQUIRED) ENDIF(MEDCOUPLING_MED_MEDLOADER_USE_XDR) ENDIF(NOT WIN32) # End of XDR Stuff IF(MEDCOUPLING_MED_ENABLE_PARTITIONER) - #FIND_PACKAGE(SalomeLibXml2) - #SALOME_LOG_OPTIONAL_PACKAGE(LibXml2 MEDCOUPLING_MED_ENABLE_PARTITIONER) IF(DEFINED ENV{LIBXML2_ROOT_DIR}) SET(LIBXML2_ROOT_DIR $ENV{LIBXML2_ROOT_DIR} CACHE PATH "Path to the LibXml2.") LIST(APPEND CMAKE_PREFIX_PATH "${LIBXML2_ROOT_DIR}") ENDIF() FIND_PACKAGE(LibXml2) IF(MEDCOUPLING_MED_PARTITIONER_METIS) - #FIND_PACKAGE(SalomeMetis) - #SALOME_LOG_OPTIONAL_PACKAGE(Metis MEDCOUPLING_MED_PARTITIONER_METIS) FIND_PACKAGE(Metis) ADD_DEFINITIONS("-DMED_ENABLE_METIS") ENDIF(MEDCOUPLING_MED_PARTITIONER_METIS) IF(MEDCOUPLING_MED_PARTITIONER_SCOTCH) - #FIND_PACKAGE(SalomeScotch) - #SALOME_LOG_OPTIONAL_PACKAGE(Scotch MEDCOUPLING_MED_PARTITIONER_SCOTCH) FIND_PACKAGE(Scotch) ADD_DEFINITIONS("-DMED_ENABLE_SCOTCH") ENDIF(MEDCOUPLING_MED_PARTITIONER_SCOTCH) @@ -109,13 +93,10 @@ ENDIF(NOT MEDCOUPLING_MED_MICROMED) ENABLE_TESTING() # let it outsite because even if MEDCOUPLING_BUILD_TESTS is OFF, python tests that not need additional compilation can be run. IF(MEDCOUPLING_BUILD_TESTS) - #FIND_PACKAGE(SalomeCppUnit) - #SALOME_LOG_OPTIONAL_PACKAGE(CppUnit MEDCOUPLING_BUILD_TESTS) FIND_PACKAGE(CppUnit) ENDIF(MEDCOUPLING_BUILD_TESTS) IF(MEDCOUPLING_USE_MPI) - #FIND_PACKAGE(SalomeMPI REQUIRED) FIND_PACKAGE(MPI REQUIRED) ADD_DEFINITIONS("-DHAVE_MPI") SET(MPI_INCLUDE_DIRS ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH}) @@ -123,16 +104,12 @@ IF(MEDCOUPLING_USE_MPI) SET(MPI_DEFINITIONS "${MPI_CXX_COMPILE_FLAGS}") IF(MEDCOUPLING_MED_PARTITIONER_PARMETIS) - #FIND_PACKAGE(SalomeParMetis) FIND_PACKAGE(ParMetis) - #SALOME_LOG_OPTIONAL_PACKAGE(ParMetis MEDCOUPLING_MED_PARTITIONER_PARMETIS) ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS") ENDIF(MEDCOUPLING_MED_PARTITIONER_PARMETIS) ENDIF(MEDCOUPLING_USE_MPI) IF(MEDCOUPLING_MED_ENABLE_RENUMBER) - #FIND_PACKAGE(SalomeBoost) - #SALOME_LOG_OPTIONAL_PACKAGE(Boost MEDCOUPLING_MED_ENABLE_RENUMBER) IF(DEFINED ENV{BOOST_ROOT_DIR}) SET(BOOST_ROOT_DIR $ENV{BOOST_ROOT_DIR} CACHE PATH "Path to the Boost.") LIST(APPEND CMAKE_PREFIX_PATH "${BOOST_ROOT_DIR}") @@ -141,31 +118,16 @@ IF(MEDCOUPLING_MED_ENABLE_RENUMBER) SET(Boost_USE_MULTITHREADED ON) SET(Boost_USE_STATIC_RUNTIME OFF) SET(Boost_NO_BOOST_CMAKE ON) - #SET(SalomeBoost_FIND_COMPONENTS filesystem regex signals system thread date_time chrono) FIND_PACKAGE(Boost) ENDIF(MEDCOUPLING_MED_ENABLE_RENUMBER) IF(MEDCOUPLING_BUILD_DOC) - #FIND_PACKAGE(SalomeDoxygen) - #FIND_PACKAGE(SalomeGraphviz) - #FIND_PACKAGE(SalomeSphinx) - #SALOME_LOG_OPTIONAL_PACKAGE(Doxygen MEDCOUPLING_BUILD_DOC) - #SALOME_LOG_OPTIONAL_PACKAGE(Graphviz MEDCOUPLING_BUILD_DOC) - #SALOME_LOG_OPTIONAL_PACKAGE(Sphinx MEDCOUPLING_BUILD_DOC) FIND_PACKAGE(Doxygen) - IF(DEFINED ENV{GRAPHVIZ_ROOT_DIR}) - SET(GRAPHVIZ_ROOT_DIR $ENV{GRAPHVIZ_ROOT_DIR} CACHE PATH "Path to the Graphviz.") - LIST(APPEND CMAKE_PREFIX_PATH "${GRAPHVIZ_ROOT_DIR}") - ENDIF() FIND_PACKAGE(Graphviz) FIND_PACKAGE(Sphinx) ENDIF(MEDCOUPLING_BUILD_DOC) IF(MEDCOUPLING_MED_ENABLE_PYTHON) - #FIND_PACKAGE(SalomePython) - #FIND_PACKAGE(SalomeSWIG) - #SALOME_LOG_OPTIONAL_PACKAGE(Python MEDCOUPLING_MED_ENABLE_PYTHON) - #SALOME_LOG_OPTIONAL_PACKAGE(SWIG MEDCOUPLING_MED_ENABLE_PYTHON) FIND_PACKAGE(PythonInterp) GET_FILENAME_COMPONENT(_python_dir "${PYTHON_EXECUTABLE}" PATH) GET_FILENAME_COMPONENT(CMAKE_INCLUDE_PATH "${_python_dir}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE) @@ -184,9 +146,6 @@ IF(MEDCOUPLING_MED_ENABLE_PYTHON) ENDIF(SCIPY_FOUND) ENDIF(MEDCOUPLING_MED_ENABLE_PYTHON) -# Detection report -#SALOME_PACKAGE_REPORT_AND_CHECK() - # Directories # # Directories have to be given after prerequisites (to be able to use @@ -197,16 +156,9 @@ SET(MEDCOUPLING_INSTALL_LIBS lib CACHE PATH "Install path: MEDCoupling libs") SET(MEDCOUPLING_INSTALL_HEADERS include CACHE PATH "Install path: MEDCoupling headers") SET(MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS ${MEDCOUPLING_INSTALL_BINS} CACHE PATH "Install path: MEDCoupling scripts") SET(MEDCOUPLING_INSTALL_TESTS tests CACHE PATH "Install path: MEDCoupling tests") -# SET(MEDCOUPLING_INSTALL_SCRIPT_DATA ${MEDCOUPLING_INSTALL_BINS} CACHE PATH -# "Install path: SALOME script data") +# SET(MEDCOUPLING_INSTALL_SCRIPT_DATA ${MEDCOUPLING_INSTALL_BINS} CACHE PATH "Install path: MEDCoupling script data") SET(MEDCOUPLING_INSTALL_SCRIPT_PYTHON ${MEDCOUPLING_INSTALL_BINS} CACHE PATH "Install path: MEDCoupling Python scripts") -# SET(MEDCOUPLING_INSTALL_APPLISKEL_SCRIPTS ${MEDCOUPLING_INSTALL_BINS}/appliskel CACHE PATH -# "Install path: SALOME application skeleton - scripts") -# SET(MEDCOUPLING_INSTALL_APPLISKEL_PYTHON ${MEDCOUPLING_INSTALL_BINS}/appliskel CACHE PATH -# "Install path: SALOME application skeleton - Python") -# SET(MEDCOUPLING_INSTALL_CMAKE salome_adm/cmake_files CACHE PATH "Install path: SALOME CMake files") -# SET(MEDCOUPLING_INSTALL_CMAKE_LOCAL adm_local/cmake_files CACHE PATH -# "Install path: local SALOME CMake files") +SET(MEDCOUPLING_INSTALL_CMAKE_LOCAL cmake_files CACHE PATH "Install path: local MEDCoupling CMake files") IF(MEDCOUPLING_MED_ENABLE_PYTHON) SET(_pydir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) @@ -221,18 +173,16 @@ SET(MEDCOUPLING_INSTALL_DOC share/doc CACHE PATH "Install path: MEDCoupling docu # Med specific: SET(MEDCOUPLING_INSTALL_RES_DATA "${MEDCOUPLING_INSTALL_RES}/med" CACHE PATH "Install path: MEDCoupling specific data") -#SET(MEDCOUPLING_MED_INSTALL_RES_SCRIPTS "${MEDCOUPLING_INSTALL_RES}/med" CACHE PATH "Install path: SALOME MED specific scripts") +#SET(MEDCOUPLING_MED_INSTALL_RES_SCRIPTS "${MEDCOUPLING_INSTALL_RES}/med" CACHE PATH "Install path: MEDCouplng specific scripts") -#MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_BINS MEDCOUPLING_INSTALL_LIBS MEDCOUPLING_INSTALL_IDLS MEDCOUPLING_INSTALL_HEADERS) -#MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS MEDCOUPLING_INSTALL_SCRIPT_DATA MEDCOUPLING_INSTALL_SCRIPT_PYTHON) -#MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_APPLISKEL_SCRIPTS MEDCOUPLING_INSTALL_APPLISKEL_PYTHON MEDCOUPLING_INSTALL_CMAKE MEDCOUPLING_INSTALL_CMAKE_LOCAL MEDCOUPLING_INSTALL_RES) -#MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_PYTHON MEDCOUPLING_INSTALL_PYTHON_SHARED MEDCOUPLING_MED_INSTALL_RES_DATA MEDCOUPLING_MED_INSTALL_RES_SCRIPTS MEDCOUPLING_INSTALL_DOC) +MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_BINS MEDCOUPLING_INSTALL_LIBS MEDCOUPLING_INSTALL_IDLS MEDCOUPLING_INSTALL_HEADERS) +MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS MEDCOUPLING_INSTALL_SCRIPT_DATA MEDCOUPLING_INSTALL_SCRIPT_PYTHON) +MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_APPLISKEL_SCRIPTS MEDCOUPLING_INSTALL_APPLISKEL_PYTHON MEDCOUPLING_INSTALL_CMAKE MEDCOUPLING_INSTALL_CMAKE_LOCAL MEDCOUPLING_INSTALL_RES) +MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_PYTHON MEDCOUPLING_INSTALL_PYTHON_SHARED MEDCOUPLING_MED_INSTALL_RES_DATA MEDCOUPLING_MED_INSTALL_RES_SCRIPTS MEDCOUPLING_INSTALL_DOC) # Header configuration # ==================== MEDCOUPLING_XVERSION(${PROJECT_NAME}) -#SALOME_CONFIGURE_FILE(MED_version.h.in MED_version.h INSTALL ${MEDCOUPLING_INSTALL_HEADERS}) -#SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${MEDCOUPLING_INSTALL_BINS}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/MEDCoupling_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling_version.h) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling_version.h DESTINATION ${MEDCOUPLING_INSTALL_HEADERS}) @@ -248,16 +198,13 @@ IF(WIN32) ADD_DEFINITIONS("-D_USE_MATH_DEFINES") ENDIF(WIN32) -#ADD_DEFINITIONS("-DMEDCOUPLING_ROOT_DIR=${CMAKE_INSTALL_PREFIX}") ADD_SUBDIRECTORY(src) -#ADD_SUBDIRECTORY(adm_local) +ADD_SUBDIRECTORY(cmake_files) IF(MEDCOUPLING_BUILD_DOC) ADD_SUBDIRECTORY(doc) ENDIF(MEDCOUPLING_BUILD_DOC) -#ADD_SUBDIRECTORY(adm_local_without_kernel) - IF(NOT MEDCOUPLING_MED_MICROMED) IF(MEDCOUPLING_MED_WITH_FILE_EXAMPLES) ADD_SUBDIRECTORY(resources) diff --git a/medtool/cmake_files/CMakeLists.txt b/medtool/cmake_files/CMakeLists.txt new file mode 100644 index 000000000..ecc1dfad1 --- /dev/null +++ b/medtool/cmake_files/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (C) 2015 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +SET(admlocal_cmake_DATA + FindCppUnit.cmake + FindMEDFile.cmake + FindParMetis.cmake + FindSphinx.cmake + MEDCouplingMacros.cmake + FindGraphviz.cmake + FindMetis.cmake + FindScotch.cmake + FindXDR.cmake +) + +INSTALL(FILES ${admlocal_cmake_DATA} DESTINATION ${MEDCOUPLING_INSTALL_CMAKE_LOCAL}) diff --git a/medtool/cmake_files/FindGraphviz.cmake b/medtool/cmake_files/FindGraphviz.cmake index be92feb5f..c05a59458 100644 --- a/medtool/cmake_files/FindGraphviz.cmake +++ b/medtool/cmake_files/FindGraphviz.cmake @@ -30,6 +30,11 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +SET(GRAPHVIZ_ROOT_DIR $ENV{GRAPHVIZ_ROOT_DIR} CACHE PATH "Path to the Graphviz.") +IF(GRAPHVIZ_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${GRAPHVIZ_ROOT_DIR}") +ENDIF(GRAPHVIZ_ROOT_DIR) + FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot) FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/cgraph.h) -- 2.39.2