Skip to content

Commit b421c69

Browse files
committed
[cmake] Find ICU in CoreFoundation.
ICU is also included in CoreFoundation, but the include paths were not used, which meant that the headers were probably the system headers, if they were there. This might have work in Ubuntu, but might not work in other systems with older ICUs. The patch passes the ICU_ROOT from the top level CMakeList.txt into the CoreFoundation one and performs a find_package to find the right include path.
1 parent 3f144c7 commit b421c69

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ExternalProject_Add(CoreFoundation
3939
-DCF_ENABLE_LIBDISPATCH=${FOUNDATION_ENABLE_LIBDISPATCH}
4040
-DCF_PATH_TO_LIBDISPATCH_SOURCE=${FOUNDATION_PATH_TO_LIBDISPATCH_SOURCE}
4141
-DCF_PATH_TO_LIBDISPATCH_BUILD=${FOUNDATION_PATH_TO_LIBDISPATCH_BUILD}
42+
-DICU_ROOT=${ICU_ROOT}
4243
INSTALL_COMMAND
4344
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --target install)
4445
ExternalProject_Get_Property(CoreFoundation install_dir)

CoreFoundation/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
cmake_minimum_required(VERSION 3.4.3)
33
list(APPEND CMAKE_MODULE_PATH
4-
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
4+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
5+
"${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules")
56

67
project(CoreFoundation
78
VERSION
@@ -352,6 +353,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL Android)
352353
target_include_directories(CoreFoundation
353354
PRIVATE
354355
${CURL_INCLUDE_DIRS})
356+
find_package(ICU COMPONENTS uc i18n REQUIRED)
357+
target_include_directories(CoreFoundation
358+
PRIVATE
359+
${ICU_INCLUDE_DIRS})
355360
else()
356361
target_include_directories(CoreFoundation
357362
PRIVATE

0 commit comments

Comments
 (0)