File tree Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 11#[=============================================================================[
22# FindICU
33
4- Find the ICU library.
5-
64See: https://cmake.org/cmake/help/latest/module/FindICU.html
75
86This module overrides the upstream CMake `FindICU` module with few
97customizations:
108
119* Added pkg-config.
12-
13- ## Usage
14-
15- ```cmake
16- # CMakeLists.txt
17- find_package(ICU)
18- ```
1910#]=============================================================================]
2011
2112include (FeatureSummary)
Original file line number Diff line number Diff line change @@ -96,6 +96,12 @@ function(php_feature_summary_preamble result)
9696
9797 get_property (enabledLanguages GLOBAL PROPERTY ENABLED_LANGUAGES )
9898 foreach (language IN ITEMS ${enabledLanguages} )
99+ if (language STREQUAL "CXX" )
100+ set (languageLabel "C++" )
101+ else ()
102+ set (languageLabel "${language} " )
103+ endif ()
104+
99105 # Add compiler info.
100106 if (CMAKE_${language} _COMPILER_LOADED)
101107 set (compiler "" )
@@ -112,7 +118,7 @@ function(php_feature_summary_preamble result)
112118 string (APPEND compiler "${CMAKE_${language} _COMPILER}" )
113119 endif ()
114120 php_feature_summary_preamble_add_item(
115- "${language } compiler"
121+ "${languageLabel } compiler"
116122 "${compiler} "
117123 preamble
118124 )
@@ -134,7 +140,7 @@ function(php_feature_summary_preamble result)
134140 string (APPEND linker "${CMAKE_${language} _COMPILER_LINKER}" )
135141 endif ()
136142 php_feature_summary_preamble_add_item(
137- "${language } linker"
143+ "${languageLabel } linker"
138144 "${linker} "
139145 preamble
140146 )
Original file line number Diff line number Diff line change @@ -190,7 +190,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
190190 )
191191endif ()
192192
193- find_package (ICU 50.1 COMPONENTS io uc i18n)
193+ if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
194+ find_package (ICU 50.1 COMPONENTS io uc in)
195+ else ()
196+ find_package (ICU 50.1 COMPONENTS io uc i18n)
197+ endif ()
198+
194199set_package_properties(
195200 ICU
196201 PROPERTIES
@@ -204,7 +209,10 @@ else()
204209 target_compile_features (php_ext_intl PRIVATE cxx_std_11)
205210endif ()
206211
207- target_link_libraries (php_ext_intl PRIVATE ICU::io ICU::uc ICU::i18n)
212+ target_link_libraries (
213+ php_ext_intl
214+ PRIVATE ICU::io ICU::uc $<IF:$<PLATFORM_ID:Windows>,ICU::in,ICU::i18n>
215+ )
208216
209217if (ICU_VERSION VERSION_GREATER_EQUAL 60)
210218 target_compile_definitions (php_ext_intl PRIVATE U_HIDE_OBSOLETE_UTF_OLD_H=1)
You can’t perform that action at this time.
0 commit comments