[CMake] ExternalData on unmounted Windows shares?

Magnus Therning magnus at therning.org
Tue Nov 12 09:55:51 EST 2013


On Tue, Nov 12, 2013 at 3:06 PM, Jakub Zakrzewski <jzakrzewski at e2e.ch> wrote:
> Did you try: "\\share.host/foo/bar/%(algo)/%(hash)"? (probably you gonna need proper escaping).
> Note, that UNC paths begin with "\\" and in this case they cannot be substitued with "//". Also - this is windows-only.

This is all rather interesting, and does look a bit broken to me.

The setup:

A file, foo.img with SHA256
b05528ba594ae4d6ca2b7b76ce02694e19a1c6d9d51b507e7b63d1919cb86e94.  I
copy it to smb://share.host/foo/bar/SHA256/b05528ba594ae4d6ca2b7b76ce02694e19a1c6d9d51b507e7b63d1919cb86e94.
 Then map R: to smb://share.host/foo.

I put the following into my CMakeLists.txt:

~~~~
set(ExternalData_LINK_CONTENT "SHA256")
ExternalData_Expand_Arguments(fooimg fooimg_loc
DATA{bin/foo.img}
)
ExternalData_Add_Target(fooimg)
~~~~

Now, I try combinations of values for ExternalData_URL_TEMPLATES and
ExternalData_OBJECT_STORES:

Not working:
~~~~
list(APPEND ExternalData_URL_TEMPLATES "\\\\share.host/foo/bar/%(algo)/%(hash)")
~~~~
The file is not found.

Working:
~~~~
list(APPEND ExternalData_URL_TEMPLATES "\\\\share.host/foo/bar/%(algo)/%(hash)")
list(APPEND ExternalData_OBJECT_STORES "r:/bar")
~~~~
The file is apparently found (at least there's no complaint) but then
taken from the store.

Not working:
~~~~
list(APPEND ExternalData_URL_TEMPLATES "\\\\share.host/foo/bar/%(algo)/%(hash)")
list(APPEND ExternalData_OBJECT_STORES "\\\\share.host/foo/bar")
~~~~
The file is not found.

Not working:
~~~~
list(APPEND ExternalData_OBJECT_STORES "r:/bar")
~~~~
Complains that ExternalData_URL_TEMPLATES is empty.

I was surprised to find that ExternalData_URL_TEMPLATES and
ExternalData_OBJECT_STORES weren't more independent and it's
disappointing to find that it isn't possible to use an UNC path to
download a data object.

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus


More information about the CMake mailing list