I cloned DualSPHysics v4.2 code from the github repository, and found that CMake was complaining about:
"Cannot find source file:
when trying the CMake option for building the target. It seems to be a small bug in the CMakeLists.txt following the path /src/source/CMakeLists.txt, the solution would be change JLinearValue.o into JLinearValue.cpp at line 9
Another thing that might be worth to mention is that, when building the executable (when running "make"), CMake will give an error like:
"/usr/bin/ld: CMakeFiles/DualSPHysics4.2.dir/DualSPHysics4.2_generated_JCellDivGpu_ker.cu.o: relocation R_X86_64_32 against symbol `_ZN5cudiv20KerSortDataParticlesEjjPKjS1_PKtS1_PK7double2PKdPK6float4PjPtSC_PS4_PdPS9_' can not be used when making a PIE object; recompile with -fPIC
which is self-explanatory, adding the -fPIC flag can solve the problem.
These errors might not be a general problem (might be dependent on gcc version, etc.), just in case someone else encounters the same problem :-)
Thanks for your consideration!