CPM.cmake icon indicating copy to clipboard operation
CPM.cmake copied to clipboard

Feature Request: Short syntax in long syntax.

Open Richardk2n opened this issue 11 months ago • 1 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.

Richardk2n avatar Apr 02 '24 11:04 Richardk2n

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

TheLartians avatar Apr 07 '24 21:04 TheLartians