Skip to content

Commit 34cec97

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 9b3ba0d + 6ebc76e commit 34cec97

File tree

5 files changed

+24
-44
lines changed

5 files changed

+24
-44
lines changed

cmake/cmake/modules/FindICU.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ if(PKG_CONFIG_FOUND)
3737
endif()
3838
endif()
3939

40-
# Find package with upstream CMake module; override CMAKE_MODULE_PATH to prevent
41-
# the maximum nesting/recursion depth error on some systems, like macOS.
42-
set(_php_cmake_module_path ${CMAKE_MODULE_PATH})
43-
unset(CMAKE_MODULE_PATH)
44-
include(FindICU)
45-
set(CMAKE_MODULE_PATH ${_php_cmake_module_path})
46-
unset(_php_cmake_module_path)
40+
# Find package with upstream CMake find module. Absolute path prevents the
41+
# maximum nesting/recursion depth error on some systems, like macOS.
42+
include(${CMAKE_ROOT}/Modules/FindICU.cmake)
4743

4844
# Upstream CMake module doesn't mark these as advanced variables.
4945
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9199

cmake/cmake/modules/FindIconv.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ if(CMAKE_PREFIX_PATH OR Iconv_ROOT OR ICONV_ROOT)
4949
endif()
5050
endif()
5151

52-
# Find package with upstream CMake module; override CMAKE_MODULE_PATH to prevent
53-
# the maximum nesting/recursion depth error on some systems, like macOS.
54-
set(_php_cmake_module_path ${CMAKE_MODULE_PATH})
55-
unset(CMAKE_MODULE_PATH)
56-
include(FindIconv)
57-
set(CMAKE_MODULE_PATH ${_php_cmake_module_path})
58-
unset(_php_cmake_module_path)
52+
# Find package with upstream CMake find module. Absolute path prevents the
53+
# maximum nesting/recursion depth error on some systems, like macOS.
54+
include(${CMAKE_ROOT}/Modules/FindIconv.cmake)

cmake/cmake/modules/FindIntl.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ if(CMAKE_PREFIX_PATH OR Intl_ROOT OR INTL_ROOT)
3838
endif()
3939
endif()
4040

41-
# Find package with upstream CMake module; override CMAKE_MODULE_PATH to prevent
42-
# the maximum nesting/recursion depth error on some systems, like macOS.
43-
set(_php_cmake_module_path ${CMAKE_MODULE_PATH})
44-
unset(CMAKE_MODULE_PATH)
45-
include(FindIntl)
46-
set(CMAKE_MODULE_PATH ${_php_cmake_module_path})
47-
unset(_php_cmake_module_path)
41+
# Find package with upstream CMake find module. Absolute path prevents the
42+
# maximum nesting/recursion depth error on some systems, like macOS.
43+
include(${CMAKE_ROOT}/Modules/FindIntl.cmake)

cmake/cmake/modules/FindLibXslt.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ set_package_properties(
2121
DESCRIPTION "XSLT processor library"
2222
)
2323

24-
# Find package with upstream CMake module; override CMAKE_MODULE_PATH to prevent
25-
# the maximum nesting/recursion depth error on some systems, like macOS.
26-
set(_php_cmake_module_path ${CMAKE_MODULE_PATH})
27-
unset(CMAKE_MODULE_PATH)
28-
include(FindLibXslt)
29-
set(CMAKE_MODULE_PATH ${_php_cmake_module_path})
30-
unset(_php_cmake_module_path)
24+
# Find package with upstream CMake find module. Absolute path prevents the
25+
# maximum nesting/recursion depth error on some systems, like macOS.
26+
include(${CMAKE_ROOT}/Modules/FindLibXslt.cmake)
3127

3228
# Upstream CMake module doesn't mark these as advanced variables.
3329
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8807

docs/dependencies.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ project(PHP)
423423
find_package(Iconv)
424424
```
425425

426-
Create a module with the same name in your local project CMake modules
427-
directory. For example:
426+
Create a module with the same name in local project CMake modules directory. For
427+
example:
428428

429429
```cmake
430430
# cmake/modules/FindIconv.cmake
@@ -433,26 +433,22 @@ directory. For example:
433433
# example, adding search paths, changing initial values of the find module,
434434
# adding pkgconf/pkg-config functionality, and similar.
435435
436-
# Find package with upstream CMake module; override CMAKE_MODULE_PATH to prevent
437-
# the maximum nesting/recursion depth error on some systems, like macOS.
438-
set(_php_cmake_module_path ${CMAKE_MODULE_PATH})
439-
unset(CMAKE_MODULE_PATH)
440-
include(FindIconv)
441-
set(CMAKE_MODULE_PATH ${_php_cmake_module_path})
442-
unset(_php_cmake_module_path)
436+
# Find package with upstream CMake find module. Absolute path prevents the
437+
# maximum nesting/recursion depth error on some systems, like macOS.
438+
include(${CMAKE_ROOT}/Modules/FindIconv.cmake)
443439
444440
# Here, find module can be customized after including the upstream module. For
445441
# example, adding new result variables.
446442
```
447443

448-
With this, when calling the find_package(Iconv), the local FindIconv module will
449-
be used and the upstream CMake module will be included in it, making it possible
450-
to adjust code before and after the inclusion.
444+
With this, when calling the `find_package(Iconv)`, the local `FindIconv` module
445+
will be used and the upstream CMake module will be included in it, making it
446+
possible to adjust code before and after the inclusion.
451447

452-
Instead of calling `find_package()` inside a find module, the `include()` can be
453-
used and `CMAKE_MODULE_PATH` disabled. Otherwise, on some systems the maximum
454-
nesting/recursion depth error occurs because CMake will try to include the
455-
local FindIconv recursively.
448+
Instead of calling `find_package()` inside a find module, the `include()` is
449+
used with specific path to CMake modules. Otherwise, on some systems the maximum
450+
nesting/recursion depth error occurs because CMake will try to include the local
451+
`FindIconv` recursively.
456452

457453
### 4.2. FetchContent
458454

0 commit comments

Comments
 (0)