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

Feature Request: Short syntax in long syntax.

Richardk2n opened this issue · comments

The short syntax is very useful, however sometimes I would like to set options.
An example:

CPMAddPackage(
	GITHUB_REPOSITORY gabime/spdlog
	VERSION 1.13.0
	EXCLUDE_FROM_ALL YES
	SYSTEM YES
	OPTIONS "SPDLOG_FMT_EXTERNAL ON"
)

Would it be possible to have this be equivalent to either something like this:

CPMAddPackage("gh:gabime/spdlog#v1.13.0" OPTIONS "SPDLOG_FMT_EXTERNAL ON")

or like this:

CPMAddPackage(URI "gh:gabime/spdlog#v1.13.0" OPTIONS "SPDLOG_FMT_EXTERNAL ON")

? (URI is a placeholder here, feel free to pick whatever)
If I understand your script this could be done by invoking the short syntax parser for a certain argument if more than 1 is given. This would be advantageous in the use case: I just want to add an option.

Thanks for the issue! We feel the same way and have an in progress PR for it: #546.