From 3aec6f413e3c47536b33631af5c18e685df0b608 Mon Sep 17 00:00:00 2001 From: Mikhail Koviazin Date: Wed, 21 Feb 2024 15:12:46 +0200 Subject: [PATCH] [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 value or use a ... 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 3ac0974946d..f6520329afe 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()