USE_SYSTEM_qt not there while building Superbuild on Windows 11 | No Paraview Application

Hi, I have followed the following steps to build superbuild:

  • Install Visual Studio 2019 community with all C++ related tools
  • Install cmake
  • Install git bash
  • Install Ninja
    I thought I won’t have to install Qt (which is one of the reason to use Superbuild), but without installing Qt I was getting error that Qt5 Dir and Qt5-cmake not found so then I installed Qt
  • Install Qt 5.15.2 VS2019 (had to add Qt cmake directory path in cmake Qt_Dir)
    then I did:
git clone --recursive
cd paraview-superbuild
git fetch origin 
$ git checkout master
$ git submodule update

Outside source directory I created pv-build directory
Open Visual Studio Native Command X64


cd pv-build

I had to run this in the pv-build folder before running cmake-gui

cmake -DCMAKE_BUILD_TYPE=STRING=Release /path/to/source

In my Cmake I don’t find USE_SYSTEM_qt options, did I miss something?
I want to create a binary of my custom application and don’t want my user to install Qt or other dependency. So what should I do.

I cinfigure and generate. After this I run ninja. The build is successful, but when I open paraview app which is in:
i get errors. But if I open paraview app in C:\Users\msaad\pv-sup-build\install\bin it works, why are there multiple version?

Please guide, thanks

You need to explicitly enable the qt project of the superbuild with ENABLE_qt5=ON

I did ENABLE_qt5 = ON in cmake_gui (which I opened from VS Native Command x64). But even then it was giving me error that Qt5 Dir and Qt5-cmake not found, so I had to install Qt5 on my system for that.
And even with ENABLE_qt5 I could not see USE_SYSTEM_qt option.
Am I doing something wrong?

Thanks for a quick response.

Ahh sorry, in windows you must use a system Qt.

So you need to install Qt on the build machine, and set Qt5_DIR to point your install.

Yeah I did that. But then once I build my application binaries and distribute them I don’t want my customers to install Qt and other dependencies (same as when I download Paraview’s binary I don’t have to install anything), how can I do that?

I think that thanks to this line of the custom app superbuild, the packaging step will copy the dlls

Perfect, thanks!
One more question, I think because I created two different question threads it’s confusing me :stuck_out_tongue:
So just using the simpleparaview superbuild example is enough to generate our own binaries, but in this thread we are talking about building superbuild ourselves on the machine (which is not needed if our goal to create and distribute binaries of our application) so why should one build superbuild on their machines :thinking:?

I’m not sure to follow.

The superbuild is intended to be used for creating redistributable binaries. For ParaView, we have the superbuild repo.

Then paraview-based applications can reuse most of this. The simple pv is an example of how to do that.

Those projects should be build somewhere to get the binaries: either on a CI or on a local machine. And doing that on a local machine make it easier at first place while work is in progress and debug is needed.

Sorry. I got confused. So what I was saying was that do I not need to build paraview-superbuild on my machine and directly use simple pv example and replace simple-paraview with my application. But it wasn’t making sense

Ah ok. So yes, build directly the simple version.

Thank you! So now I would not build paraview-superbuild on my machine and directly use simple-pv example (and it would take care of everything like paraview source code itself etc). Is this correct?

But if this is correct, the only question remains is that would I be able to test my application without building paraview-superbuild on my machine?

Sorry if it is confusing

To create redistributable binaries: just use a modified version of paraview-based-superbuild-example, this will do all the necessary stuff including download and build paraview itself.

To test and develop a ParaView based application, you need a build version of ParaView, but not necessary from the superbuild. You can just manually install the required dependency and build the ParaView project (see instructions )

1 Like

Perfect, thank you so much!

So if I use the simple pv example to test it does work but after installation of the binary file of simple pv it creates a bin folder in simpleParaview folder which has all the dll and other paraview files, is there a way to not expose those files to the user.

In short is there a way for user to only access the Application and not the other files?
And secondly, while creating the binary this way, does it link Qt dynamically or statically?

To avoid the whole dll list, you should build in static.

But note I’m not sure that you can have Qt statically, because to do that you will need to rebuild Qt and as we stated before, it is not supported in our superbuild on windows.

That makes sense, and yes I would also want to dynamically link Qt.
But I can also see vtk dll files, and it also builds the complete paraview application. Why is complete paraview app also generated?

No idea on how to remove the paraview exe from here.
You should dig into the cmake options or look at the packaging step to remove it.

1 Like

You are building ParaView, so paraview.exe is generated, just do not package it.

Hi, So I am trying to create a redistributable binary for my custom application.
What are the steps I should follow to create the redistributable binaries?

The way I am doing it is to clone the Super Build Example and then make changes to it. For now I am trying to build clone 1 example instead of simple-paraview example given in super build example.

And then make the 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 projects: 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
  2. Change the file names.

But right at the end of the build I get this error:

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.

Looks like your paraview project does not have submodule initialized. Can you try again with the pure superbuild example ?