Skip to content

Commit d9f9d35

Browse files
committed
Use CMake 4.2 result variables for BZip2, LibXml2 and PostgreSQL
1 parent b3661aa commit d9f9d35

File tree

5 files changed

+56
-2
lines changed

5 files changed

+56
-2
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#[=============================================================================[
2+
# FindBZip2
3+
4+
This module overrides the upstream CMake `FindBZip2` module with few
5+
customizations:
6+
7+
* Added BZip2_VERSION result variable for CMake < 4.2.
8+
9+
See: https://cmake.org/cmake/help/latest/module/FindBZip2.html
10+
#]=============================================================================]
11+
12+
# Find package with upstream CMake find module. Absolute path prevents the
13+
# maximum nesting/recursion depth error on some systems, like macOS.
14+
include(${CMAKE_ROOT}/Modules/FindBZip2.cmake)
15+
16+
if(CMAKE_VERSION VERSION_LESS 4.2)
17+
set(BZip2_VERSION "${BZIP2_VERSION}")
18+
endif()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#[=============================================================================[
2+
# FindLibXml2
3+
4+
This module overrides the upstream CMake `FindLibXml2` module with few
5+
customizations:
6+
7+
* Added LibXml2_VERSION result variable for CMake < 4.2.
8+
9+
See: https://cmake.org/cmake/help/latest/module/FindLibXml2.html
10+
#]=============================================================================]
11+
12+
# Find package with upstream CMake find module. Absolute path prevents the
13+
# maximum nesting/recursion depth error on some systems, like macOS.
14+
include(${CMAKE_ROOT}/Modules/FindLibXml2.cmake)
15+
16+
if(CMAKE_VERSION VERSION_LESS 4.2)
17+
set(LibXml2_VERSION "${LIBXML2_VERSION_STRING}")
18+
endif()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#[=============================================================================[
2+
# FindPostgreSQL
3+
4+
This module overrides the upstream CMake `FindPostgreSQL` module with few
5+
customizations:
6+
7+
* Added PostgreSQL_VERSION result variable for CMake < 4.2.
8+
9+
See: https://cmake.org/cmake/help/latest/module/FindPostgreSQL.html
10+
#]=============================================================================]
11+
12+
# Find package with upstream CMake find module. Absolute path prevents the
13+
# maximum nesting/recursion depth error on some systems, like macOS.
14+
include(${CMAKE_ROOT}/Modules/FindPostgreSQL.cmake)
15+
16+
if(CMAKE_VERSION VERSION_LESS 4.2)
17+
set(PostgreSQL_VERSION "${PostgreSQL_VERSION_STRING}")
18+
endif()

cmake/ext/bz2/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ if(TARGET BZip2::BZip2)
9090
# the FILE definition. BZ2_bzerror() is available as of 1.0.0.
9191
block()
9292
set(headers "bzlib.h")
93-
if(BZIP2_VERSION VERSION_LESS 1.0.2)
93+
if(BZip2_VERSION VERSION_LESS 1.0.2)
9494
list(PREPEND headers "stdio.h")
9595
endif()
9696
check_symbol_exists(BZ2_bzerror "${headers}" PHP_EXT_BZ2_SANITY_CHECK)

cmake/ext/libxml/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ set_package_properties(
7474
)
7575

7676
# HAVE_WIN32_THREADS is not needed on newer libxml2 versions anymore.
77-
if(LIBXML2_VERSION_STRING VERSION_LESS 2.10)
77+
if(LibXml2_VERSION VERSION_LESS 2.10)
7878
target_compile_definitions(
7979
php_ext_libxml
8080
PRIVATE

0 commit comments

Comments
 (0)