Skip to content

Commit

Permalink
Adding the cmake modules of the MMG
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicente Mataix Ferrándiz committed Jan 18, 2017
1 parent c169c66 commit d499d0d
Show file tree
Hide file tree
Showing 4 changed files with 272 additions and 0 deletions.
68 changes: 68 additions & 0 deletions cmake_modules/FindMmg.cmake
Original file line number Diff line number Diff line change
@@ -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
## <http://www.gnu.org/licenses/>. 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 ()
68 changes: 68 additions & 0 deletions cmake_modules/FindMmg2d.cmake
Original file line number Diff line number Diff line change
@@ -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
## <http://www.gnu.org/licenses/>. 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 ()
68 changes: 68 additions & 0 deletions cmake_modules/FindMmg3d.cmake
Original file line number Diff line number Diff line change
@@ -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
## <http://www.gnu.org/licenses/>. 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 ()
68 changes: 68 additions & 0 deletions cmake_modules/FindMmgs.cmake
Original file line number Diff line number Diff line change
@@ -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
## <http://www.gnu.org/licenses/>. 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 ()

0 comments on commit d499d0d

Please sign in to comment.