passing a URL to cmake on the command line

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

passing a URL to cmake on the command line

pszilard
Hi,

I'm trying to pass a URL (that's used in ExternalProject_Add), and I'm
having trouble convincing bash + cmake to cooperate. No matter what
I've done, one fo the "/" gets dropped from "http://".

Any ideas how can I construct an invocation similar to the one below
that will actually work?

cmake . -DMY_CUSTOM_URL='http://my-server.com/foobar.tar.gz'


Thanks,
--
Szilárd
--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: passing a URL to cmake on the command line

Haocheng Liu
Hi Szilard,

I tried it in CMake 3.10 and it works fine(No slash is dropped).  Which version of CMake are you using?

On Mon, Apr 9, 2018 at 11:24 AM, Szilárd Páll <[hidden email]> wrote:
Hi,

I'm trying to pass a URL (that's used in ExternalProject_Add), and I'm
having trouble convincing bash + cmake to cooperate. No matter what
I've done, one fo the "/" gets dropped from "http://".

Any ideas how can I construct an invocation similar to the one below
that will actually work?

cmake . -DMY_CUSTOM_URL='http://my-server.com/foobar.tar.gz'


Thanks,
--
Szilárd
--

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:
https://cmake.org/mailman/listinfo/cmake



--
Best regards
Haocheng

Haocheng LIU
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: <a href="tel:(518)%20881-4421" value="+15188814443" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">518-881-4421

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: passing a URL to cmake on the command line

pszilard
Hi,

My bad, looks like we had an offending line in our CMake scripts, something like

set(MY_URL
    "http://default-url.com/foobar.tar.gz" CACHE PATH
    "URL from where to download")

The PATH type seems to have caused the issue rather than the mechanism
of passing the URL to on the bash command line to cmake.

Thanks for the quick feedback!

Cheers,
--
Szilárd


On Mon, Apr 9, 2018 at 5:44 PM, Haocheng Liu <[hidden email]> wrote:

> Hi Szilard,
>
> I tried it in CMake 3.10 and it works fine(No slash is dropped).  Which
> version of CMake are you using?
>
> On Mon, Apr 9, 2018 at 11:24 AM, Szilárd Páll <[hidden email]> wrote:
>>
>> Hi,
>>
>> I'm trying to pass a URL (that's used in ExternalProject_Add), and I'm
>> having trouble convincing bash + cmake to cooperate. No matter what
>> I've done, one fo the "/" gets dropped from "http://".
>>
>> Any ideas how can I construct an invocation similar to the one below
>> that will actually work?
>>
>> cmake . -DMY_CUSTOM_URL='http://my-server.com/foobar.tar.gz'
>>
>>
>> Thanks,
>> --
>> Szilárd
>> --
>>
>> 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:
>> https://cmake.org/mailman/listinfo/cmake
>
>
>
>
> --
> Best regards
> Haocheng
>
> Haocheng LIU
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4421
--

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:
https://cmake.org/mailman/listinfo/cmake