[CMake] Problems with ExternalProject_Add

Craig Scott craig.scott at crascit.com
Sun May 26 08:02:18 EDT 2019


On Wed, May 22, 2019 at 7:13 PM Steven Truppe <workbench at gmx.at> wrote:

> Hi everyone,
>
>
> i'm trying to use ExternalProject_Add like the following:
>
> set(BOOST_VERSION 1.68.0)
> set(BOOST_VERSION_NODOTS 1_68_0)
> set(BOOST_URI https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
> set(BOOST_HASH 5d8b4503582fffa9eefdb9045359c239)
>
> ExternalProject_Add(external_boost
>         PREFIX ${CMAKE_BINARY_DIR}/boost
> 		URL ${BOOST_URL}
>         DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/boost
> 		URL_HASH MD5=${BOOST_HASH}
>         CONFIGURE_COMMAND  cd ${CMAKE_BINARY_DIR}/boost/src/external_boost/ && ./bootstrab --prefix=${OUTPUT_PATH}/boost
> 		BUILD_COMMAND  cd ${CMAKE_BINARY_DIR}/boost/src/external_boost/ && ./b2
> 		BUILD_IN_SOURCE 1
> 		INSTALL_DIR ${OUTPUT_PATH}/boost
>
> The problem is that he tells me that the md5 sum isn't correct, but i did md5sum ${BOOST_URL}.
>
>
Looking in the same directory from which you are trying to download, there
is a boost_1_68_0.tar.gz.json file which contains the expected sha256 sum.
You would be better off using that in this case:

set(BOOST_HASH da3411ea45622579d419bfda66f45cd0f8c32a181d84adfa936f5688388995cf)


You'd also need to change the URL_HASH in your call to
ExternalProject_Add():

		URL_HASH SHA256=${BOOST_HASH}


Your ExternalProject_Add() command also seems to have a few typos in
various places (BOOST_URL instead of BOOST_URI, the CONFIGURE_COMMAND
contains ./bootstrab which looks suspicious) and you should use separate
COMMAND entries rather than using && to specify multiple commands for a
given stage. Have a read through the ExternalProject_Add() docs for more
details, specifically the "Miscellaneous Options" subsection.


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

Get the hand-book for every CMake user: Professional CMake: A Practical
Guide <https://crascit.com/professional-cmake/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190526/2dea2d25/attachment.html>


More information about the CMake mailing list