You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2024/02/21 13:12:52 UTC
(avro) branch main updated: [AVRO-3944] small CMake fixes (#2757)
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/main by this push:
new 3aec6f413 [AVRO-3944] small CMake fixes (#2757)
3aec6f413 is described below
commit 3aec6f413e3c47536b33631af5c18e685df0b608
Author: Mikhail Koviazin <mi...@aiven.io>
AuthorDate: Wed Feb 21 15:12:46 2024 +0200
[AVRO-3944] small CMake fixes (#2757)
* Bump cmake_minimum_required to 3.5.
Current version triggers a warning during configuration phase:
CMake Deprecation Warning at CMakeLists.txt:19 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake 3.5.0 has been released in 2016, so it's safe to assume it's
available everywhere, which correlates with the information from
pkgs.org [1].
[1]: https://pkgs.org/search/?q=cmake&on=name
* CMake: fix the setting CMP0042 policy
The if-statement was always true since minimum cmake version was set to
3.1.
Instead, replace this condition with `if (APPLE)` since this policy
makes sense only on macOS.
---
lang/c++/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index 3ac097494..f6520329a 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-cmake_minimum_required (VERSION 3.1)
+cmake_minimum_required (VERSION 3.5)
set (CMAKE_LEGACY_CYGWIN_WIN32 0)
@@ -26,7 +26,7 @@ endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.0)
+if (APPLE)
# Enable MACOSX_RPATH by default
cmake_policy (SET CMP0042 NEW)
endif()