cmake: Use `VERSION_LESS` condition to check whether we should require
APR-Util or not.
* build/cmake/FindSerf.cmake, CMakeLists.txt: Ditto.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1926351 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 094423b..e60809b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -281,11 +281,11 @@
find_package(APR REQUIRED)
add_library(external-apr ALIAS apr::apr)
- if(APR_MAJOR_VERSION EQUAL 2)
- add_library(external-aprutil ALIAS apr::apr)
- else()
+ if(APR_VERSION VERSION_LESS 2.0.0)
find_package(APRUtil REQUIRED)
add_library(external-aprutil ALIAS apr::aprutil)
+ else()
+ add_library(external-aprutil ALIAS apr::apr)
endif()
endif()
diff --git a/build/cmake/FindSerf.cmake b/build/cmake/FindSerf.cmake
index 31a319c..01c7c0c 100644
--- a/build/cmake/FindSerf.cmake
+++ b/build/cmake/FindSerf.cmake
@@ -85,7 +85,7 @@
ZLIB::ZLIB
)
-if(NOT APR_MAJOR_VERSION EQUAL 2)
+if(APR_VERSION VERSION_LESS 2.0.0)
find_package(APRUtil REQUIRED)
target_link_libraries(Serf::Serf INTERFACE apr::aprutil)
endif()