# How to create an executable/binaries of custom application

**URL:** https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890
**Category:** Development
**Created:** [April 14, 2023, 10:36pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890 "2023-04-14T22:36:34Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 14, 2023, 10:36pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/1 "2023-04-14T22:36:34Z")

</div>

How to create an executable of the custom application? I want to dynamically link the qt libraries.  
I have built software from source using this guide:  
[ParaView/build.md at master · Kitware/ParaView · GitHub](https://github.com/Kitware/ParaView/blob/master/Documentation/dev/build.md)  
And then wrote my custom application. I want to create binaries/executable for windows, linux and mac.

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [April 17, 2023, 7:21am UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/2 "2023-04-17T07:21:57Z")

</div>

if you want to redistribute binaries, you should use the _superbuild_ concept.  
[Here](https://gitlab.kitware.com/paraview/paraview-based-superbuild-example) is the example on how to create a superbuild for paraview based applications.

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 17, 2023, 2:01pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/3 "2023-04-17T14:01:09Z")

</div>

Do I need to build paraview superbuild first on my machine and then use this example or can I just clone this example and replace simple-paraview-example with my application?

What does pvsb@ 4ab568cb mean?

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [April 17, 2023, 2:05pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/4 "2023-04-17T14:05:37Z")

</div>

> [@Muhammad\_Saad\_Atique](#):
>
> What does pvsb@ 4ab568cb mean

This is a git submodule

You can clone (and probably fork) this example, and then, as you stated, replace `simple-paraview-example` by your application:

- rename and adapt files inside `projects` dir
- adapt `versions.cmake` file

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 17, 2023, 2:06pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/5 "2023-04-17T14:06:49Z")

</div>

So then I would not have to first build superbuild on my machine separately? And would I be able to generate binaries of my application and distribute them?

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [April 17, 2023, 2:08pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/6 "2023-04-17T14:08:10Z")

</div>

That is the idea of this project: run only one, big but lonely, build to generate all that is needed to create a redistributable archive

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 17, 2023, 9:59pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/7 "2023-04-17T21:59:26Z")

</div>

I tried to change the simpleparaview example with [Clone 1](https://github.com/Kitware/ParaView/tree/master/Examples/CustomApplications/Clone1) example in the [superbuild exampl](https://gitlab.kitware.com/paraview/paraview-based-superbuild-example)e  
but I am getting this error when I try to build it:

```auto
CMake Error at pvsb/superbuild/cmake/SuperbuildMacros.cmake:822 (include):
  include could not find requested file:

    clone1
Call Stack (most recent call first):
  pvsb/superbuild/CMakeLists.txt:168 (_superbuild_discover_projects)

-- Enabling cxx11 as requested.
-- Enabling paraview as requested.
-- Building projects: cxx11, paraview
CMake Warning (dev) at pvsb/superbuild/cmake/SuperbuildMacros.cmake:213 (message):
  Optional dependencies for paraview not found: adios2, cuda, boost, eigen,
  fortran, gdal, hdf5, matplotlib, mpi, numpy, png, protobuf, python3,
  visitbridge, zlib, silo, las, lookingglass, fides, xdmf3, vrpn, vtkm,
  netcdf, openpmd, openvdb, nlohmannjson, paraviewgettingstartedguide,
  paraviewtutorialdata, paraviewweb, openvr, zeromq
Call Stack (most recent call first):
  pvsb/projects/paraview.cmake:186 (superbuild_add_project)
  pvsb/superbuild/cmake/SuperbuildMacros.cmake:1061 (include)
  pvsb/superbuild/CMakeLists.txt:170 (superbuild_process_dependencies)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

```

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [April 18, 2023, 7:57am UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/8 "2023-04-18T07:57:43Z")

</div>

Please detail what you did.

You should change quite every file of the example to adapt it correctly: each mention to `simple` in files AND in filename.

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 18, 2023, 8:07pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/10 "2023-04-18T20:07:32Z")

</div>

I made following changes:

1. In **projects/unix** I changed the file name to **clone1.bunble.cmake**
2. In **projects/unix/clone1.bundle.cmake:**

- set(CPACK\_PACKAGE\_NAME **“Clone1-1.0-ParaView”** )

- superbuild\_unix\_install\_program("{superbuild\_install\_location} **/bin/clone1"** “lib”  
SEARCH\_DIRECTORIES “${library\_paths}”)

- Changed **other paths in projects/unix/clone1.bundle.cmake** from simpleparaview to clone1

1. Same changes made in **projects/win32/clone1.bundle.cmake**
2. In projects/clone1.cmake changed the **superbuild\_add\_project** from simpleparaview to clone1
3. **Did not make any changes to pvsb**
4. In main **CmakeLists.txt:**

- Changed **project from simpleparaview-superbuild to clone1-superbuild**

- In **superbuild\_find\_projects function** I changed simpleparaview to clone1 in set projects

- foreach (generator IN LISTS generators)  
superbuild\_add\_extra\_package\_test( **strong text\*\*\*\*clone1** “${generator}”  
LABELS **“Clone1”**  
TIMEOUT 6400)

- **set the default project** s: set(_superbuild\_default_ **clone1** ON)

1. In **versions.cmake** changed the **superbuild\_set\_version** name from simpleparaview to clone1, also changed the URL and URL\_MD5

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 19, 2023, 3:03pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/11 "2023-04-19T15:03:18Z")

</div>

Oh I wasn’t changing the filenames, after I did it fixed this issue.

Getting this error right at the end of the build:

```auto
CMake Error at CMakeLists.txt:78 (message):
  Failed to find the VTK CMake directory. Did you forget to initialize the
  submodule? (git submodule update --init --recursive)

-- Configuring incomplete, errors occurred!
CMake Error at C:/Users/msaad/build_clone/pvsb/superbuild/sb-clone1-configure.cmake:47 (message):
  Failed with exit code 1

ninja: build stopped: subcommand failed.

```

Could this be because the superbuild version in the example is an old one?

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [April 20, 2023, 9:04am UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/12 "2023-04-20T09:04:44Z")

</div>

For sure not related to the superbuild version.

Maybe related on how you get ParaView or the clone … (in versions.cmake)

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 20, 2023, 3:32pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/13 "2023-04-20T15:32:49Z")

</div>

This is my versions.cmake file

```auto
superbuild_set_revision(clone1
  URL "https://gitlab.kitware.com/paraview/paraview/-/archive/v5.11.1/paraview-v5.11.1.tar.gz"
  URL_MD5 0c9d1b2f4f6d0c09683b66387b1e3f71)

```

I got the URL for [this](https://gitlab.kitware.com/paraview/paraview/-/tree/v5.11.1/Examples/CustomApplications/Clone1?ref_type=tags)

And got the MD5 from my terminal by running the following commands:

```auto
CertUtil -hashfile file_name.tar.gz MD5

```

---

<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: [April 24, 2023, 12:19am UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/14 "2023-04-24T00:19:16Z")

</div>

You’ll also need to set `SOURCE_SUBDIR` to `Examples/CustomApplications/Clone1` there, make some `clone1.bundle.cmake` module to do the packaging (cribbing from `paraview.bundle.cmake` is probably best), and hook in the packaging of `clone1` in `superbuild_add_packaging` in the top-level `CMakeLists.txt`.

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 24, 2023, 1:49am UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/15 "2023-04-24T01:49:49Z")

</div>

Thanks for the response, where would the SOURCE\_SUBDIR would be?  
what does it mean to make some clone1.bundle.cmake module? I am not sure what cribbing from paraview.bundle.cmake is. Can you please explain? Thanks

---

<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: [April 24, 2023, 2:10am UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/16 "2023-04-24T02:10:57Z")

</div>

- `SOURCE_SUBDIR` is part of the `superbuild_set_revision` call; it makes CMake look in that subdirectory for the main build instead of starting at the top-level (which would build ParaView itself).
- `clone1.bundle.cmake` is the file the packaging will look at.
- “Cribbing” means “look at `paraview.bundle.cmake` as a template and change what makes sense”. You probably don’t need/want `paraview` the executable, but the rest may be relevant (but feel free to simplify anything you know you don’t need).

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 24, 2023, 2:37am UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/17 "2023-04-24T02:37:45Z")

</div>

This is in pvsb/versions.cmake file:

```auto
superbuild_set_revision(protobuf
  URL "https://www.paraview.org/files/dependencies/protobuf-3.17.3.tar.gz"
  URL_MD5 "d7f8e0e3ffeac721e18cdf898eff7d31"
  SOURCE_SUBDIR cmake)

```

Do I need to change SOURCE\_SUBDIR here? And what should it point to? to the tar.gz file of my repository?

As for the clone1.bundle.cmake, do I need to create this file? If yes, then where? Because I am trying to compare with the Paraview based [superbuild example](https://gitlab.kitware.com/paraview/paraview-based-superbuild-example) which is based on simpleParaview example and I can’t find any simpleParaview.bundle.cmake there so I am a little confused.

---

<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: [April 24, 2023, 12:08pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/18 "2023-04-24T12:08:28Z")

</div>

No, the `clone1` will need to add a `SOURCE_SUBDIR` entry. I gave the path in [this comment](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/14).

Yes, you’ll need to create `clone1.bundle.cmake`. Probably under `projects/win32`. That example might not have packaging around.

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 24, 2023, 5:58pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/19 "2023-04-24T17:58:24Z")

</div>

I am really sorry to keep on bugging you. But I am confused and would really appreciate if you can clear my confusion.  
As I said I am using Paraview based superbuild example which uses SimpleParaview and that example works fine and generated a binary file which I can install.  
Because my end goal is to create binaries for my custom application (and I was told that the way to do would be to modify the Paraview based superbuild example for my custom application) so I am just trying to modify that example, for now for the Clone1 example.  
As for SimpleParaview there was no SOURCE\_SUBDIR in Examples/CustomApplications/SimpleParaview so I think that’s why I am confused as to how and where I need to add that.  
Same is the case for clone1.bundle.cmake.  
Is there any superbuild example which has these things which I can follow?

Again, thanks for your help and patience!

---

<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: [May 1, 2023, 10:00pm UTC](https://discourse.paraview.org/t/how-to-create-an-executable-binaries-of-custom-application/11890/20 "2023-05-01T22:00:45Z")

</div>

> [@Muhammad\_Saad\_Atique](#):
>
> As for SimpleParaview there was no SOURCE\_SUBDIR in Examples/CustomApplications/SimpleParaview

I don’t know…it should have needed it? `protobuf` does it because its top-level `CMakeLists.txt` is in a subdirectory.
