@@ -17,14 +17,14 @@ Configure PEAR as part of the PHP installation.
1717
1818Install PEAR, PHP Extension and Application Repository package manager.
1919
20- ## PHP_PEAR_DIR
20+ ## PHP_PEAR_INSTALL_DIR
2121
2222:orange_circle: *Deprecated as of PHP 7.4.*
2323
2424* Default: `DATADIR/pear`
2525
26- The path where PEAR will be installed to. `CMAKE_INSTALL_PREFIX` is
27- automatically prepended when given as a relative path .
26+ The path where PEAR will be installed to. Relative path is interpreted as being
27+ relative to the `CMAKE_INSTALL_PREFIX` .
2828
2929## PHP_PEAR_TEMP_DIR
3030
@@ -33,18 +33,15 @@ automatically prepended when given as a relative path.
3333* Default: `tmp/pear` on \*nix and `temp/pear` on Windows
3434
3535The PEAR temporary directory where PEAR writes temporary files, such as cache,
36- downloaded packages artifacts and similar. Pass it as a relative path inside the
37- top level system directory, which will be automatically prepended. If given as
38- an absolute path, top level directory is not prepended. Relative path is added
39- to the top root system directory (`/` on \*nix, or `C:/` on Windows).
36+ downloaded packages artifacts and similar. Relative path is interpreted as being
37+ relative to the top root system directory (`/` on \*nix, or `C:/` on Windows).
4038
4139For example, default PEAR temporary directory after the top level system
42- directory is prepended becomes `/tmp/pear` on \*nix and `C:/temp/pear` on
43- Windows.
40+ directory is prepended becomes `/tmp/pear` on Unix-like systems and
41+ `C:/temp/pear` on Windows.
4442#]=============================================================================]
4543
4644include (FeatureSummary)
47- include (PHP/Set)
4845
4946option (
5047 PHP_PEAR
@@ -57,26 +54,39 @@ add_feature_info(
5754 "PHP Extension and Application Repository"
5855)
5956
60- php_set (
61- PHP_PEAR_DIR
62- TYPE PATH
63- IF PHP_PEAR
57+ set (
58+ CACHE {PHP_PEAR_INSTALL_DIR}
59+ TYPE STRING
60+ HELP "The PEAR installation directory"
6461 VALUE "${CMAKE_INSTALL_DATADIR} /pear"
65- DOC "The PEAR installation directory"
6662)
67- mark_as_advanced (PHP_PEAR_DIR)
63+ mark_as_advanced (PHP_PEAR_INSTALL_DIR)
64+
65+ block()
66+ if (NOT PHP_PEAR)
67+ set (value "" )
68+ else ()
69+ set (value "${PHP_PEAR_INSTALL_DIR} " )
70+ endif ()
71+
72+ set (
73+ CACHE {PHP_PEAR_INSTALL_DIR_VALUE}
74+ TYPE INTERNAL
75+ HELP "Internal storage buffer for the PEAR installation directory value"
76+ VALUE ${value}
77+ )
78+ endblock()
6879
6980if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
7081 set (tmp_dir "temp/pear" )
7182else ()
7283 set (tmp_dir "tmp/pear" )
7384endif ()
74- php_set (
75- PHP_PEAR_TEMP_DIR
76- TYPE PATH
77- IF PHP_PEAR
85+ set (
86+ CACHE { PHP_PEAR_TEMP_DIR}
87+ TYPE STRING
88+ HELP "The PEAR temporary directory. Default: ${tmp_dir} "
7889 VALUE "${tmp_dir} "
79- DOC "The PEAR temporary directory. Default: ${tmp_dir} "
8090)
8191mark_as_advanced (PHP_PEAR_TEMP_DIR)
8292
@@ -128,7 +138,7 @@ elseif(CMAKE_CROSSCOMPILING AND CMAKE_CROSSCOMPILING_EMULATOR)
128138endif ()
129139
130140string (CONFIGURE [[
131- set(php_pear_install_dir "$<PATH:ABSOLUTE_PATH,NORMALIZE,@PHP_PEAR_DIR @,${CMAKE_INSTALL_PREFIX}>")
141+ set(php_pear_install_dir "$<PATH:ABSOLUTE_PATH,NORMALIZE,@PHP_PEAR_INSTALL_DIR_VALUE @,${CMAKE_INSTALL_PREFIX}>")
132142 set(php_pear_install_bin_dir "$<PATH:ABSOLUTE_PATH,NORMALIZE,@CMAKE_INSTALL_BINDIR@,${CMAKE_INSTALL_PREFIX}>")
133143 set(php_pear_current_source_dir "@CMAKE_CURRENT_SOURCE_DIR@")
134144 set(php_pear_current_binary_dir "@CMAKE_CURRENT_BINARY_DIR@")
0 commit comments