# extract install from external projects

**URL:** https://discourse.cmake.org/t/extract-install-from-external-projects/6912
**Category:** Usage
**Created:** [November 19, 2022, 10:40pm UTC](https://discourse.cmake.org/t/extract-install-from-external-projects/6912 "2022-11-19T22:40:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Fabian188](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fabian188/32/2934_2.png) [@Fabian188](https://discourse.cmake.org/u/Fabian188)
#### Post date: [November 19, 2022, 10:40pm UTC](https://discourse.cmake.org/t/extract-install-from-external-projects/6912/1 "2022-11-19T22:40:46Z")

</div>

There is a software package consisting of CMake based products in subdirectories of the package root  
One needs to go into the subdirectories manually in the proper order and call cmake within these subdirectories. There is no original CMakeLists.txt in the package root.

My attempt was to cover these products all in package root CMakeLists.txt.

This works quite ok via ExternalProject\_Add for the dependencies and some common variables.

An issue is, that the external projects implicitly do `make; make install` but I would like to have the `make install` separate from the root.

So basically I want ExternalProject\_Add not to perform the install step (which could be done via `INSTALL_COMMAND ""` but how can I collect all install steps for the root `make install`?

How could this be realized? Is there a better way to integrate individual CMake projects?

In case of interest: Here is my fork [GitHub - Fabian188/SuiteSparse-root-cmake: This fork adds a root CMakeLists.txt to the official SuiteSparse library authored or co-authored by Tim Davis](https://github.com/Fabian188/SuiteSparse-root-cmake)

Thanks!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 22, 2022, 12:15am UTC](https://discourse.cmake.org/t/extract-install-from-external-projects/6912/2 "2022-11-22T00:15:41Z")

</div>

I suppose you could use `install(SCRIPT)` to do these install commands, but I don’t think that will work well in the face of having to edit rpaths or the like (but maybe it could be set up to work).

---

<div class="post-metadata">

### Author: ![Fabian188](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fabian188/32/2934_2.png) [@Fabian188](https://discourse.cmake.org/u/Fabian188)
#### Post date: [November 23, 2022, 11:02am UTC](https://discourse.cmake.org/t/extract-install-from-external-projects/6912/3 "2022-11-23T11:02:14Z")

</div>

> [@ben.boeckel](#):
>
> `install(SCRIPT)`

Thanks, that made the job. I collect the modules build directory in a list and create an easy install script via configure\_file().

rpath seems to be no issue. I set CMAKE\_INSTALL\_DIR in ExternalProject\_Add() but prevent immediate install vial INSTALL\_COMMAND “”.
