METIS icon indicating copy to clipboard operation
METIS copied to clipboard

Provide MetisConfig.cmake

Open gruenich opened this issue 4 years ago • 6 comments

Providing a cmake config file makes it easier to find and use Metis. Metis should create such a config file. CMake offers some functions to do this without much effort: https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html

gruenich avatar May 13 '20 23:05 gruenich

What is the benefit for doing that?

karypis avatar Jul 09 '20 20:07 karypis

It simplifies the way projects can include and use Metis. If Metis would provide a Metis-cmake.config, all it has to do is to add Find_package(Metis) and if the file is found, all flags and includes are included in the CMake project. Cf. https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html?highlight=config#config-file-packages

gruenich avatar Jul 09 '20 23:07 gruenich

I agree with gruenich. It simplifies the usage a lot. I just implemented that in my PR of METIS here. To use METIS in another CMake configured project you can now just write:

find_package(METIS REQUIRED)
...
target_link_libraries(myproject PUBLIC METIS::metis)

codecircuit avatar Oct 16 '20 08:10 codecircuit

@codecircuit Creating a merge request here seems more helpful to me. Then karpys gets a proper diff. Also from a copyright point of view, for projects where I am maintainer, I would prefer an MR instead of copying code myself. Could you be so kind?

gruenich avatar Oct 28 '20 19:10 gruenich

Are there any news on this? I was trying to write a Python library that embeds some C++ code that calls metis and a cmake config file would make my life easier. At a first glance, the code written by @codecircuit seems still compatible with the current version of the file. Could it be implemented?

spiani avatar Jul 06 '23 14:07 spiani

See #79

LecrisUT avatar Oct 26 '23 20:10 LecrisUT