Skip to content

Commit b7b9e44

Browse files
committed
build(linux): require libicu for package builds with static boost
1 parent f52891d commit b7b9e44

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

cmake/packaging/linux.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,22 @@ if(NOT BOOST_USE_STATIC)
9191
boost-locale >= ${Boost_VERSION}, \
9292
boost-log >= ${Boost_VERSION}, \
9393
boost-program-options >= ${Boost_VERSION}")
94+
else()
95+
# Even when boost (locale) is static linked, it still requires ICU.
96+
# Distros might not have ICU in their base image so when packaging
97+
# add ICU as a dependency.
98+
# The ICU library is released with the version in their name... :(.
99+
find_package(ICU COMPONENTS uc data i18n REQUIRED)
100+
# ICU does not provide a minor / major version variable.
101+
string(REGEX MATCH "^[0-9]+" ICU_VERSION_MAJOR ${ICU_VERSION})
102+
# Debian-based distros have libicu versioned in the name.
103+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
104+
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
105+
libicu${ICU_VERSION_MAJOR}")
106+
# Fedora based distros provide a general package
107+
set(CPACK_RPM_PACKAGE_REQUIRES "\
108+
${CPACK_RPM_PACKAGE_REQUIRES}, \
109+
libicu")
94110
endif()
95111

96112
# This should automatically figure out dependencies, doesn't work with the current config

0 commit comments

Comments
 (0)