cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Honour new relative git URL behaviour controlled by CMP0150

inkychris opened this issue · comments

I added support for relative git URLs to FetchContent/ExternalProject which was introduced in cmake v3.27 under policy CMP0150. Unfortunately, this doesn't seem to work when wrapped with CPM and it looks like this is because CPM minimum cmake version is set to 3.14.

I'm not sure on the best strategy here, but one option would be for CPM to inherit the policies from the parent project, and just assert that they're set at least to a minimum of 3.14 as CPM needs, rather than actually explicitly setting them to 3.14 as is currently the case. Alternatively, it should at least honour policy 150 and pass it through if it can.

Happy to submit a PR for this if there's a preferred solution.

Hey, thanks for raising the issue, I agree that it would make sense for CPM to honour the new policy. Currently we handle overriding policies inside a dedicated macro (see here for discussion), which would be the preferred location to enable CMP0150. Would be very happy to review a PR for this!

Sure thing, I'll submit a PR!