Maybe parallel build mechanism or default settings have changed in Visual Studio (or maybe CMake?) recently. Have you updated to Visual Studio or CMake recently? I don’t have any issues with Visual Studio 16.4.2 (menu: Help / Check for updates) and CMake 3.14.3.
I also use Visual Studio 16.4.2 but with CMake 3.16.2.
Regarding CMake options, I always have -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON, and tried with and without SimpleITK. I built Slicer in itself, and as part of custom app as well.
I only tried this on one computer so far, but I’ll try on more and get back with what I found.
I started a build with CMake 3.16.2 and it failed:
CUSTOMBUILD : error : Target (for copy_if_different command) "D:/D/S4R3/Slicer-build/lib/Slicer-4.11/cli-modules/Release" is not a directory. [D:\D\S4R3\Slicer-build\Base\QTCLI\Testing\InstallPyCLITest4.vcxproj] [D:\D\S4R3\Slicer.vcxproj]
The complete build environment, all tools and options were exactly the same, I just updated CMake from 3.14.3 to 3.16.2. It is either a regression in CMake (which is very common - so far something broke in every major CMake release) or somehow we use CMake incorrectly. As described in the other thread, the problem is that a parallel build is performed by default (and a file is attempted to be copied to a folder that does not exist yet), even though parallel build is not explicitly requested.
It would be interesting to find out why build is not sequential anymore, but it would be probably also useful to allow parallel builds by creating the output directory.
Thank you Andras! At least your fix will make sure Slicer builds with the latest CMake. I agree that it would be interesting to know the actual reason, but I also don’t have capacity to investigate this. For me, your fix is an acceptable solution to this problem.