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 <xtex@aosc.io>
Co-authored-by: Henry Chen <chenx97@aosc.io>
This commit is contained in:
xtex
2025-02-28 11:29:39 +00:00
committed by GitHub
parent 774eb18a42
commit 9be7eafa39

View File

@@ -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)