From 9b2b844a5f4ed19296be643fac2f5fc04008eab8 Mon Sep 17 00:00:00 2001 From: Conor Williams Date: Fri, 10 May 2024 16:15:38 +0100 Subject: [PATCH] better error messages --- CMakeLists.txt | 6 +++++- cmake/install-config.cmake.in | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04cf105..388f92a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,8 @@ if(NOT LF_NO_HWLOC) target_compile_definitions(libfork_libfork INTERFACE LF_USE_HWLOC) # Link to exported target. target_link_libraries(libfork_libfork INTERFACE hwloc::hwloc) + # Let user know version + message(STATUS "Found HWLOC version ${hwloc_VERSION}, NUMA support enabled!") else() find_package(PkgConfig) @@ -79,13 +81,15 @@ if(NOT LF_NO_HWLOC) unset(HWLOC_FOUND CACHE) # Prevent dirty cache - pkg_search_module(HWLOC IMPORTED_TARGET hwloc>=2.0) + pkg_search_module(HWLOC QUIET IMPORTED_TARGET hwloc>=2.0) if(HWLOC_FOUND) # Instructs libfork to use hwloc. target_compile_definitions(libfork_libfork INTERFACE LF_USE_HWLOC) # Link to imported target. target_link_libraries(libfork_libfork INTERFACE PkgConfig::HWLOC) + # Let user know version + message(STATUS "Found HWLOC version ${HWLOC_VERSION}, NUMA support enabled!") else() message(WARNING "HWLOC: not found, NUMA support disabled!") endif() diff --git a/cmake/install-config.cmake.in b/cmake/install-config.cmake.in index 291eeb6..a0e10eb 100644 --- a/cmake/install-config.cmake.in +++ b/cmake/install-config.cmake.in @@ -9,6 +9,8 @@ if (@hwloc_FOUND@) elseif(@HWLOC_FOUND@) find_dependency(PkgConfig) pkg_search_module(HWLOC REQUIRED IMPORTED_TARGET hwloc) +else() + message(WARNING "This installation of libfork was built without NUMA support!") endif() include("${CMAKE_CURRENT_LIST_DIR}/libforkTargets.cmake") \ No newline at end of file