Adding project to ParaView Superbuild


(Jim Eliot) #1

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! :slight_smile:


(Ben Boeckel) #2

Add BUILD_IN_SOURCE 1 to the arguments for the project command.


(Jim Eliot) #3

Thanks for your reply :slight_smile:

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?


(Ben Boeckel) #5

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


(Ben Boeckel) #6

The superbuild is basically a layer on top of ExternalProject 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.


(Jim Eliot) #7

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 :slight_smile:


(Ben Boeckel) #8

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.


(Ben Boeckel) #9

https://gitlab.kitware.com/cmake/cmake/merge_requests/2823


(Jim Eliot) #10

Thanks for your help with this :smiley:


(Ben Boeckel) #11

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