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

Cedric Doucet cedric.doucet at inria.fr
Thu Apr 9 09:53:56 EDT 2015


Hello Theodore,

thank you for your help.

Well, indeed it greatly depends on the system and the user.
Neverteless, you can alaways provide your own value of CONFIGURATION_COMMAND to install your libraries in the same directory or in different ones.
It does not depend on INSTALL_DIR at all.
You don't need INSTALL_DIR to do that.
It is more convenient to do it at the command line 'cmake -D MY_INSTALL_PREFIX' and make CONFIGURE_COMMAND depend on the value MY_INSTALL_PREFIX (or CMAKE_INSTALL_PREFIX if you want).

But do you understand what INSTALL_DIR do?

For example, what are the differences between this call

ExternalProject_Add(eigen
                    PREFIX third_party
                    INSTALL_DIR third_party/eigen/install
                    DOWNLOAD_COMMAND wget http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz && tar xvzf 3.2.4.tar.gz -C ../src --strip-components=1
                   )

and this one

ExternalProject_Add(eigen
                    PREFIX third_party
                    DOWNLOAD_COMMAND wget http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz && tar xvzf 3.2.4.tar.gz -C ../src --strip-components=1
                   )
?

What is the default value of INSTALL_DIR?
What does setting INSTALL_DIR to a value do?

I am sorry if I miss something, but I really try to understand your answers.
I realize that I don't understand what mechanism is behind setting INSTALL_DIR to a value.

In the documentation (http://www.cmake.org/cmake/help/v3.2/module/ExternalProject.html?highlight=external#command:externalproject_add), it is written "Installation prefix".
But what does it mean? 
What is actually done with the value of INSTALL_DIR?

Cédric


----- Mail original -----
> De: "Theodore Papadopoulo" <Theodore.Papadopoulo at inria.fr>
> À: cmake at cmake.org
> Envoyé: Jeudi 9 Avril 2015 15:08:13
> Objet: Re: [CMake] What is the purpose of INSTALL_DIR in ExternalProject_Add command?
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 04/09/2015 01:26 PM, Ryan Pavlik wrote:
> > It's for if your use case requires the project to be installed in
> > a specific location that's not the automatically generated one.
> > For instance, if you're building multiple external projects you
> > might have them all install to the same subdirectory of the binary
> > directory for convenience.
> > 
> > Ryan
> 
> I personally believe that you should never use the files constructed
> in the build directory. This can work for binaries or static libraries
> but is a point of failure with dynamic libraries (often the relative
> paths of those are different in the final install).
> 
> One case where installing is absolutely necessary (at least in my
> somewhat limited experience); windows, which requires that all the
> dynamic libraries used by a program to be in the smae install directory.
> 
> 	Hope it help a little.
> 
> 	Theo.
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> 
> iEYEARECAAYFAlUmeb0ACgkQEr8WrU8nPV2U8QCeKO8ldeKUnQHktROVz1uzo0x6
> ZDQAoJOL8KciN9pq5H+09tmSRhqSqiQ6
> =J+yG
> -----END PGP SIGNATURE-----
> --
> 
> 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