@@ -309,15 +309,53 @@ function(_php_main_create_files)
309309
310310 if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
311311 message (STATUS "Creating main/config.w32.h" )
312- configure_file (main/config.w32.cmake.h.in main/config.w32.h @ONLY)
312+ configure_file (
313+ main/config.w32.cmake.h.in
314+ main/CMakeFiles/config.w32.cmake.h.in
315+ @ONLY
316+ )
317+
318+ file (
319+ GENERATE
320+ # TODO: Multi-config generators need to write separate files.
321+ #OUTPUT $<CONFIG>/main/config.w32.h
322+ OUTPUT ${PHP_BINARY_DIR} /main/config.w32.h
323+ INPUT ${PHP_BINARY_DIR} /main/CMakeFiles/config.w32.cmake.h.in
324+ )
313325 else ()
314326 message (STATUS "Creating main/build-defs.h" )
315- configure_file (main/build -defs.h.in main/build -defs.h @ONLY)
327+ configure_file (
328+ main/build -defs.h.in
329+ main/CMakeFiles/build -defs.h.in
330+ @ONLY
331+ )
332+
333+ # To be able to evaluate the generator expressions.
334+ file (
335+ GENERATE
336+ # TODO: Multi-config generators need to write separate files.
337+ #OUTPUT $<CONFIG>/main/build-defs.h
338+ OUTPUT ${PHP_BINARY_DIR} /main/build -defs.h
339+ INPUT ${PHP_BINARY_DIR} /main/CMakeFiles/build -defs.h.in
340+ )
316341
317342 set (HAVE_BUILD_DEFS_H 1)
318343
319344 message (STATUS "Creating main/php_config.h" )
320- configure_file (main/php_config.cmake.h.in main/php_config.h @ONLY)
345+ configure_file (
346+ main/php_config.cmake.h.in
347+ main/CMakeFiles/php_config.cmake.h.in
348+ @ONLY
349+ )
350+
351+ # To be able to evaluate the generator expressions.
352+ file (
353+ GENERATE
354+ # TODO: Multi-config generators need to write separate files.
355+ #OUTPUT $<CONFIG>/main/php_config.h
356+ OUTPUT ${PHP_BINARY_DIR} /main/php_config.h
357+ INPUT ${PHP_BINARY_DIR} /main/CMakeFiles/php_config.cmake.h.in
358+ )
321359 endif ()
322360
323361 message (STATUS "Creating main/php_version.h" )
0 commit comments