FindPythonInterp broken on CMake 3.19.1 (macOS)
I'm trying to update Homebrew's version of Rust here: https://github.com/Homebrew/homebrew-core/pull/66285
Homebrew CI then ran tests on all packages that depend on Rust, and this revealed a build failure for simgrid, with the following error:
CMake Error at /usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:281 (message):
find_package_check_version(): Cannot be used outside a 'Find Module'
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:530 (find_package_check_version)
/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/FindPythonInterp.cmake:169 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:138 (include)
I've isolated this error to the following line in CMakeLists.txt
:
https://framagit.org/simgrid/simgrid/-/blob/master/CMakeLists.txt#L144
The problem may be related to the deprecation of FindPythonInterp
since CMake 3.12.
I've confirmed that removing this line from CMakeLists.txt
and manually setting the variables that FindPythonInterp
determines (see docs linked to previously) allows the build to proceed successfully. (simgrid
also then passes Homebrew's functionality tests.)