Is there any way to bypass the recent CMake 3.5 policy error globally for vcpkg ports? #44784
Replies: 3 comments 5 replies
-
Oh whoops - I'd updated my system recently, and it seems that I'm on CMake 4.0, rather than just vcpkg! I assumed that it obtained its own version, since I saw it looking for a vcpkg CMake package in the logs. Downgrading to the previous version system-wide seems to have solved it, but it would be nice to have overridden that just for vcpkg. |
Beta Was this translation helpful? Give feedback.
-
You can use |
Beta Was this translation helpful? Give feedback.
-
We have the same issue. Microsoft Azure build agents have now migrated to CMake 4.0 whilst a lot of vcpkg ports are at lower than 3.5 as min required. It's a bit weird that the company behind both technologies are not in sync for such a big breaking change. For the ubuntu agent I downgraded to cmake 3.31 but it's not that easy on windows. I'd rather have a forward going solution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems vcpkg has started to use CMake 4.0, which removes support for some deprecated CMake functionality (see for example https://stackoverflow.com/questions/79534856/cannot-build-cmake-project-because-compatibility-with-cmake-3-5-has-been-remo). This now causes a whole load of ports to fail to build, and since in my case the ports are managed by an upstream project (and there are a lot of ports), it's not trivial for me to go in and fix each one.
CMake suggests that passing
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
may fix the issue, and this has fixed compilation of certain projects I have tried locally, but I can't seem to find a way for vcpkg to pass this option on to the ports it's attempting to build. Is there a way to do this, or to make vcpkg go back to using an older version of CMake?Beta Was this translation helpful? Give feedback.
All reactions