Skip to content

[CI][MATLAB] libmexclass doesn't work with CMake 4.0.0 #46023

Description

@kou

Describe the bug, including details regarding any error messages, version, and platform.

https://github.com/apache/arrow/actions/runs/14242094035/job/39914141503#step:9:40

 CMake Error at build/_deps/libmexclass-src/libmexclass/cpp/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

We can solve this by:

  1. Updating https://github.com/mathworks/libmexclass/blob/cac7c3630a086bd5ba41413af44c833cef189c09/libmexclass/cpp/CMakeLists.txt#L1 to 3.6.0 or later OR
  2. Setting 3.5 to CMAKE_POLICY_VERSION_MINUMUM before FetchCotnent_MakeAvailable()

e.g.:

diff --git a/matlab/tools/cmake/BuildMatlabArrowInterface.cmake b/matlab/tools/cmake/BuildMatlabArrowInterface.cmake
index 27af19676b..185afee57a 100644
--- a/matlab/tools/cmake/BuildMatlabArrowInterface.cmake
+++ b/matlab/tools/cmake/BuildMatlabArrowInterface.cmake
@@ -113,6 +113,7 @@ FetchContent_Declare(
     GIT_TAG ${MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_GIT_TAG}
     SOURCE_SUBDIR ${MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_SOURCE_SUBDIR}
 )
+set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
 FetchContent_MakeAvailable(
     ${MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_NAME}
 )

Component(s)

Continuous Integration, MATLAB

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions