# Adding project to ParaView Superbuild

**URL:** https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143
**Category:** Development
**Created:** [January 16, 2019, 4:30pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143 "2019-01-16T16:30:13Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![benjaminjeliot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/benjaminjeliot/32/1001_2.png) [@benjaminjeliot](https://discourse.paraview.org/u/benjaminjeliot)
#### Post date: [January 16, 2019, 4:30pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/1 "2019-01-16T16:30:13Z")

</div>

Hello everyone!

I am trying to add an external project to ParaView Superbuild and I am having some difficulty due to the project layout. I have created a project file `projects/unix/<name>.cmake` and added the project to `versions.cmake`.

The project has a makefile that is located within a “src” subdirectory of the project, i.e. it gets extracted to `superbuild/<name>/src/src/Makefile`. The project does not support out of source builds.

How can I add a project to paraview superbuild using the superbuild\_add\_project command so that it will work with this my project layout? Is there a way to set the working/build directory to `superbuild/<name>/src/src`? Or is there a way to do `cd src` before running `make` in the BUILD\_COMMAND?

Thanks everyone! 🙂

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 16, 2019, 8:11pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/2 "2019-01-16T20:11:51Z")

</div>

Add `BUILD_IN_SOURCE 1` to the arguments for the project command.

---

<div class="post-metadata">

### Author: ![benjaminjeliot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/benjaminjeliot/32/1001_2.png) [@benjaminjeliot](https://discourse.paraview.org/u/benjaminjeliot)
#### Post date: [January 17, 2019, 8:57am UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/3 "2019-01-17T08:57:07Z")

</div>

Thanks for your reply 🙂

I had tried adding `BUILD_IN_SOURCE 1` but the problem I had was that the `make` command is run in `superbuild/<name>/src` and I need it to run in a src subdirectory, i.e. `superbuild/<name>/src/src`.

Can I use `BUILD_IN_SOURCE 1` then somehow move to a subdirectory before running the build command?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 17, 2019, 4:03pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/5 "2019-01-17T16:03:56Z")

</div>

There is `SOURCE_SUBDIR <subdir>` for treating the top-level source directory as a subdirectory of the normal one.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 17, 2019, 4:06pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/6 "2019-01-17T16:06:59Z")

</div>

The superbuild is basically a layer on top of [`ExternalProject`](https://cmake.org/cmake/help/latest/module/ExternalProject.html) which does some enable/disable toggling and add support for `PROCESS_ENVIRONMENT`, so anything mentioned in those docs are supported in the superbuild as well. The superbuild currently carries 3.9’s `ExternalProject` module, but uses the one with your CMake if it is at least 3.9.

---

<div class="post-metadata">

### Author: ![benjaminjeliot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/benjaminjeliot/32/1001_2.png) [@benjaminjeliot](https://discourse.paraview.org/u/benjaminjeliot)
#### Post date: [January 17, 2019, 4:31pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/7 "2019-01-17T16:31:29Z")

</div>

I tried adding `SOURCE_SUBDIR src` to my `superbuild_add_project` command, but my build command seems to run in the same directory as before. Perhaps the `SOURCE_SUBDIR` option only works with CMake projects and not Makefile projects?

Thank you 🙂

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 17, 2019, 6:27pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/8 "2019-01-17T18:27:11Z")

</div>

Hmm, that would indeed seem to be the case. I’ll look at making an MR for CMake that we can put into the superbuild.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 17, 2019, 6:41pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/9 "2019-01-17T18:41:02Z")

</div>

[https://gitlab.kitware.com/cmake/cmake/merge\_requests/2823](https://gitlab.kitware.com/cmake/cmake/merge_requests/2823)

---

<div class="post-metadata">

### Author: ![benjaminjeliot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/benjaminjeliot/32/1001_2.png) [@benjaminjeliot](https://discourse.paraview.org/u/benjaminjeliot)
#### Post date: [January 21, 2019, 9:49am UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/10 "2019-01-21T09:49:38Z")

</div>

Thanks for your help with this 😃

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 22, 2019, 3:47pm UTC](https://discourse.paraview.org/t/adding-project-to-paraview-superbuild/1143/11 "2019-01-22T15:47:52Z")

</div>

I’ve made an issue for bringing it into the common-superbuild: [https://gitlab.kitware.com/paraview/common-superbuild/issues/46](https://gitlab.kitware.com/paraview/common-superbuild/issues/46)
