How to run the install step of an ExternalProject when installing the whole project?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to run the install step of an ExternalProject when installing the whole project?

Patrick Boettcher
Hi list,

I have several externalprojects in my build. Some of them have a quite
complete install-step which I would like to have running when the
parent-build is installed (and not during the compile build of the
parent).

How can I achieve that?

(It is related to the usage of the DESTDIR-variable which is only
present during make install, but not during make)

Thanks in advance for any help,
--
Patrick.
--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to run the install step of an ExternalProject when installing the whole project?

Patrick Boettcher
On Fri, 8 Mar 2019 15:45:50 +0100
Patrick Boettcher <[hidden email]> wrote:

> Hi list,
>
> I have several externalprojects in my build. Some of them have a quite
> complete install-step which I would like to have running when the
> parent-build is installed (and not during the compile build of the
> parent).
>
> How can I achieve that?

I found a way, but is it the best one?

The external-project gets its INSTALL_COMMAND set to "".

And then I add:

  ExternalProject_Get_Property(project-ext BINARY_DIR)
  install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} --build ${BINARY_DIR} --target install)")

--
Patrick.
--

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:
https://cmake.org/mailman/listinfo/cmake