Description
CMake is now a very popular build automation system. It would be good to be able to build hwloc via CMake. One benefit is the ease of integration that it would bring in other CMake projects.
It does not need to totally replace autotools but add a way of building for those more familiar with CMake.
I have created a fork (https://github.com/FunMiles/hwloc.git) in which I've made a first version that is tailored to MacOS but could be extended to Linux and Windows. I am not able to test all cases but with others' help, I'd be happy to make improvements so that it is a reliable way to compile hwloc with all its capabilities.
Having a correct CMakeLists.txt allows to consume hwloc in CMake projects (with CMake >= 3.24) very easily:
include(FetchContent)
FetchContent_Declare(
hwloc
GIT_REPOSITORY https://github.com/FunMiles/hwloc.git
GIT_TAG 6e47ca0d1f86fc14fbc5fef982618d5b5f48054c # based on release-2.8.0
OVERRIDE_FIND_PACKAGE
)
find_package(hwloc REQUIRED)
target_link_library(my_executable PRIVATE hwloc::hwloc)
Of course, one can compile and install hwloc and then only the last two lines would be required.