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

Failure on empty CPM_SOURCE_CACHE

Open jhasse opened this issue 4 years ago • 5 comments

If CPM_SOURCE_CACHE is set to an empty string, CPM fails with file DOWNLOAD error: cannot create directory '/cpm' - Specify file by full.

jhasse avatar Jan 20 '21 09:01 jhasse

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

TheLartians avatar Jan 20 '21 10:01 TheLartians

Maybe a warning/error message like "CPM_SOURCE_CACHE is empty" or something like that?

jhasse avatar Jan 20 '21 10:01 jhasse

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.

Andres6936 avatar Jan 20 '21 14:01 Andres6936

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 avatar Jan 20 '21 14:01 TheLartians

@TheLartians Even if it's not very good, user could expect/wanr to have the cache in source directory or binary

flagarde avatar Mar 26 '21 23:03 flagarde