From d499d0d1c6116a6dfa82332825eff0893a8b26cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Wed, 18 Jan 2017 15:43:05 +0000 Subject: [PATCH] Adding the cmake modules of the MMG --- cmake_modules/FindMmg.cmake | 68 +++++++++++++++++++++++++++++++++++ cmake_modules/FindMmg2d.cmake | 68 +++++++++++++++++++++++++++++++++++ cmake_modules/FindMmg3d.cmake | 68 +++++++++++++++++++++++++++++++++++ cmake_modules/FindMmgs.cmake | 68 +++++++++++++++++++++++++++++++++++ 4 files changed, 272 insertions(+) create mode 100644 cmake_modules/FindMmg.cmake create mode 100644 cmake_modules/FindMmg2d.cmake create mode 100644 cmake_modules/FindMmg3d.cmake create mode 100644 cmake_modules/FindMmgs.cmake diff --git a/cmake_modules/FindMmg.cmake b/cmake_modules/FindMmg.cmake new file mode 100644 index 000000000000..864997c3c1d7 --- /dev/null +++ b/cmake_modules/FindMmg.cmake @@ -0,0 +1,68 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Inria - IMB (Université de Bordeaux) - LJLL (UPMC), 2004- . +## +## mmg 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 3 of the License, or +## (at your option) any later version. +## +## mmg 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 and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= +# +# This package define the MMG_INCLUDE_DIR and the MMG_LIBRARY variables. To +# link with the mmg library using CMake add the following lines to your +# CMakeLists.txt: +# +# INCLUDE(FindMmg.cmake) +# +# INCLUDE_DIRECTORIES(${MMG_INCLUDE_DIR}) +# +# TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMG_LIBRARY}) + + +IF ((NOT WIN32) AND (NOT WIN64)) + SET ( MMG_INCLUDE_DIR MMG_INCLUDE_DIR-NOTFOUND ) + SET ( MMG_LIBRARY MMG_LIBRARY-NOTFOUND ) +ENDIF() + +FIND_PATH(MMG_INCLUDE_DIR + NAMES mmg/libmmg.h + HINTS ${MMG_INCLUDE_DIR} + $ENV{MMG_INCLUDE_DIR} + $ENV{HOME}/include/ + ${MMG_DIR}/include/ + $ENV{MMG_DIR}/include/ + PATH_SUFFIXES + DOC "Directory of mmg Headers") + +# Check for mmg library +FIND_LIBRARY(MMG_LIBRARY + NAMES mmg mmg${MMG_LIB_SUFFIX} + HINTS ${MMG_LIBRARY} + $ENV{MMG_LIBRARY} + $ENV{HOME}/lib + ${MMG_DIR}/lib + $ENV{MMG_DIR}/lib + DOC "The mmg library" + ) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MMG DEFAULT_MSG + MMG_INCLUDE_DIR MMG_LIBRARY) + +IF ( NOT MMG_FOUND ) + MESSAGE (WARNING "\nMMG not found: you can set the 'MMG_DIR' environment" + " variable or the 'MMG_DIR' CMake variable to your MMG directory path" + " to help us to fill the MMG library paths.\n" ) +ENDIF () diff --git a/cmake_modules/FindMmg2d.cmake b/cmake_modules/FindMmg2d.cmake new file mode 100644 index 000000000000..918f32ea832a --- /dev/null +++ b/cmake_modules/FindMmg2d.cmake @@ -0,0 +1,68 @@ + ## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Inria - IMB (Université de Bordeaux) - LJLL (UPMC), 2004- . +## +## mmg 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 3 of the License, or +## (at your option) any later version. +## +## mmg 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 and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= +# +# This package define the MMG2D_INCLUDE_DIR and the MMG2D_LIBRARY variables. To +# link with the mmg2d library using CMake add the following lines to your +# CMakeLists.txt: +# +# INCLUDE(FindMmg2d.cmake) +# +# INCLUDE_DIRECTORIES(${MMG2D_INCLUDE_DIR}) +# +# TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMG2D_LIBRARY}) + + +IF ((NOT WIN32) AND (NOT WIN64)) + SET ( MMG2D_INCLUDE_DIR MMG2D_INCLUDE_DIR-NOTFOUND ) + SET ( MMG2D_LIBRARY MMG2D_LIBRARY-NOTFOUND ) +ENDIF() + +FIND_PATH(MMG2D_INCLUDE_DIR + NAMES mmg/mmg2d/libmmg2d.h + HINTS ${MMG2D_INCLUDE_DIR} + $ENV{MMG2D_INCLUDE_DIR} + $ENV{HOME}/include/ + ${MMG_DIR}/include/ + $ENV{MMG_DIR}/include/ + PATH_SUFFIXES + DOC "Directory of mmg2d Headers") + +# Check for mmg2d library +FIND_LIBRARY(MMG2D_LIBRARY + NAMES mmg2d mmg2d${MMG2D_LIB_SUFFIX} + HINTS ${MMG2D_LIBRARY} + $ENV{MMG2D_LIBRARY} + $ENV{HOME}/lib + ${MMG_DIR}/lib + $ENV{MMG_DIR}/lib + DOC "The mmg2d library" + ) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MMG2D DEFAULT_MSG + MMG2D_INCLUDE_DIR MMG2D_LIBRARY) + +IF ( NOT MMG2D_FOUND ) + MESSAGE (WARNING "\nMMG2D not found: you can set the 'MMG_DIR' environment" + " variable or the 'MMG_DIR' CMake variable to your MMG directory path" + " to help us to fill the MMG2D library paths.\n" ) +ENDIF () diff --git a/cmake_modules/FindMmg3d.cmake b/cmake_modules/FindMmg3d.cmake new file mode 100644 index 000000000000..d3bf8e4ca7fd --- /dev/null +++ b/cmake_modules/FindMmg3d.cmake @@ -0,0 +1,68 @@ + ## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Inria - IMB (Université de Bordeaux) - LJLL (UPMC), 2004- . +## +## mmg 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 3 of the License, or +## (at your option) any later version. +## +## mmg 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 and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= +# +# This package define the MMG3D_INCLUDE_DIR and the MMG3D_LIBRARY variables. To +# link with the mmg3d library using CMake add the following lines to your +# CMakeLists.txt: +# +# INCLUDE(FindMmg3d.cmake) +# +# INCLUDE_DIRECTORIES(${MMG3D_INCLUDE_DIR}) +# +# TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMG3D_LIBRARY}) + + +IF ((NOT WIN32) AND (NOT WIN64)) + SET ( MMG3D_INCLUDE_DIR MMG3D_INCLUDE_DIR-NOTFOUND ) + SET ( MMG3D_LIBRARY MMG3D_LIBRARY-NOTFOUND ) +ENDIF() + +FIND_PATH(MMG3D_INCLUDE_DIR + NAMES mmg/mmg3d/libmmg3d.h + HINTS ${MMG3D_INCLUDE_DIR} + $ENV{MMG3D_INCLUDE_DIR} + $ENV{HOME}/include/ + ${MMG_DIR}/include/ + $ENV{MMG_DIR}/include/ + PATH_SUFFIXES + DOC "Directory of mmg3d Headers") + +# Check for mmg3d library +FIND_LIBRARY(MMG3D_LIBRARY + NAMES mmg3d mmg3d${MMG3D_LIB_SUFFIX} + HINTS ${MMG3D_LIBRARY} + $ENV{MMG3D_LIBRARY} + $ENV{HOME}/lib + ${MMG_DIR}/lib + $ENV{MMG_DIR}/lib + DOC "The mmg3d library" + ) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MMG3D DEFAULT_MSG + MMG3D_INCLUDE_DIR MMG3D_LIBRARY) + +IF ( NOT MMG3D_FOUND ) + MESSAGE (WARNING "\nMMG3D not found: you can set the 'MMG_DIR' environment" + " variable or the 'MMG_DIR' CMake variable to your MMG directory path" + " to help us to fill the MMG3D library paths.\n" ) +ENDIF () diff --git a/cmake_modules/FindMmgs.cmake b/cmake_modules/FindMmgs.cmake new file mode 100644 index 000000000000..12dcf20572d6 --- /dev/null +++ b/cmake_modules/FindMmgs.cmake @@ -0,0 +1,68 @@ + ## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +## Copyright (c) Inria - IMB (Université de Bordeaux) - LJLL (UPMC), 2004- . +## +## mmg 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 3 of the License, or +## (at your option) any later version. +## +## mmg 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 and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= +# +# This package define the MMGS_INCLUDE_DIR and the MMGS_LIBRARY variables. To +# link with the mmgs library using CMake add the following lines to your +# CMakeLists.txt: +# +# INCLUDE(FindMmgs.cmake) +# +# INCLUDE_DIRECTORIES(${MMGS_INCLUDE_DIR}) +# +# TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMGS_LIBRARY}) + + +IF ((NOT WIN32) AND (NOT WIN64)) + SET ( MMGS_INCLUDE_DIR MMGS_INCLUDE_DIR-NOTFOUND ) + SET ( MMGS_LIBRARY MMGS_LIBRARY-NOTFOUND ) +ENDIF() + +FIND_PATH(MMGS_INCLUDE_DIR + NAMES mmg/mmgs/libmmgs.h + HINTS ${MMGS_INCLUDE_DIR} + $ENV{MMGS_INCLUDE_DIR} + $ENV{HOME}/include/ + ${MMG_DIR}/include/ + $ENV{MMG_DIR}/include/ + PATH_SUFFIXES + DOC "Directory of mmgs Headers") + +# Check for mmgs library +FIND_LIBRARY(MMGS_LIBRARY + NAMES mmgs mmgs${MMGS_LIB_SUFFIX} + HINTS ${MMGS_LIBRARY} + $ENV{MMGS_LIBRARY} + $ENV{HOME}/lib + ${MMG_DIR}/lib + $ENV{MMG_DIR}/lib + DOC "The mmgs library" + ) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MMGS DEFAULT_MSG + MMGS_INCLUDE_DIR MMGS_LIBRARY) + +IF ( NOT MMGS_FOUND ) + MESSAGE (WARNING "\nMMGS not found: you can set the 'MMG_DIR' environment" + " variable or the 'MMG_DIR' CMake variable to your MMG directory path" + " to help us to fill the MMGS library paths.\n" ) +ENDIF ()