diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7799b145..320aea1c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -63,7 +63,6 @@ jobs: libcurl4-openssl-dev \ libdb5.3++-dev \ libenchant-2-dev \ - libpng-dev \ libgmp-dev \ libc-client-dev \ libkrb5-dev \ @@ -79,13 +78,11 @@ jobs: firebird-dev \ libsodium-dev \ libicu-dev \ - libzip-dev \ aspell \ libaspell-dev \ libavif-dev \ libwebp-dev \ libxpm-dev \ - libonig-dev \ libtidy-dev \ libargon2-dev \ libxslt1-dev \ @@ -107,7 +104,6 @@ jobs: libsasl2-dev \ libpq-dev \ libmm-dev \ - zlib1g-dev \ libdmalloc-dev \ dovecot-core \ dovecot-pop3d \ diff --git a/cmake/cmake/Configuration.cmake b/cmake/cmake/Configuration.cmake index e22410ae..084f986e 100644 --- a/cmake/cmake/Configuration.cmake +++ b/cmake/cmake/Configuration.cmake @@ -205,9 +205,6 @@ set(PHP_SQLITE_MIN_VERSION 3.7.7) # Minimum required version for the PostgreSQL dependency. set(PHP_POSTGRESQL_MIN_VERSION 9.1) -# Minimum required version for the zlib dependency. -set(PHP_ZLIB_MIN_VERSION 1.2.0.4) - # Additional metadata for external packages to avoid duplication. set_package_properties( BZip2 @@ -251,13 +248,6 @@ set_package_properties( DESCRIPTION "SQL database engine library" ) -set_package_properties( - ZLIB - PROPERTIES - URL "https://zlib.net/" - DESCRIPTION "Compression library" -) - # Set base directory for ExternalProject CMake module. set_directory_properties( PROPERTIES EP_BASE ${PHP_BINARY_DIR}/CMakeFiles/PHP/ExternalProject diff --git a/cmake/cmake/modules/PHP/Package/LibXml2.cmake b/cmake/cmake/modules/PHP/Package/LibXml2.cmake new file mode 100644 index 00000000..0ab3c32f --- /dev/null +++ b/cmake/cmake/modules/PHP/Package/LibXml2.cmake @@ -0,0 +1,112 @@ +#[=============================================================================[ +# PHP/Package/LibXml2 + +Finds and downloads the `libxml2` library: + +```cmake +include(PHP/Package/LibXml2) +``` + +This module first tries to find the `libxml2` library on the system. If not +successful it tries to download it from the upstream source with +`ExternalProject` module and build it together with the PHP build. + +See: https://cmake.org/cmake/help/latest/module/FindLibXml2.html + +## Examples + +Basic usage: + +```cmake +# CMakeLists.txt +include(PHP/Package/LibXml2) +target_link_libraries(example PRIVATE LibXml2::LibXml2) +``` +#]=============================================================================] + +include(FeatureSummary) +include(ExternalProject) + +set_package_properties( + LibXml2 + PROPERTIES + URL "https://gitlab.gnome.org/GNOME/libxml2" + DESCRIPTION "XML parser and toolkit" +) + +# Minimum required version for the libxml2 dependency. +set(PHP_LIBXML2_MIN_VERSION 2.9.0) + +# Download version when system dependency is not found. +set(PHP_LIBXML2_DOWNLOAD_VERSION 2.14.4) + +if(TARGET LibXml2::LibXml2) + set(LibXml2_FOUND TRUE) + get_property(LibXml2_DOWNLOADED GLOBAL PROPERTY _PHP_LibXml2_DOWNLOADED) + return() +endif() + +find_package(LibXml2 ${PHP_LIBXML2_MIN_VERSION}) + +if(NOT LibXml2_FOUND) + message( + STATUS + "LibXml2 ${PHP_LIBXML2_DOWNLOAD_VERSION} will be downloaded at build phase" + ) + + include(PHP/Package/ZLIB) + + set(options "-DCMAKE_INSTALL_PREFIX=") + list(APPEND options -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_LZMA=OFF) + + ExternalProject_Add( + LibXml2 + STEP_TARGETS build install + URL + https://github.com/GNOME/libxml2/archive/refs/tags/v${PHP_LIBXML2_DOWNLOAD_VERSION}.tar.gz + CMAKE_ARGS ${options} + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libxml2-installation + INSTALL_BYPRODUCTS /lib/libxml2${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + + add_dependencies(LibXml2 ZLIB::ZLIB) + + # Move dependency to PACKAGES_FOUND. + block() + set(package "LibXml2") + get_property(packagesNotFound GLOBAL PROPERTY PACKAGES_NOT_FOUND) + list(REMOVE_ITEM packagesNotFound ${package}) + set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND ${packagesNotFound}) + get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND) + list(FIND packagesFound ${package} found) + if(found EQUAL -1) + set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND ${package}) + endif() + endblock() + + ExternalProject_Get_Property(LibXml2 INSTALL_DIR) + + # Bypass issue with non-existing include directory for the imported target. + file(MAKE_DIRECTORY ${INSTALL_DIR}/include) + + add_library(LibXml2::LibXml2 STATIC IMPORTED GLOBAL) + set_target_properties( + LibXml2::LibXml2 + PROPERTIES + IMPORTED_LOCATION "${INSTALL_DIR}/lib/libxml2${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include" + ) + add_dependencies(LibXml2::LibXml2 LibXml2-install) + + # Mark package as found. + set(LibXml2_FOUND TRUE) + + define_property( + GLOBAL + PROPERTY _PHP_LibXml2_DOWNLOADED + BRIEF_DOCS "Marker that LibXml2 library will be downloaded" + ) + + set_property(GLOBAL PROPERTY _PHP_LibXml2_DOWNLOADED TRUE) + set(LibXml2_DOWNLOADED TRUE) +endif() diff --git a/cmake/cmake/modules/PHP/Package/Oniguruma.cmake b/cmake/cmake/modules/PHP/Package/Oniguruma.cmake new file mode 100644 index 00000000..9fac79cb --- /dev/null +++ b/cmake/cmake/modules/PHP/Package/Oniguruma.cmake @@ -0,0 +1,110 @@ +#[=============================================================================[ +# PHP/Package/Oniguruma + +Finds or downloads the Oniguruma library: + +```cmake +include(PHP/Package/Oniguruma) +``` + +Wrapper for finding the `Oniguruma` library. + +Module first tries to find the `Oniguruma` library on the system. If not +successful it tries to download it from the upstream source with +`ExternalProject` module and build it together with the PHP build. + +## Examples + +Basic usage: + +```cmake +include(PHP/Package/Oniguruma) +target_link_libraries(php_ext_foo PRIVATE Oniguruma::Oniguruma) +``` +#]=============================================================================] + +include(ExternalProject) +include(FeatureSummary) + +# Minimum required version for the Oniguruma dependency. +#set(PHP_ONIGURUMA_MIN_VERSION ?.?.??) + +# Download version when system dependency is not found. +set(PHP_ONIGURUMA_DOWNLOAD_VERSION 6.9.10) + +if(TARGET Oniguruma::Oniguruma) + set(Oniguruma_FOUND TRUE) + get_property(Oniguruma_DOWNLOADED GLOBAL PROPERTY _PHP_Oniguruma_DOWNLOADED) + set(PHP_ONIG_KOI8 FALSE) + return() +endif() + +find_package(Oniguruma ${PHP_ONIGURUMA_MIN_VERSION}) + +if(NOT Oniguruma_FOUND) + message( + STATUS + "Oniguruma ${PHP_ONIGURUMA_DOWNLOAD_VERSION} will be downloaded at build phase" + ) + + set(options "-DCMAKE_INSTALL_PREFIX=") + + list( + APPEND + options + -DINSTALL_DOCUMENTATION=OFF + -DBUILD_TEST=OFF + -DBUILD_SHARED_LIBS=OFF + ) + + ExternalProject_Add( + Oniguruma + STEP_TARGETS build install + URL + https://github.com/petk/oniguruma/archive/refs/tags/v${PHP_ONIGURUMA_DOWNLOAD_VERSION}.tar.gz + CMAKE_ARGS ${options} + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/oniguruma-installation + INSTALL_BYPRODUCTS /lib/libonig${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + + # Move dependency to PACKAGES_FOUND. + block() + set(package "Oniguruma") + get_property(packagesNotFound GLOBAL PROPERTY PACKAGES_NOT_FOUND) + list(REMOVE_ITEM packagesNotFound ${package}) + set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND ${packagesNotFound}) + get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND) + list(FIND packagesFound ${package} found) + if(found EQUAL -1) + set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND ${package}) + endif() + endblock() + + ExternalProject_Get_Property(Oniguruma INSTALL_DIR) + + # Bypass issue with non-existing include directory for the imported target. + file(MAKE_DIRECTORY ${INSTALL_DIR}/include) + + add_library(Oniguruma::Oniguruma STATIC IMPORTED GLOBAL) + set_target_properties( + Oniguruma::Oniguruma + PROPERTIES + IMPORTED_LOCATION "${INSTALL_DIR}/lib/libonig${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include" + ) + add_dependencies(Oniguruma::Oniguruma Oniguruma-install) + + # Mark package as found. + set(Oniguruma_FOUND TRUE) + + define_property( + GLOBAL + PROPERTY _PHP_Oniguruma_DOWNLOADED + BRIEF_DOCS "Marker that Oniguruma library will be downloaded" + ) + + set_property(GLOBAL PROPERTY _PHP_Oniguruma_DOWNLOADED TRUE) + set(Oniguruma_DOWNLOADED TRUE) + + set(PHP_ONIG_KOI8 FALSE) +endif() diff --git a/cmake/cmake/modules/PHP/Package/PNG.cmake b/cmake/cmake/modules/PHP/Package/PNG.cmake new file mode 100644 index 00000000..1ef9ef89 --- /dev/null +++ b/cmake/cmake/modules/PHP/Package/PNG.cmake @@ -0,0 +1,104 @@ +#[=============================================================================[ +# PHP/Package/PNG + +Finds or downloads the PNG library: + +```cmake +include(PHP/Package/PNG) +``` + +Wrapper for finding the `PNG` library. + +Module first tries to find the `PNG` library on the system. If not +successful it tries to download it from the upstream source with +`ExternalProject` module and build it together with the PHP build. + +See: https://cmake.org/cmake/help/latest/module/FindPNG.html + +## Examples + +Basic usage: + +```cmake +include(PHP/Package/PNG) +target_link_libraries(php_ext_foo PRIVATE PNG::PNG) +``` +#]=============================================================================] + +include(ExternalProject) +include(FeatureSummary) + +set_package_properties( + PNG + PROPERTIES + URL "http://libpng.org" + DESCRIPTION "Portable Network Graphics (PNG image format) library" +) + +# Minimum required version for the PNG dependency. +set(PHP_PNG_MIN_VERSION 0.96) # for png_get_IHDR + +# Download version when system dependency is not found. +set(PHP_PNG_DOWNLOAD_VERSION 1.6.50) + +find_package(PNG ${PHP_PNG_MIN_VERSION}) + +if(NOT PNG_FOUND) + message( + STATUS + "PNG ${PHP_PNG_DOWNLOAD_VERSION} will be downloaded at build phase" + ) + + include(PHP/Package/ZLIB) + + set(options "-DCMAKE_INSTALL_PREFIX=") + + if(ZLIB_DOWNLOADED) + ExternalProject_Get_Property(ZLIB INSTALL_DIR) + list(APPEND options "-DCMAKE_PREFIX_PATH=${INSTALL_DIR}") + endif() + + list(APPEND options -DPNG_TESTS=OFF) + + ExternalProject_Add( + PNG + STEP_TARGETS build install + URL + https://download.sourceforge.net/libpng/libpng-${PHP_PNG_DOWNLOAD_VERSION}.tar.gz + CMAKE_ARGS ${options} + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/png-installation + INSTALL_BYPRODUCTS /lib/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + + add_dependencies(PNG ZLIB::ZLIB) + + # Move dependency to PACKAGES_FOUND. + block() + set(package "PNG") + get_property(packagesNotFound GLOBAL PROPERTY PACKAGES_NOT_FOUND) + list(REMOVE_ITEM packagesNotFound ${package}) + set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND ${packagesNotFound}) + get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND) + list(FIND packagesFound ${package} found) + if(found EQUAL -1) + set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND ${package}) + endif() + endblock() + + ExternalProject_Get_Property(PNG INSTALL_DIR) + + # Bypass issue with non-existing include directory for the imported target. + file(MAKE_DIRECTORY ${INSTALL_DIR}/include) + + add_library(PNG::PNG STATIC IMPORTED GLOBAL) + set_target_properties( + PNG::PNG + PROPERTIES + IMPORTED_LOCATION "${INSTALL_DIR}/lib/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include" + ) + add_dependencies(PNG::PNG PNG-install) + + # Mark package as found. + set(PNG_FOUND TRUE) +endif() diff --git a/cmake/cmake/modules/PHP/Package/ZLIB.cmake b/cmake/cmake/modules/PHP/Package/ZLIB.cmake new file mode 100644 index 00000000..f72275ef --- /dev/null +++ b/cmake/cmake/modules/PHP/Package/ZLIB.cmake @@ -0,0 +1,115 @@ +#[=============================================================================[ +# PHP/Package/Zlib + +Finds or downloads the zlib library: + +```cmake +include(PHP/Package/Zlib) +``` + +This module is a wrapper for finding the `ZLIB` library. It first tries to find +the `ZLIB` library on the system. If not successful it tries to download it from +the upstream source with `ExternalProject` module and builds it together with +the PHP build. + +See: https://cmake.org/cmake/help/latest/module/FindZLIB.html + +## Examples + +Basic usage: + +```cmake +include(PHP/Package/ZLIB) +target_link_libraries(php_ext_foo PRIVATE ZLIB::ZLIB) +``` +#]=============================================================================] + +include(FeatureSummary) +include(ExternalProject) + +set_package_properties( + ZLIB + PROPERTIES + URL "https://zlib.net/" + DESCRIPTION "Compression library" +) + +# Minimum required version for the zlib dependency. +set(PHP_ZLIB_MIN_VERSION 1.2.0.4) + +# Download version when system dependency is not found. +set(PHP_ZLIB_DOWNLOAD_VERSION 1.3.1) + +if(TARGET ZLIB::ZLIB) + set(ZLIB_FOUND TRUE) + get_property(ZLIB_DOWNLOADED GLOBAL PROPERTY _PHP_ZLIB_DOWNLOADED) + return() +endif() + +find_package(ZLIB ${PHP_ZLIB_MIN_VERSION}) + +if(NOT ZLIB_FOUND) + message( + STATUS + "ZLIB ${PHP_ZLIB_DOWNLOAD_VERSION} will be downloaded at build phase" + ) + + set(options "-DCMAKE_INSTALL_PREFIX=") + + if(PHP_ZLIB_DOWNLOAD_VERSION VERSION_LESS_EQUAL 1.3.1) + list(APPEND options -DZLIB_BUILD_EXAMPLES=OFF) + endif() + + if(PHP_ZLIB_DOWNLOAD_VERSION VERSION_GREATER 1.3.1) + list(APPEND options -DZLIB_BUILD_TESTING=OFF) + endif() + + ExternalProject_Add( + ZLIB + STEP_TARGETS build install + URL + https://github.com/madler/zlib/releases/download/v${PHP_ZLIB_DOWNLOAD_VERSION}/zlib-${PHP_ZLIB_DOWNLOAD_VERSION}.tar.gz + CMAKE_ARGS ${options} + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/zlib-installation + INSTALL_BYPRODUCTS /lib/libz${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + + # Move dependency to PACKAGES_FOUND. + block() + set(package "ZLIB") + get_property(packagesNotFound GLOBAL PROPERTY PACKAGES_NOT_FOUND) + list(REMOVE_ITEM packagesNotFound ${package}) + set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND ${packagesNotFound}) + get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND) + list(FIND packagesFound ${package} found) + if(found EQUAL -1) + set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND ${package}) + endif() + endblock() + + ExternalProject_Get_Property(ZLIB INSTALL_DIR) + + # Bypass issue with non-existing include directory for the imported target. + file(MAKE_DIRECTORY ${INSTALL_DIR}/include) + + add_library(ZLIB::ZLIB STATIC IMPORTED GLOBAL) + set_target_properties( + ZLIB::ZLIB + PROPERTIES + IMPORTED_LOCATION "${INSTALL_DIR}/lib/libz${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include" + ) + add_dependencies(ZLIB::ZLIB ZLIB-install) + + # Mark package as found. + set(ZLIB_FOUND TRUE) + + define_property( + GLOBAL + PROPERTY _PHP_ZLIB_DOWNLOADED + BRIEF_DOCS "Marker that zlib library will be downloaded" + ) + + set_property(GLOBAL PROPERTY _PHP_ZLIB_DOWNLOADED TRUE) + set(ZLIB_DOWNLOADED TRUE) +endif() diff --git a/cmake/cmake/modules/PHP/Package/libzip.cmake b/cmake/cmake/modules/PHP/Package/libzip.cmake new file mode 100644 index 00000000..bb0f06d1 --- /dev/null +++ b/cmake/cmake/modules/PHP/Package/libzip.cmake @@ -0,0 +1,93 @@ +#[=============================================================================[ +# PHP/Package/libzip + +Finds and downloads `libzip` library: + +```cmake +include(PHP/Package/libzip +``` + +This module first tries to find the `libzip` library on the system. If not +successful it tries to download it from the upstream source with +`ExternalProject` module and build it together with the PHP build. + +## Examples + +Basic usage: + +```cmake +include(PHP/Package/libzip +target_link_libraries(php_ext_foo PRIVATE libzip::libzip) +``` +#]=============================================================================] + +include(FeatureSummary) +include(FetchContent) + +set_package_properties( + libzip + PROPERTIES + URL "https://libzip.org/" + DESCRIPTION "Library for reading and writing ZIP compressed archives" +) + +# Minimum required version for the libzip dependency. +set(PHP_libzip_MIN_VERSION 1.7.1) + +# Download version when system dependency is not found. +set(PHP_libzip_DOWNLOAD_VERSION 1.11.4) + +find_package(libzip ${PHP_libzip_MIN_VERSION}) + +if(NOT libzip_FOUND) + include(PHP/Package/ZLIB) + + set(options "-DCMAKE_INSTALL_PREFIX=") + + if(ZLIB_DOWNLOADED) + ExternalProject_Get_Property(ZLIB INSTALL_DIR) + list(APPEND options "-DCMAKE_PREFIX_PATH=${INSTALL_DIR}") + endif() + + ExternalProject_Add( + libzip + STEP_TARGETS build install + URL + https://github.com/nih-at/libzip/releases/download/v${PHP_libzip_DOWNLOAD_VERSION}/libzip-${PHP_libzip_DOWNLOAD_VERSION}.tar.gz + CMAKE_ARGS ${options} + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzip-installation + INSTALL_BYPRODUCTS /lib/libzip${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + + add_dependencies(libzip ZLIB::ZLIB) + + # Move dependency to PACKAGES_FOUND. + block() + set(package "libzip") + get_property(packagesNotFound GLOBAL PROPERTY PACKAGES_NOT_FOUND) + list(REMOVE_ITEM packagesNotFound ${package}) + set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND ${packagesNotFound}) + get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND) + list(FIND packagesFound ${package} found) + if(found EQUAL -1) + set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND ${package}) + endif() + endblock() + + ExternalProject_Get_Property(libzip INSTALL_DIR) + + # Bypass issue with non-existing include directory for the imported target. + file(MAKE_DIRECTORY ${INSTALL_DIR}/include) + + add_library(libzip::libzip STATIC IMPORTED GLOBAL) + set_target_properties( + libzip::libzip + PROPERTIES + IMPORTED_LOCATION "${INSTALL_DIR}/lib/libzip${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include" + ) + add_dependencies(libzip::libzip libzip-install) + + # Mark package as found. + set(libzip_FOUND TRUE) +endif() diff --git a/cmake/cmake/modules/Packages/LibXml2.cmake b/cmake/cmake/modules/Packages/LibXml2.cmake deleted file mode 100644 index a940fe55..00000000 --- a/cmake/cmake/modules/Packages/LibXml2.cmake +++ /dev/null @@ -1,79 +0,0 @@ -#[=============================================================================[ -# Packages/LibXml2 - -Wrapper for finding the `libxml2` library. - -Module first tries to find the `libxml2` library on the system. If not -successful it tries to download it from the upstream source with `FetchContent` -module and build it together with the PHP build. - -See: https://cmake.org/cmake/help/latest/module/FindLibXml2.html - -The `FetchContent` CMake module does things differently compared to the -`find_package()` flow: -* By default, it uses `QUIET` in its `find_package()` call when calling the - `FetchContent_MakeAvailable()`; -* When using `FeatureSummary`, dependencies must be moved manually to - `PACKAGES_FOUND` from the `PACKAGES_NOT_FOUND` global property; - -TODO: Improve this. This is for now only initial `FetchContent` integration for -testing purposes and will be changed in the future. - -## Usage - -```cmake -# CMakeLists.txt -include(Packages/LibXml2) -``` -#]=============================================================================] - -include(FeatureSummary) -include(FetchContent) - -set_package_properties( - LibXml2 - PROPERTIES - URL "https://gitlab.gnome.org/GNOME/libxml2" - DESCRIPTION "XML parser and toolkit" -) - -# Minimum required version for the libxml2 dependency. -set(PHP_LIBXML2_MIN_VERSION 2.9.0) - -# Download version when system dependency is not found. -set(PHP_LIBXML2_DOWNLOAD_VERSION 2.14.4) - -FetchContent_Declare( - LibXml2 - URL https://github.com/GNOME/libxml2/archive/refs/tags/v${PHP_LIBXML2_DOWNLOAD_VERSION}.tar.gz - EXCLUDE_FROM_ALL - SYSTEM - FIND_PACKAGE_ARGS -) - -find_package(LibXml2 ${PHP_LIBXML2_MIN_VERSION}) - -if(NOT LibXml2_FOUND) - set(FETCHCONTENT_QUIET NO) - set(LIBXML2_WITH_PYTHON OFF) - set(LIBXML2_WITH_LZMA OFF) - - FetchContent_MakeAvailable(LibXml2) - - # Move dependency to PACKAGES_FOUND. - block() - get_property(packagesNotFound GLOBAL PROPERTY PACKAGES_NOT_FOUND) - list(REMOVE_ITEM packagesNotFound LibXml2) - set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND ${packagesNotFound}) - get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND) - set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND LibXml2) - endblock() - - # Mark package as found. - set(LibXml2_FOUND TRUE) - - # Clean used variables. - unset(FETCHCONTENT_QUIET) - unset(LIBXML2_WITH_PYTHON) - unset(LIBXML2_WITH_LZMA) -endif() diff --git a/cmake/ext/dom/CMakeLists.txt b/cmake/ext/dom/CMakeLists.txt index a156fbf2..eb08a403 100644 --- a/cmake/ext/dom/CMakeLists.txt +++ b/cmake/ext/dom/CMakeLists.txt @@ -95,7 +95,7 @@ target_compile_definitions( $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>>:LIBXML_STATIC> ) -include(Packages/LibXml2) +include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/gd/CMakeLists.txt b/cmake/ext/gd/CMakeLists.txt index fa679d05..6a94f293 100644 --- a/cmake/ext/gd/CMakeLists.txt +++ b/cmake/ext/gd/CMakeLists.txt @@ -316,7 +316,7 @@ if(NOT PHP_EXT_GD_EXTERNAL) ) endif() - find_package(ZLIB ${PHP_ZLIB_MIN_VERSION}) + include(PHP/Package/ZLIB) set_package_properties( ZLIB PROPERTIES @@ -326,7 +326,7 @@ if(NOT PHP_EXT_GD_EXTERNAL) target_link_libraries(php_ext_gd PRIVATE ZLIB::ZLIB) - find_package(PNG) + include(PHP/Package/PNG) set_package_properties( PNG PROPERTIES diff --git a/cmake/ext/libxml/CMakeLists.txt b/cmake/ext/libxml/CMakeLists.txt index 5388f018..f3c43312 100644 --- a/cmake/ext/libxml/CMakeLists.txt +++ b/cmake/ext/libxml/CMakeLists.txt @@ -64,7 +64,7 @@ target_compile_definitions( $<$:LIBXML_STATIC;LIBXML_STATIC_FOR_DLL> ) -include(Packages/LibXml2) +include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/mbstring/CMakeLists.txt b/cmake/ext/mbstring/CMakeLists.txt index 9921fc42..65bb5a14 100644 --- a/cmake/ext/mbstring/CMakeLists.txt +++ b/cmake/ext/mbstring/CMakeLists.txt @@ -130,7 +130,7 @@ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libmbfl/config.h "\n" [[ ################################################################################ if(PHP_EXT_MBSTRING_MBREGEX) - find_package(Oniguruma) + include(PHP/Package/Oniguruma) set_package_properties( Oniguruma PROPERTIES diff --git a/cmake/ext/mysqlnd/CMakeLists.txt b/cmake/ext/mysqlnd/CMakeLists.txt index 6edf8a18..7b80d15c 100644 --- a/cmake/ext/mysqlnd/CMakeLists.txt +++ b/cmake/ext/mysqlnd/CMakeLists.txt @@ -170,7 +170,7 @@ target_link_libraries( ) if(PHP_EXT_MYSQLND_COMPRESSION) - find_package(ZLIB ${PHP_ZLIB_MIN_VERSION}) + include(PHP/Package/ZLIB) set_package_properties( ZLIB PROPERTIES diff --git a/cmake/ext/simplexml/CMakeLists.txt b/cmake/ext/simplexml/CMakeLists.txt index 957dcbf9..37b24940 100644 --- a/cmake/ext/simplexml/CMakeLists.txt +++ b/cmake/ext/simplexml/CMakeLists.txt @@ -78,7 +78,7 @@ target_compile_definitions( add_dependencies(php_ext_simplexml php_ext_libxml php_ext_spl) -include(Packages/LibXml2) +include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/soap/CMakeLists.txt b/cmake/ext/soap/CMakeLists.txt index 6864b649..c86341b0 100644 --- a/cmake/ext/soap/CMakeLists.txt +++ b/cmake/ext/soap/CMakeLists.txt @@ -76,7 +76,7 @@ target_compile_definitions( $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>>:LIBXML_STATIC> ) -include(Packages/LibXml2) +include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/xml/CMakeLists.txt b/cmake/ext/xml/CMakeLists.txt index 76c61fb0..e90fbc5c 100644 --- a/cmake/ext/xml/CMakeLists.txt +++ b/cmake/ext/xml/CMakeLists.txt @@ -109,7 +109,7 @@ if(NOT PHP_EXT_XML_EXPAT) $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>>:LIBXML_STATIC> ) - include(Packages/LibXml2) + include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/xmlreader/CMakeLists.txt b/cmake/ext/xmlreader/CMakeLists.txt index a8cb78b4..6fbc622b 100644 --- a/cmake/ext/xmlreader/CMakeLists.txt +++ b/cmake/ext/xmlreader/CMakeLists.txt @@ -70,7 +70,7 @@ target_compile_definitions( $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>>:LIBXML_STATIC> ) -include(Packages/LibXml2) +include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/xmlwriter/CMakeLists.txt b/cmake/ext/xmlwriter/CMakeLists.txt index fae036c0..de51829c 100644 --- a/cmake/ext/xmlwriter/CMakeLists.txt +++ b/cmake/ext/xmlwriter/CMakeLists.txt @@ -70,7 +70,7 @@ target_compile_definitions( $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>>:LIBXML_STATIC> ) -include(Packages/LibXml2) +include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/xsl/CMakeLists.txt b/cmake/ext/xsl/CMakeLists.txt index f3ec6856..d49ca7f7 100644 --- a/cmake/ext/xsl/CMakeLists.txt +++ b/cmake/ext/xsl/CMakeLists.txt @@ -82,7 +82,7 @@ if(MSVC) ) endif() -include(Packages/LibXml2) +include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/zend_test/CMakeLists.txt b/cmake/ext/zend_test/CMakeLists.txt index 63e11688..9dcb1f6d 100644 --- a/cmake/ext/zend_test/CMakeLists.txt +++ b/cmake/ext/zend_test/CMakeLists.txt @@ -82,7 +82,7 @@ target_compile_definitions( # If libxml extension is enabled, link libxml library as headers are used. # TODO: Reconfigure this for static/shared LibXml library on Windows. if(PHP_EXT_LIBXML) - include(Packages/LibXml2) + include(PHP/Package/LibXml2) set_package_properties( LibXml2 diff --git a/cmake/ext/zip/CMakeLists.txt b/cmake/ext/zip/CMakeLists.txt index 3654e9d5..68bc1459 100644 --- a/cmake/ext/zip/CMakeLists.txt +++ b/cmake/ext/zip/CMakeLists.txt @@ -68,7 +68,7 @@ target_sources( add_dependencies(php_ext_zip php_ext_pcre) -find_package(libzip 1.7.1) +include(PHP/Package/libzip) set_package_properties( libzip PROPERTIES diff --git a/cmake/ext/zlib/CMakeLists.txt b/cmake/ext/zlib/CMakeLists.txt index 71d45585..74b7ab4b 100644 --- a/cmake/ext/zlib/CMakeLists.txt +++ b/cmake/ext/zlib/CMakeLists.txt @@ -77,7 +77,7 @@ endif() target_compile_definitions(php_ext_zlib PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) -find_package(ZLIB ${PHP_ZLIB_MIN_VERSION}) +include(PHP/Package/ZLIB) set_package_properties( ZLIB PROPERTIES