Skip to content

Commit

Permalink
[AVRO-3944] small CMake fixes (#2757)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mkmkme authored Feb 21, 2024
1 parent 1cfcc3b commit 3aec6f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lang/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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()
Expand Down

0 comments on commit 3aec6f4

Please sign in to comment.