[CMake] What is the purpose of INSTALL_DIR in ExternalProject_Add command?

Cedric Doucet cedric.doucet at inria.fr
Fri Apr 10 04:57:23 EDT 2015


Hello Nils!

Thank you very much for your answer.
It works fine now!

Best regards,

Cédric



----- Mail original -----
> De: "Nils Gladitz" <nilsgladitz at gmail.com>
> À: "Cedric Doucet" <cedric.doucet at inria.fr>, cmake at cmake.org
> Envoyé: Vendredi 10 Avril 2015 10:55:11
> Objet: Re: [CMake] What is the purpose of INSTALL_DIR in ExternalProject_Add command?
> 
> On 04/10/2015 10:51 AM, Cedric Doucet wrote:
> >
> > Hello,
> >
> > I have tried to use INSTALL_DIR in the configuration command but I may do
> > something wrong:
> >
> >    ExternalProject_Add(${LIBRARY}
> >                        INSTALL_DIR
> >                        ${CMAKE_BINARY_DIR}/external/${LIBRARY}/install
> >                        DOWNLOAD_COMMAND wget
> >                        http://bitbucket.org/eigen/eigen/get/${EIGEN_VERSION}.tar.gz
> >                        && tar xvzf ${EIGEN_VERSION}.tar.gz -C ../src
> >                        --strip-components=1
> >                        CONFIGURE_COMMAND cd ../build && cmake -D
> >                        CMAKE_INSTALL_PREFIX=${INSTALL_DIR} ../src
> >                     )
> >
> > I get the following error message :
> >
> >      CMake Error at cmake_install.cmake:38 (FILE):
> >        file cannot create directory: /include/eigen3.  Maybe need
> >        administrative
> >        privileges.
> >
> > But if I replace INSTALL_DIR by its value in the configuration command,
> >
> >      CONFIGURE_COMMAND cd ../build && cmake -D
> >      CMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/${LIBRARY}/install
> >      ../src
> >
> > everything works fine.
> >
> > Could you explain me how to use INSTALL_DIR?
> 
> Try "<INSTALL_DIR>" instead of "${INSTALL_DIR}".
> <INSTALL_DIR> is a token that ExternalProject itself should expand
> rather than a regular variable expansion.
> 
> Nils
> 


More information about the CMake mailing list