From 9be7eafa39a2feaf696b9a9fd9e8a4630ae306a1 Mon Sep 17 00:00:00 2001 From: xtex Date: Fri, 28 Feb 2025 11:29:39 +0000 Subject: [PATCH] build: Find regex component of Boost explicitly (#2151) 'Boost::regex' could not be found unless regex is specified explicitly on some systems. cf. https://github.com/AOSC-Dev/aosc-os-abbs/pull/9798 cc. @chenx97 ### Problem description > Target "libimhex" links to: Boost::regex but the target was not found. when building ImHex with system Boost. ### Implementation description Add `COMPONENETS regex` to require regex library explicitly. Signed-off-by: xtex Co-authored-by: Henry Chen --- cmake/build_helpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 1e5f1ec8e..4d7e8391d 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -829,7 +829,7 @@ macro(addBundledLibraries) endif() if (USE_SYSTEM_BOOST) - find_package(Boost REQUIRED) + find_package(Boost REQUIRED CONFIG COMPONENTS regex) set(BOOST_LIBRARIES Boost::regex) else() add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/boost ${CMAKE_CURRENT_BINARY_DIR}/boost EXCLUDE_FROM_ALL)