On 09/19/2014 06:07 PM, Taylor Braun-Jones wrote:
> On Fri, Sep 19, 2014 at 3:04 PM, Brad King wrote:
>> I think it can be activated by a special format of an entry in
>> ExternalData_URL_TEMPLATES that specifies a lookup key that maps
>> to some kind of custom configuration of a .cmake script to include
>> or command to launch with execute_process.
> 
> How about defining new URL scheme like:
> 
> externaldatacommand://<*file|module*>/<*command*>

Yes, something along these lines is what I had in mind.

> list(APPEND ExternalData_URL_TEMPLATES
>   
> "externaldatacommand://ArtifactoryExternalData/ARTIFACTORY_DOWNLOAD_FILE?ALGO=%(algo)&"
> )
> 
> And inside Testing/CMake/ArtifactoryExternalData.cmake it would look like:
> 
> function(ARTIFACTORY_DOWNLOAD_FILE file algo hash)

Since CMake does not support variable evaluation in a command name,
this would require configuring a file with code in it to launch for
each entry of this form in the url templates list.

Also CMAKE_MODULE_PATH will not be available to the ExternalData
module when it is launched at build time to do the download.  The
include() will have to work with a full path, perhaps stored in
the configured copy of "ExternalData_config.cmake.in".  It could
be indexed with a key.  Perhaps:

  list(APPEND ExternalData_URL_TEMPLATES
    "ExternalDataCustomScript://MyFetch/%(algo)/%(hash)"
    )
  set(ExternalData_CUSTOM_SCRIPT_MyFetch /path/to/MyFetch.cmake)

The script would be include()-ed in place of the current call
to _ExternalData_download_file with the part of the URL after
the "MyFetch/" already parsed into some variable(s).

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to