Skip to content

Tools for the mmg libraries users

Algiane Froehly edited this page Feb 23, 2016 · 11 revisions

I/ Find the mmg libraries using CMake

You can use:

If the package fails, you can help it by:

  • setting the MMG_DIR environment variable to your mmg directory path:
export MMG_DIR=<your_mmg_directory_path>
  • or setting the MMG_DIR CMake variable to your mmg directory path:
SET(MMG_DIR <your_mmg_directory_path>)

FindMmg.cmake package

The FindMmg.cmake package defines the MMG_INCLUDE_DIR and the MMG_LIBRARY variables.
To link a program named YOUR_TARGET with the mmg library using CMake, just add the following lines in your CMakeLists.txt:

INCLUDE(FindMmg.cmake)
INCLUDE_DIRECTORIES(${MMG_INCLUDE_DIR})
TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMG_LIBRARY})

FindMmg2d.cmake package

The FindMmg2d.cmake package defines the MMG2D_INCLUDE_DIR and the MMG2D_LIBRARY variables.
To link a program named YOUR_TARGET with the mmg2d library using CMake, just add the following lines in your CMakeLists.txt:

INCLUDE(FindMmg2d.cmake)
INCLUDE_DIRECTORIES(${MMG2D_INCLUDE_DIR})
TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMG2D_LIBRARY})

FindMmgs.cmake package

The FindMmgs.cmake package defines the MMGS_INCLUDE_DIR and the MMGS_LIBRARY variables.
To link a program named YOUR_TARGET with the mmgs library using CMake, just add the following lines in your CMakeLists.txt:

INCLUDE(FindMmgs.cmake)
INCLUDE_DIRECTORIES(${MMGS_INCLUDE_DIR})
TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMGS_LIBRARY})

FindMmg3d.cmake package

The FindMmg3d.cmake package defines the MMG3D_INCLUDE_DIR and the MMG3D_LIBRARY variables.
To link a program named YOUR_TARGET with the mmg3d library using CMake, just add the following lines in your CMakeLists.txt:

INCLUDE(FindMmg3d.cmake)
INCLUDE_DIRECTORIES(${MMG3D_INCLUDE_DIR})
TARGET_LINK_LIBRARIES( ${YOUR_TARGET} ${MMG3D_LIBRARY})

II/ Usage examples

You can find examples of the use of the mmg libraries in the [libexamples][libexamples] subfolder (see the projects source tree section of the wiki for the description of the libexamples directory).