MmgTools / mmg

open source software for bidimensional and tridimensional remeshing
http://www.mmgtools.org
Other
362 stars 117 forks source link

Feature/mmg install private headers #187

Closed Algiane closed 1 year ago

Algiane commented 1 year ago

Add possibility to install private headers of Mmg

This PR adds the possibility to install private headers of Mmg by enabling the MMG_INSTALL_PRIVATE_HEADERS CMake flags to ON. It allows to use private Mmg functions in other projects built on top of Mmg.

It is linked to:

It also clean the header installation of Mmg: now, instead of being copied in multiple locations to be found, common headers of Mmg2d, mmg3d and Mmgs are installed in mmg/common directory of CMAKE_INSTALL_PREFIX directory.

Note that:

Algiane commented 1 year ago

@prj-

I hope that this PR will satisfy your need and will free you from the charge to maintain your fork of Mmg. I would be very thankful if you can test this branch with the https://github.com/MmgTools/ParMmg/tree/feature/Find-Mmg-private-headers branch of ParMmg.

You will have to clean your previous Mmg install as the branch propose a new tree structure for the Mmg installation and to enabled the MMG_INSTALL_PRIVATE_HEADERS CMake's flag at Mmg configuration.

Thank you by advance of any feedback.

prj- commented 1 year ago

Re-compiling now, thanks for the heads-up.

prj- commented 1 year ago
/media/psf/repositories/petsc/arch-linux-c-debug-real/externalpackages/git.parmmg/src/parmmg.h:50:10: fatal error: libmmg3d.h: No such file or directory
   50 | #include "libmmg3d.h"
      |          ^~~~~~~~~~~~
prj- commented 1 year ago

It looks like you are missing some fixes for ParMmg from https://github.com/prj-/ParMmg/commits/jolivet/fix-compilation-3.19.0.

Algiane commented 1 year ago
/media/psf/repositories/petsc/arch-linux-c-debug-real/externalpackages/git.parmmg/src/parmmg.h:50:10: fatal error: libmmg3d.h: No such file or directory
   50 | #include "libmmg3d.h"
      |          ^~~~~~~~~~~~

In branch feature/Find-Mmg-private-headersof ParMmg, lines https://github.com/MmgTools/ParMmg/blob/8f156cb7409d27d3ed628e7ccb90c70d6d6d4a23/CMakeLists.txt#L293-L294 add the mmg/common and mmg/mmg3d sub-directories of the installation directory of Mmg (that you can specify through the MMG_DIR variable) to the parmmg include directories.

It should be sufficient to not have to add the path the libmmg3d.h file.

In practice I don't care if I have to add the path toward the libmmg3d.h file but it is more complicated for some of private headers as inclusion path may be different in Mmg than in ParMmg.

Algiane commented 1 year ago

It looks like you are missing some fixes for ParMmg from https://github.com/prj-/ParMmg/commits/jolivet/fix-compilation-3.19.0.

Thanks for the reminder. As I have only few days to work on Mmg/ParMmg, I am focusing on fixing important things for the next Mmg release and for now I don't have the time to review your propositions of improvement in the cmake of ParMmg.

Best