CPM.cmake
CPM.cmake copied to clipboard
Failure on empty CPM_SOURCE_CACHE
If CPM_SOURCE_CACHE is set to an empty string, CPM fails with file DOWNLOAD error: cannot create directory '/cpm' - Specify file by full.
What would be the expected behaviour in that case? Note that if you want to clear an environmental variable you can use the unset command.
unset CPM_SOURCE_CACHE
Maybe a warning/error message like "CPM_SOURCE_CACHE is empty" or something like that?
In my opinion, this must be a precondition [CPM_SOURCE_CACHE ! = Null or Empty] that must be satisfied, this avoids adding code to handle this situation and keeps the [CPM] script simple.
I agree, I was wondering if there are any situations where one would want to set the Cache dir to an empty path, though probably not. So the solution would be "empty string" = "not set".
@TheLartians Even if it's not very good, user could expect/wanr to have the cache in source directory or binary