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

Cedric Doucet cedric.doucet at inria.fr
Fri Apr 10 05:16:31 EDT 2015



Hello,

is it possible to make INSTALL_DIR depend on PREFIX?
I have tried "INSTALL_DIR <PREFIX>/install" but it does not seem to work: 'install' repository is not created.

Cédric



----- Mail original -----
> De: "Cedric Doucet" <cedric.doucet at inria.fr>
> À: "Nils Gladitz" <nilsgladitz at gmail.com>
> Cc: cmake at cmake.org
> Envoyé: Vendredi 10 Avril 2015 10:57:23
> Objet: Re: [CMake] What is the purpose of INSTALL_DIR in ExternalProject_Add command?
> 
> 
> 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
> > 
> --
> 
> 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
> 


More information about the CMake mailing list