@@ -48,18 +48,6 @@ mark_as_advanced(PHP_BUILD_COMPILER)
4848set (PHP_BUILD_PROVIDER ""  CACHE  STRING  "Build provider displayed in phpinfo" )
4949mark_as_advanced (PHP_BUILD_PROVIDER)
5050
51- set (
52-   PHP_LAYOUT "PHP" 
53-   CACHE  STRING 
54-   "Set how installed files will be laid out. Type can be PHP (default) or GNU" 
55- )
56- set_property (CACHE  PHP_LAYOUT PROPERTY STRINGS  "GNU"  "PHP" )
57- mark_as_advanced (PHP_LAYOUT)
58- 
59- if (NOT  PHP_LAYOUT STREQUAL  "GNU" )
60-   # TODO: DATAROOTDIR should be "php" instead of default "share". 
61- endif ()
62- 
6351set (
6452  PHP_INCLUDE_PREFIX "php" 
6553  CACHE  STRING 
@@ -98,24 +86,17 @@ endif()
9886if (NOT  CMAKE_SYSTEM_NAME  STREQUAL  "Windows" )
9987  set (
10088    PHP_CONFIG_FILE_PATH "" 
101-     CACHE  FILEPATH  "The path in which to look for php.ini; By default it is set \  
102-     to sysconfdir (for GNU layout) or libdir (for PHP layout); Pass it as a \  
103-     relative string inside the install prefix, which will be automatically \  
104-     prepended; If given as an absolute path, prefix is  not appended." 
89+     CACHE  FILEPATH  "The path in which to look for php.ini; By default,  it is\  
90+     set  to SYSCONFDIR (etc); Relative path gets the CMAKE_INSTALL_PREFIX \  
91+     automatically prepended; If given as an absolute path, install prefix is \  
92+     not appended." 
10593  )
10694  mark_as_advanced (PHP_CONFIG_FILE_PATH)
10795  if (NOT  PHP_CONFIG_FILE_PATH)
108-     if (PHP_LAYOUT STREQUAL  "GNU" )
109-       set_property (
110-         CACHE  PHP_CONFIG_FILE_PATH
111-         PROPERTY VALUE  "${CMAKE_INSTALL_SYSCONFDIR} " 
112-       )
113-     else ()
114-       set_property (
115-         CACHE  PHP_CONFIG_FILE_PATH
116-         PROPERTY VALUE  "${CMAKE_INSTALL_LIBDIR} " 
117-       )
118-     endif ()
96+     set_property (
97+       CACHE  PHP_CONFIG_FILE_PATH
98+       PROPERTY VALUE  "${CMAKE_INSTALL_SYSCONFDIR} " 
99+     )
119100  endif ()
120101  set (
121102    PHP_FULL_CONFIG_FILE_PATH ""  CACHE  INTERNAL 
@@ -226,16 +207,15 @@ block()
226207
227208    set (extension_dir "${CMAKE_INSTALL_LIBDIR} /php" )
228209
229-     if (PHP_LAYOUT STREQUAL  "GNU" )
230-       set (extension_dir "${extension_dir} /${zend_module_api_no} " )
231-       set (extension_dir "${extension_dir} $<$<BOOL:$<TARGET_PROPERTY:php_configuration,PHP_THREAD_SAFETY>>:-zts>" )
232-       set (extension_dir "${extension_dir} $<IF:$<CONFIG:Debug,DebugAssertions>,-debug,>" )
233-     else ()
234-       set (extension_dir "${extension_dir} /extensions" )
235-       set (extension_dir "${extension_dir} /$<IF:$<CONFIG:Debug,DebugAssertions>,debug,no-debug>" )
236-       set (extension_dir "${extension_dir} $<IF:$<BOOL:$<TARGET_PROPERTY:php_configuration,PHP_THREAD_SAFETY>>,-zts,-non-zts>" )
237-       set (extension_dir "${extension_dir} -${zend_module_api_no} " )
238-     endif ()
210+     # This resembles the PHP Autotools --with-layout=GNU: 
211+     set (extension_dir "${extension_dir} /${zend_module_api_no} " )
212+     set (extension_dir "${extension_dir} $<$<BOOL:$<TARGET_PROPERTY:php_configuration,PHP_THREAD_SAFETY>>:-zts>" )
213+     set (extension_dir "${extension_dir} $<$<CONFIG:Debug,DebugAssertions>:-debug>" )
214+     # This would be the PHP Autotools --with-layout=PHP (default): 
215+     # set(extension_dir "${extension_dir}/extensions") 
216+     # set(extension_dir "${extension_dir}/$<IF:$<CONFIG:Debug,DebugAssertions>,debug,no-debug>") 
217+     # set(extension_dir "${extension_dir}$<IF:$<BOOL:$<TARGET_PROPERTY:php_configuration,PHP_THREAD_SAFETY>>,-zts,-non-zts>") 
218+     # set(extension_dir "${extension_dir}-${zend_module_api_no}") 
239219
240220    set_property (CACHE  PHP_EXTENSION_DIR PROPERTY VALUE  "${extension_dir} " )
241221  endif ()
0 commit comments