<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div><br></div><div>Hello Ryan,<br></div><div><br></div><div>thank you for your answer.<br>If I understand it well, this exactly what I want.<br></div><div>I want third-party libraries to be installed in a specific location which does not correspond to the automatically generated one.<br></div><div>To do that, I can provide my own configuration command to install in MYDIR:<br></div><div>- for autoconfig: CONFIGURE_COMMAND ./configure --prefix=${MYDIR}<br></div><div>- for cmake: CONFIGURE_COMMAND cmake -D CMAKE_INSTALL_PREFIX=${MYDIR}<br></div><div>But, in this case, I don't use, and I do not have to use, the value of INSTALL_DIR.<br></div><div>Furhtermore, if I want to use INSTALL_DIR, I still need to provide my own configuration command.<br></div><div><br></div><div>So, my question is: what is INSTALL_DIR useful for?<br>Do you have an example where INSTALL_DIR is used without providing its own configuration command?<br></div><div>Because, if I need to provide such a command, INSTALL_DIR is useless.<br></div><div><br></div><div>Cédric<br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Ryan Pavlik" <ryan.pavlik@gmail.com><br><b>À: </b>"Cedric Doucet" <cedric.doucet@inria.fr>, "Iosif Neitzke" <iosif.neitzke+cmake@gmail.com><br><b>Cc: </b>cmake@cmake.org<br><b>Envoyé: </b>Jeudi 9 Avril 2015 13:26:01<br><b>Objet: </b>Re: [CMake] What is the purpose of INSTALL_DIR in ExternalProject_Add command?<br><div><br></div><p dir="ltr">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.</p>
<p dir="ltr">Ryan</p>
<br><div class="gmail_quote">On Thu, Apr 9, 2015, 6:07 AM Cedric Doucet <<a href="mailto:cedric.doucet@inria.fr" target="_blank">cedric.doucet@inria.fr</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hello Iosif and David,<br>
<br>
thank you for your answer.<br>
I now understand how it works.<br>
But I still don't understand the purpose of INSTALL_DIR.<br>
Do you know an example when this variable is useful?<br>
<br>
Cédric<br>
<br>
<br>
<br>
<br>
----- Mail original -----<br>
> De: "Iosif Neitzke" <<a href="mailto:iosif.neitzke%2Bcmake@gmail.com" target="_blank">iosif.neitzke+cmake@gmail.com</a><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>><br>
> À: <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
> Envoyé: Jeudi 9 Avril 2015 12:54:28<br>
> Objet: Re: [CMake] What is the purpose of INSTALL_DIR in      ExternalProject_Add command?<br>
><br>
> Install Step<br>
> The INSTALL_DIR is underneath the calling project’s binary directory.<br>
> Use INSTALL_DIR to specify a different location. Note that in addition<br>
> to setting INSTALL_DIR, you also have to pass -DCMAKE_INSTALL_PREFIX<br>
> or --prefix to the CMake or configure command. It is not used<br>
> automatically in the configure step since not all projects follow this<br>
> convention.<br>
><br>
> From<br>
> <a href="http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html" target="_blank">http://www.kitware.com/media/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>html/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>BuildingExternalProjectsWithCM<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>ake2.8.html</a><br>
><br>
> On Thu, Apr 9, 2015 at 5:44 AM, David Cole via CMake <<a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a>> wrote:<br>
> > You need to tell eigen where to install, probably as an argument to its<br>
> > configure step. If it builds with CMake, you can use:<br>
> ><br>
> >     -DCMAKE_INSTALL_PREFIX=<<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>INSTALL_DIR><br>
> ><br>
> > as one of the CMake args. If it has a non-CMake configure step, you'll have<br>
> > to call that and pass in <INSTALL_DIR> as an argument.<br>
> ><br>
> ><br>
> > HTH,<br>
> > David C.<br>
> ><br>
> ><br>
> > On Thursday, April 9, 2015, Cedric Doucet <<a href="mailto:cedric.doucet@inria.fr" target="_blank">cedric.doucet@inria.fr</a>> wrote:<br>
> >><br>
> >><br>
> >> Hello!<br>
> >><br>
> >> I try to download, extract, configure, build and install a library with<br>
> >> CMake.<br>
> >> My CMakeLists.txt contains the following lines:<br>
> >><br>
> >> cmake_minimum_required (VERSION 2.6)<br>
> >> project (example CXX)<br>
> >> set(CMAKE_VERBOSE_MAKEFILE ON)<br>
> >> include(ExternalProject)<br>
> >> include(ProcessorCount)<br>
> >> ProcessorCount(N)<br>
> >> if(NOT N EQUAL 0)<br>
> >>   set(CMAKE_BUILD_FLAGS -j${N})<br>
> >> endif()<br>
> >> ExternalProject_Add(eigen<br>
> >>                     PREFIX third_party<br>
> >>                     DOWNLOAD_DIR third_party/eigen/download<br>
> >>                     SOURCE_DIR third_party/eigen/src<br>
> >>                     BINARY_DIR third_party/eigen/build<br>
> >>                     INSTALL_DIR third_party/eigen/install<br>
> >>                     DOWNLOAD_COMMAND wget<br>
> >> <a href="http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz" target="_blank">http://bitbucket.org/eigen/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>eigen/get/3.2.4.tar.gz</a> && tar xvzf 3.2.4.tar.gz<br>
> >> -C ../src --strip-components=1<br>
> >>                    )<br>
> >><br>
> >> In this example, the installation step fails with the following error<br>
> >> message:<br>
> >><br>
> >> CMake Error at cmake_install.cmake:38 (FILE):<br>
> >>   file cannot create directory: /usr/local/include/eigen3.  Maybe need<br>
> >>   administrative privileges.<br>
> >><br>
> >> It means that the value of INSTALL_DIR is not taken into account during<br>
> >> the configuration process.<br>
> >><br>
> >> Why? What am I do wrong?<br>
> >><br>
> >> Thank you very much for your help.<br>
> >><br>
> >> Best regards,<br>
> >><br>
> >> Cédric Doucet<br>
> >> --<br>
> >><br>
> >> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
> >><br>
> >> Please keep messages on-topic and check the CMake FAQ at:<br>
> >> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>CMake_FAQ</a><br>
> >><br>
> >> Kitware offers various services to support the CMake community. For more<br>
> >> information on each offering, please visit:<br>
> >><br>
> >> CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>support.html</a><br>
> >> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>consulting.html</a><br>
> >> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>training.html</a><br>
> >><br>
> >> Visit other Kitware open-source projects at<br>
> >> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>opensource/opensource.html</a><br>
> >><br>
> >> Follow this link to subscribe/unsubscribe:<br>
> >> <a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>mailman/listinfo/cmake</a><br>
> ><br>
> ><br>
> > --<br>
> ><br>
> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
> ><br>
> > Please keep messages on-topic and check the CMake FAQ at:<br>
> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>CMake_FAQ</a><br>
> ><br>
> > Kitware offers various services to support the CMake community. For more<br>
> > information on each offering, please visit:<br>
> ><br>
> > CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>support.html</a><br>
> > CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>consulting.html</a><br>
> > CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>training.html</a><br>
> ><br>
> > Visit other Kitware open-source projects at<br>
> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>opensource/opensource.html</a><br>
> ><br>
> > Follow this link to subscribe/unsubscribe:<br>
> > <a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>mailman/listinfo/cmake</a><br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more<br>
> information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>training.html</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>mailman/listinfo/cmake</a><br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>mailman/listinfo/cmake</a><br data-mce-bogus="1"></blockquote></div>
</blockquote><div><br></div></div></body></html>